forked from Addepar/ember-table
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
52 lines (42 loc) · 1.37 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
'use strict';
const VersionChecker = require('ember-cli-version-checker');
module.exports = {
name: 'ember-table',
options: {
babel: {
plugins: [
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-numeric-separator',
'@babel/plugin-proposal-optional-catch-binding',
],
},
},
included() {
this._super.included.apply(this, arguments);
this.checker = new VersionChecker(this.project);
let importOptions;
// If `ember-cli-fastboot` is being used in the root project, use the
// fastboot transform when importing
if (this.project.findAddonByName('ember-cli-fastboot')) {
importOptions = {
using: [
{
transformation: 'fastbootShim',
},
],
};
}
this.import('node_modules/css-element-queries/src/ResizeSensor.js', importOptions);
this.import('node_modules/hammerjs/hammer.js', importOptions);
},
isDevelopingAddon() {
// this prevents templates from being cached before we can strip them out
// they get cached by jshintAddonTree before we can intervene
if (this.checker.for('ember-source').gte('2.3.0')) {
return this._super.isDevelopingAddon.apply(this, arguments);
}
return false;
},
};