static html webpack build for easywebpack.
- support static html template
- support nunjucks html template
- easywebpack ^4.x.x > webpack 4.x.x
- easywebpack ^3.x.x > webpack 3.x.x
$ npm i easywebpack-html --save-dev
// build/index.js
const HtmlWebpack = require('easywebpack-html');
const config = {
entry: {
index: './src/index.js'
},
template: 'view/layout.html'
};
if (process.env.NODE_SERVER) {
// development mode: webpack building and start webpack hot server
HtmlWebpack.server(config);
} else {
// webpack build file to disk
HtmlWebpack.build(config);
}
{
"scripts": {
"build": "cross-env NODE_ENV=development node build",
"start" : "cross-env NODE_SERVER=true NODE_ENV=development node build"
}
}
npm start
-
easywebpack-multiple-html-boilerplate Multiple static html build boilerplate.
-
you can use easywebpack-cli create multiple static html build boilerplate.