0

タイトルが言うように、私は Grunt が初めてです。http://24ways.org/2013/grunt-is-not-weird-and-hard/にあるチュートリアルに従っています。これは古いチュートリアルですが、ほとんどは同じように機能するようです。「grunt-contrib-concat」と「grunt-contrib-uglify」をインストールし、両方を個別に実行できます。しかし、 を実行するgruntと、次のエラーが表示Warning: Task "concat, uglify" not found. Use --force to continue. Aborted due to errors.されます。私のファイルは次のとおりです。

Gruntfile.js:

module.exports = function(grunt) {

            // 1. All configuration goes here 
            grunt.initConfig({
                pkg: grunt.file.readJSON('package.json'),

                concat: {

                    dist: {
                        src: [
                            'js/libs/*.js', // All JS in the libs folder
                            'js/controls.js', // This specific file
                        ],
                        dest: 'dist/built.js',
                    }
                },

                uglify: {
                    build: {
                        src: 'js/build/production.js',
                        dest: 'js/build/production.min.js',
                    }
                },

            });

            // 3. Where we tell Grunt we plan to use this plug-in.
            grunt.loadNpmTasks('grunt-contrib-concat');
            grunt.loadNpmTasks('grunt-contrib-uglify');

            // 4. Where we tell Grunt what to do when we type 'grunt' into the terminal.
            grunt.registerTask('default', ['concat, uglify']);

        };

パッケージ.json:

{
  "name": "grunt_libsass_example-project",
  "version": "0.1.0",
  "devDependencies": {
    "grunt": "~0.4.1",
    "grunt-contrib-concat": "^0.5.1",
    "grunt-contrib-uglify": "^0.9.1"
  }
}
4

1 に答える 1