找不到Gruntfile.js grunt-contrib-uglify

时间:2014-05-03 20:30:09

标签: gruntjs

我是新来的咕噜咕噜,还在找我的脚。

我安装了grunt并使用

进行了uglify
npm install grunt-contrib-uglify --save-dev

我在gruntfile.js中有以下内容来测试缩小css文件

  // Code example 01-minify
  module.exports = function(grunt) {

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

  // Project configuration.
  grunt.initConfig({
    uglify: {
        target1: {
            src: 'styles.css',
            dest: 'styles.min.css'
        }
    }
  });
  // Define the default task
  grunt.registerTask('default', ['uglify']);
  };

如果我运行grunt,我会

  Local Npm module "grunt-contrib-uglify" not found. Is it installed?
  Warning: Task "uglify" not found. Use --force to continue.

0 个答案:

没有答案