A babel plugin that inlines all JS imports straight into your code.
Given the following module file:
export const foo = {
doSomething: function(){
}
};The plugin will transform:
import foo from 'scripts/foo.js';
foo.doSomething();to:
var foo = {
doSomething: function(){
}
};
foo.doSomething();Install the plugin through npm, you will also need babel installed:
$ npm install --save-dev babel-plugin-inline-script-importAdd babel-plugin-inline-script-import to the list of plugins. If you are using a .babelrc file, the file should have an entry that looks like this:
{
"plugins": [
["inline-script-import", {}]
]
}MIT