-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathindex.js
33 lines (28 loc) · 1009 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
'use strict';
module.exports = {
name: require('./package').name,
options: {
babel: {
plugins: [
// This is needed for dynamic imports to work: https://github.com/ef4/ember-auto-import#installing-ember-auto-import-in-an-addon
require.resolve('ember-auto-import/babel-plugin'),
],
},
'ember-cli-babel': { enableTypeScriptTransform: true },
},
init() {
this._super.init.apply(this, arguments);
this.maybeAddConcurrencyPlugin();
},
maybeAddConcurrencyPlugin() {
const VersionChecker = require('ember-cli-version-checker');
const checker = new VersionChecker(this.project);
const dep = checker.for('ember-concurrency');
if (dep.gte('4.0.0')) {
// ember-concurrency v4+ requires a custom babel transform. Once we drop ember-concurrency v3 support we can remove this conditional registration.
this.options.babel.plugins.push(
require.resolve('ember-concurrency/async-arrow-task-transform'),
);
}
},
};