我已经为咕unt声创建了一个丑陋的任务。哪个工作正常。但是,一旦使用提到的文件完成操作,该文件就会自动触发另一个任务,而我在任何地方都没有提到过。并且其中包含ES6语法。所以我跳过了那些文件。但是uglify的运行情况相同,
uglify: {
build: {
src: [
'<%= yeoman.dist %>/scripts/vendor/modernizr/*.js',
'<%= yeoman.dist %>/scripts/vendor/jquery/jquery.js',
'<%= yeoman.dist %>/scripts/vendor/spin.js/*.js',
'<%= yeoman.dist %>/scripts/vendor/socket.io-client/socket.io.js',
'<%= yeoman.dist %>/scripts/vendor/codemirror/*.js',
'<%= yeoman.dist %>/scripts/vendor/diff_match_patch/*.js',
'<%= yeoman.dist %>/scripts/vendor/masonry.pkgd.js'
],
dest: '<%= yeoman.dist %>/scripts/vendors.js'
}
}
grunt.registerTask('build', [
'clean:dist',
'babel:dist',
'copy:scripts',
'htmlmin:dust',
'dustjs',
'useminPrepare',
'htmlmin:dist',
'requirejs',
'uglify',
'rev'
]);
错误
Running "uglify:build" (uglify) task
>> 1 file created 1.02 MB → 395.3 kB
Running "uglify:dist\scripts\main.js" (uglify) task
{ [SyntaxError: Unexpected token: name (sortFieldsKey)
at JS_Parse_Error.get (<anonymous>:71:23)