4.0.0 • Published 6 years ago

easywebpack-html v4.0.0

Weekly downloads
7
License
MIT
Repository
github
Last release
6 years ago

easywebpack-html

static html webpack build for easywebpack.

  • support static html template
  • support nunjucks html template

Version

  • webpack 3.x.x : easywebpack ^3.x.x
  • webpack 4.x.x : easywebpack ^4.x.x

Install

$ npm i easywebpack-html --save-dev

Usage

// build/index.js
const HtmlWebpack = require('easywebpack-html');
const config = {
  entry: {
    index: './scr/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);
}

Run

{
 "scripts": {
   "build": "cross-env NODE_ENV=development node build",
   "start" : "cross-env NODE_SERVER=true NODE_ENV=development node build"
 }
}
npm start

Example

4.0.0

6 years ago

4.0.0-rc.1

6 years ago

3.0.0

6 years ago

3.0.0-rc.1

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.0.1

6 years ago