https://github.com/ramonszo/babel-plugin-inline-script-import
A babel plugin that inlines all JS imports straight into your code.
https://github.com/ramonszo/babel-plugin-inline-script-import
Last synced: about 1 month ago
JSON representation
A babel plugin that inlines all JS imports straight into your code.
- Host: GitHub
- URL: https://github.com/ramonszo/babel-plugin-inline-script-import
- Owner: ramonszo
- License: mit
- Created: 2017-10-26T18:19:33.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-04-09T01:17:25.000Z (about 2 years ago)
- Last Synced: 2024-10-16T07:32:46.344Z (8 months ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# babel-plugin-inline-script-import
A babel plugin that inlines all JS imports straight into your code.## Example
Given the following module file:```js
export const foo = {
doSomething: function(){
}
};
```The plugin will transform:
```js
import foo from 'scripts/foo.js';foo.doSomething();
```to:
```js
var foo = {
doSomething: function(){}
};foo.doSomething();
```## Installation
Install the plugin through `npm`, you will also need `babel` installed:
```sh
$ 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:
```json
{
"plugins": [
["inline-script-import", {}]
]
}
```## License
MIT---