DevPro
DevPro

Reputation: 21

EXTJS: Sencha CMD Production build doesnot remove console.log statements

When i built Ext JSapp using Sencha CMD command: sencha app build, though the files are minified, extra spaces removed etc BUT the console.log statements still persist and gets executed which is unwanted in PROD ENV!. Any configurations needed while build, so that console log statment(console.log, info, warn etc) can be wiped/removed in Prod Built code output?

Thanks !

Upvotes: 0

Views: 749

Answers (1)

Dave L.
Dave L.

Reputation: 9801

You should use Ext.log instead of console.log. Then the statements should not be included in the production build.

You can see in the source file, it uses debug directives like this:

log:
    //<debug>
        (function () {
...

You can read more about debug directives here.

Upvotes: 2

Related Questions