jkarsrud / ember-cli-defeatureify

Ember-CLI addon to defeatureify your apps
MIT License
18 stars 6 forks source link

Simplify the option to remove debug and assert messages in production builds #6

Closed sivakumar-kailasam closed 9 years ago

sivakumar-kailasam commented 9 years ago

Some users might want to use this package just to strip away debug and assert messages and instead of providing the config shown below, would it make sense to have a boolean option like stripDebugAndAsserts which can set these options internally?

defeatureify: {
                'features': {},
        'enableStripDebug': true,
        'debugStatements': [
                'Ember.warn',
                'Ember.default.warn',
                'Ember.assert',
                'Ember.default.assert',
                'Ember.deprecate',
                'Ember.default.deprecate',
                'Ember.debug',
                'Ember.default.debug',
                'Ember.Logger.info',
                'Ember.default.Logger.info',
                'Ember.runInDebug',
                'Ember.default.runInDebug'
            ]
    }

If you find this useful I can make the change and send a PR

jkarsrud commented 9 years ago

That seems like a good idea! I'm thinking the addon should have Ember's debugStatements inside the extension, and then merge them with debugStatements passed in through options. There should still be a check for enableStripDebug imo, but it can default to true.

If you want to submit a PR for it, that would be great! :)

sivakumar-kailasam commented 9 years ago

:+1: will do it sometime over the weekend. Can you bump and publish a new version for #7