【发布时间】:2016-05-03 23:20:15
【问题描述】:
我正在尝试使用 gulp 实用程序混淆我的 JS 代码。 [离子应用]
gulp.task('ng_annotate_app',function (done) {
gulp.src(['!www/js/toaster.min.js','www/js/*.js','www/common/*.js'])
.pipe(strip())
.pipe(stripDebug())
.pipe(rename({
suffix: ".min",
extname: ".js"
}))
.pipe(uglify({mangle: false}))
.pipe(ngAnnotate({single_quotes: true}))
.(obfuscate())
.pipe(gulp.dest('www/dist'))
.on('end', done);
});
我在文件 a.js 中有我的 angular 模块启动器,在 b.js 中有工厂,如下所示。 a.js:
var mod=angular.module ...
b.js
mod.factory ...
a.js 中的 var mod 被混淆为一些虚拟字符串,但在 b.js 中它没有改变。因此我的应用程序显示错误并且无法运行。
感谢您的帮助!
【问题讨论】:
标签: javascript ionic-framework gulp