0

我正在使用 grunt 来缩小 CSS。

但是,当我尝试更改缩小数组中的参数时

ext: '.min.css' to ext: '.css' 

src: ['*.css', '!*.min.css'],

我无法缩小 CSS。'.min' 重要吗?

我的 gruntfile 如下

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
      },
      build: {
        files: [{
            expand: true,
            src: '**/*.js',
            dest: 'resources/front/js',
            cwd: 'assets/front/js'
        }]
      }
    },
   cssmin: {
      minify: {
        expand: true,
        cwd: 'assets/front/css/',
        src: ['*.css', '!*.min.css'],
        dest: 'resources/front/css/',
        ext: '.min.css'
      }
    }

    });

  // Load the plugin that provides the "uglify" task.
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-cssmin');

  // Default task(s).
  grunt.registerTask('default', ['cssmin']);

};
4

1 回答 1

0

我需要做的就是改变

ext: '.min.css'

ext: '.css'
于 2014-02-08T10:12:46.383 回答