Skip to content

Commit f43ec01

Browse files
author
Lenny Burdette
committed
feat(ember-cli): load debug build in Ember CLI dev/test builds
This change adds a `loader.debug` option to Ember CLI builds. It defaults to true for development and test builds. When true, it prepends loader.debug.js instead of loader.js to the application's vendor.js.
1 parent 3005e72 commit f43ec01

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

index.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,23 @@ module.exports = {
1010
this.treePaths['vendor'] = 'dist';
1111
},
1212

13-
included: function() {
13+
included: function(app, parentAddon) {
14+
var isDevelopmentOrTest = app.env === 'development' || app.env === 'test';
15+
var target = parentAddon || app;
16+
17+
target.options = target.options || {};
18+
target.options.loader = target.options.loader || { debug: isDevelopmentOrTest };
19+
1420
if (false /* hotfix */&& shouldUseInstrumentedBuild()) {
15-
this.app.import('vendor/loader/loader.instrument.js', {
21+
app.import('vendor/loader/loader.instrument.js', {
1622
prepend: true
17-
})
23+
});
24+
} else if (target.options.loader.debug) {
25+
app.import('vendor/loader/loader.debug.js', {
26+
prepend: true
27+
});
1828
} else {
19-
this.app.import('vendor/loader/loader.js', {
29+
app.import('vendor/loader/loader.js', {
2030
prepend: true
2131
});
2232
}

0 commit comments

Comments
 (0)