14:13:13] Starting "agency:build"...
events.js:183
throw er; // Unhandled "error" event
^
Error
at new JS_Parse_Error (eval at <anonymous> (D:\0410\wenjian2\gameSystem\node_modules\_uglify-js@2.6.4@uglify-js\tools\node.js:28:1), <anonymous>:1534:18)
at js_error (eval at <anonymous> (D:\0410\wenjian2\gameSystem\node_modules\_uglify-js@2.6.4@uglify-js\tools\node.js:28:1), <anonymous>:1542:11)
at croak (eval at <anonymous> (D:\0410\wenjian2\gameSystem\node_modules\_uglify-js@2.6.4@uglify-js\tools\node.js:28:1), <anonymous>:2089:9)
at token_error (eval at <anonymous> (D:\0410\wenjian2\gameSystem\node_modules\_uglify-js@2.6.4@uglify-js\tools\node.js:28:1), <anonymous>:2097:9)
at expect_token (eval at <anonymous> (D:\0410\wenjian2\gameSystem\node_modules\_uglify-js@2.6.4@uglify-js\tools\node.js:28:1), <anonymous>:2110:9)
at expect (eval at <anonymous> (D:\0410\wenjian2\gameSystem\node_modules\_uglify-js@2.6.4@uglify-js\tools\node.js:28:1), <anonymous>:2113:36)
at regular_for (eval at <anonymous> (D:\0410\wenjian2\gameSystem\node_modules\_uglify-js@2.6.4@uglify-js\tools\node.js:28:1), <anonymous>:2354:9)
at for_ (eval at <anonymous> (D:\0410\wenjian2\gameSystem\node_modules\_uglify-js@2.6.4@uglify-js\tools\node.js:28:1), <anonymous>:2350:16)
at eval (eval at <anonymous> (D:\0410\wenjian2\gameSystem\node_modules\_uglify-js@2.6.4@uglify-js\tools\node.js:28:1), <anonymous>:2229:24)
at eval (eval at <anonymous> (D:\0410\wenjian2\gameSystem\node_modules\_uglify-js@2.6.4@uglify-js\tools\node.js:28:1), <anonymous>:2136:24)
where agencySource. The following is the path, when compressing the code, an error is reported. I don"t know how to compress the code.
gulp.task("agency:cache-templates", function() {
var options = {
removeComments: true, //HTML
collapseWhitespace: true, //HTML
collapseBooleanAttributes: false, // <input checked="true"/> ==> <input />
removeEmptyAttributes: true, // <input id="" /> ==> <input />
removeScriptTypeAttributes: true, //<script>type="text/javascript"
removeStyleLinkTypeAttributes: true, //<style><link>type="text/css"
minifyJS: true, //JS
minifyCSS: true //CSS
};
return gulp.src([agencySource.js.staticViews, agencySource.js.views])
.pipe(htmlmin(options))
.pipe(templateCache("app.js", {
root: "views",
module: "app"
}))
.pipe(gulp.dest(agencySource.build.cache));
});
gulp.task("agency:build", ["agency:cache-templates"], function() {
agencySource.js.src.push(agencySource.build.cache + "/app.js");
return gulp.src(agencySource.js.src)
.pipe(ngAnnotate())
//.pipe(uglify())
.pipe(concat("app.js"))
.pipe(gulp.dest(agencySource.build.cache));
});
`https://www.npmjs.com/package/gulp-uglify`
var uglifyjs = require("uglify-js"); // can be a git checkout
// or another module (such as `uglify-es` for ES6 support)
var composer = require("gulp-uglify/composer");
var pump = require("pump");
var minify = composer(uglifyjs, console);
gulp.task("compress", function (cb) {
// the same options as described above
var options = {};
pump([
gulp.src("lib/*.js"),
minify(options),
gulp.dest("dist")
],
cb
);
});
bosses take a look at it for me, thank you!