forked from adopted-ember-addons/ember-sortable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
25 lines (19 loc) · 805 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
'use strict';
const fs = require('fs');
const VersionChecker = require('ember-cli-version-checker');
module.exports = {
name: require('./package').name,
included(app) {
this._super.included.apply(this, arguments);
// Sometimes, consuming app production build can't find the vendor, so it'll break the build with a sourceMapConcat error.
// So guarding this with a if polyfill exists.
if (fs.existsSync('vendor/polyfills/closest.js')) {
app.import('vendor/polyfills/closest.js', { prepend: true});
}
var checker = new VersionChecker(this);
var emberVersion = checker.for('ember-source');
if (emberVersion.lt('3.10.0')) {
this.ui.writeWarnLine('ember-sortable requires the ember-decorator-polyfill. Please add it to your `package.json`.');
}
}
};