Skip to content

Commit 082d61b

Browse files
author
Timothy Asquith
committed
Allows configurable shim format (AMD or ES2015)
1 parent 6e9a5bc commit 082d61b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ module.exports = {
1616
app.import('vendor/jquery/jquery.js', { prepend: true });
1717
}
1818

19-
app.import('vendor/shims/jquery.js');
20-
2119
let checker = new VersionChecker(this);
2220
let ember = checker.forEmber();
2321

@@ -28,6 +26,14 @@ module.exports = {
2826
if (optionalFeatures && !optionalFeatures.isFeatureEnabled('jquery-integration')) {
2927
app.project.ui.writeDeprecateLine('You have disabled the `jquery-integration` optional feature. You now have to delete `@ember/jquery` from your package.json');
3028
}
29+
30+
const appConfig = app.project.config(app.env)['ember-jquery'] || {};
31+
32+
if (appConfig.moduleFormat === 'amd') {
33+
app.import('vendor/shims/jquery-amd.js');
34+
} else {
35+
app.import('vendor/shims/jquery.js');
36+
}
3137
},
3238

3339
treeForVendor: function(tree) {

0 commit comments

Comments
 (0)