ember-cli-polyfill-importer
Advanced tools
Comparing version
12
index.js
@@ -7,2 +7,10 @@ 'use strict'; | ||
const FASTBOOT_TRANSFORMATION_OPTION = { | ||
using: [ | ||
{ | ||
transformation: 'fastbootShim', | ||
} | ||
] | ||
}; | ||
module.exports = { | ||
@@ -20,2 +28,3 @@ name: require('./package').name, | ||
let browsers = this.project.targets && this.project.targets.browsers; | ||
let hasFastboot = this.project.findAddonByName('ember-cli-fastboot'); | ||
@@ -27,5 +36,6 @@ Object.keys(options).forEach((packageName) => { | ||
let files = packageOptions.files || []; | ||
let importOptions = Object.assign({}, hasFastboot ? FASTBOOT_TRANSFORMATION_OPTION : {}, packageOptions.importOptions || {}); | ||
files.forEach((f) => { | ||
importer.import(path.join('node_modules', packageName, f), packageOptions.importOptions); | ||
importer.import(path.join('node_modules', packageName, f), importOptions); | ||
}); | ||
@@ -32,0 +42,0 @@ } |
{ | ||
"name": "ember-cli-polyfill-importer", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "The default blueprint for ember-cli addons.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -12,3 +12,5 @@ # ember-cli-polyfill-importer | ||
It will also use the fastbootShim transformation while importing, if `ember-cli-fastboot` is installed in the host app. | ||
Compatibility | ||
@@ -55,10 +57,3 @@ ------------------------------------------------------------------------------ | ||
// optionally, you can define the options to use when calling app.import | ||
// very useful to import polyfills in a fastboot safe way like in this example | ||
importOptions: { | ||
using: [ | ||
{ | ||
transformation: 'fastbootShim', | ||
} | ||
] | ||
} | ||
importOptions: { } | ||
} | ||
@@ -94,10 +89,3 @@ } | ||
// optionally, you can define the options to use when calling app.import | ||
// very useful to import polyfills in a fastboot safe way like in this example | ||
importOptions: { | ||
using: [ | ||
{ | ||
transformation: 'fastbootShim', | ||
} | ||
] | ||
} | ||
importOptions: { } | ||
} | ||
@@ -104,0 +92,0 @@ } |
9077
0.58%71
14.52%100
-10.71%