在gulp / typescript生成版本中禁用AngularJS调试数据

时间:2015-07-23 11:23:53

标签: javascript angularjs typescript gulp

从gulp生成版本中禁用调试数据的最佳方法是什么?禁用调试数据的documented方法是:

myApp.config(['$compileProvider', function ($compileProvider) {
  $compileProvider.debugInfoEnabled(false);
}]);

我正在使用gulp-typescript来构建应用。由于Typescript没有条件编译,我不知道如何在不改变代码的情况下在gulp生成构建中将参数从true设置为false。

我能想到的唯一解决方案是有条件地将debug.tsrelease.ts添加到gulp.src的{​​{1}}。你知道更好的解决方案吗?

1 个答案:

答案 0 :(得分:2)

您可以使用gulp-ng-constant进行应用程序配置。 Here is很好的实际例子。好的是constant期间可以使用config,这适合您的情况。

但有条件地添加配置文件也是合适的方式。