@vrbo/nimbuild-webpack
![Build Status](https://travis-ci.org/expediagroup/nimbuild.svg?branch=master)
Library that provides nimbuild webpack bundling at runtime
Why
See nimbuild-corejs
Installation
npm install --save @vrbo/nimbuild-webpack
Usage
Import module and prime cache
const webpacknimbuild = require('@vrbo/nimbuild-webpack')({
webpackConfig: {...},
maxEntries: 100
});
async function getBundleString() {
const response = await webpacknimbuild.run({
entry: ['react', 'react-dom'],
minify: true,
modifyScript: (script) => {
return `!function (undefined) { 'use strict'; ${script} }();`;
}
});
return response.script;
}
Configure nimbuild-webpack
to handle ES6+ source code
const webpacknimbuild = require('@vrbo/nimbuild-webpack')({
webpackConfig: {
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader'
}
]
}
}
});
Development
Starting development harness
npm start
Prettier
This projects supports auto-formatting of source code! Simply find your favorite IDE from the list in the following list: https://prettier.io/docs/en/editors.html
For VSCode support, perform the following steps:
- Launch VS Code Quick Open (Ctrl+P)
- Paste the following command, and press enter:
ext install esbenp.prettier-vscode