Skip to content

Commit

Permalink
use ember-cli-polyfill-importer and add nodelist forEach polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelcobain committed Feb 15, 2019
1 parent da3987f commit 55858e8
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 114 deletions.
36 changes: 35 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,44 @@ const componentDependencies = {
]
}
};

const fastbootTransformation = {
using: [
{
transformation: 'fastbootShim'
}
]
};

module.exports = {
name: require('./package').name,

options: {
polyfills: {
'polyfill-nodelist-foreach': {
files: ['index.js'],
// compatibility from https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach
browsers: ['ie > 0', 'chrome < 52', 'ff < 50', 'opera < 38', 'safari < 10', 'edge < 16', 'android < 51', 'and_chr < 51', 'and_ff < 50', 'ios_saf < 10', 'Samsung < 5'],
importOptions: fastbootTransformation
},
'classlist-polyfill': {
files: ['src/index.js'],
caniuse: 'classlist',
importOptions: fastbootTransformation
},
'element-closest': {
files: ['browser.js'],
caniuse: 'element-closest',
importOptions: fastbootTransformation
},
'matchmedia-polyfill': {
files: ['matchMedia.js'],
caniuse: 'matchmedia',
importOptions: fastbootTransformation
}
}
},

included() {
this._super.included.apply(this, arguments);
let app;
Expand All @@ -395,7 +430,6 @@ module.exports = {
app.import('vendor/ember-paper/register-version.js');
app.import('vendor/hammerjs/hammer.js');
app.import('vendor/propagating-hammerjs/propagating.js');

},

config() {
Expand Down
190 changes: 80 additions & 110 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 55858e8

Please sign in to comment.