2

What is the best way to disable debug data from a gulp production build? The documented way to disable debug data is:

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

I'm using gulp-typescript to build the app. Since Typescript has no conditional compilation, I have no idea how I could set the parameter from true to false in a gulp production build without changing the code.

The only solution I can think of is to conditionally add debug.ts or release.ts to the gulp.src for gulp-typescript. Do you know a better solution?

1 Answer 1

2

You can use gulp-ng-constant for application configuration. Here is good practical example. The good thing is that constants are available during config phase, it suits your case.

But adding config files conditionally is also the appropriate way.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.