forked from kturney/ember-mapbox-gl
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
34 lines (27 loc) · 796 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
34
'use strict';
module.exports = {
name: require('./package').name,
// isDevelopingAddon() {
// return true;
// },
options: {
autoImport: {
skipBabel: [{ package: 'mapbox-gl', semverRange: '*' }],
},
babel: {
// Ensure that `ember-auto-import` can handle the dynamic imports
plugins: [require.resolve('ember-auto-import/babel-plugin')],
},
},
included(app) {
this._super.included.apply(this, arguments);
const path = require('path');
const mapboxPkg = require(require.resolve('mapbox-gl/package.json', {
paths: [app.project.root],
}));
const stylesPath = require.resolve(`mapbox-gl/${mapboxPkg.style}`, {
paths: [app.project.root],
});
app.import(path.relative(app.project.root, stylesPath));
},
};