工程要上线可是提示代码框架重复 想用gulp对代码里的ts文件做混淆操作。 代码是用ts不是js写的~
操作如下:
return gulp.src([‘assets/Script/*.js’])
//.pipe(rename({suffix: '.min'}))
.pipe(
uglify({
mangle:false,//类型:Boolean 默认:true 是否修改变量名
compress:true,//类型:Boolean 默认:true 是否完全压缩
//preserveComments: all //保留所有注释
})
)
.pipe(stripDebug())
.pipe(gulp.dest('dist/Scripts/web'))
.pipe(notify({ message: '压缩完成' }));
上网找的 可是提示错误:
events.js:174
throw er; // Unhandled ‘error’ event
^
SyntaxError: ‘import’ and ‘export’ may appear only with ‘sourceType: module’
请问有人知道是什么问题吗。?