Skip to content

A babel plugin that inlines all JS imports straight into your code.

License

Notifications You must be signed in to change notification settings

ramonszo/babel-plugin-inline-script-import

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

babel-plugin-inline-script-import

A babel plugin that inlines all JS imports straight into your code.

Example

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();

Installation

Install the plugin through npm, you will also need babel installed:

$ npm install --save-dev babel-plugin-inline-script-import

Add 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", {}]
  ]
}

License

MIT


About

A babel plugin that inlines all JS imports straight into your code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages