Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/easy-team/easywebpack-html
HTML静态多页面Webpack构建工程化解决方案
https://github.com/easy-team/easywebpack-html
html html-template html-webpack-plugin nunjucks nunjucks-templates webpack
Last synced: about 2 months ago
JSON representation
HTML静态多页面Webpack构建工程化解决方案
- Host: GitHub
- URL: https://github.com/easy-team/easywebpack-html
- Owner: easy-team
- License: mit
- Created: 2017-11-26T13:37:07.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-18T03:24:47.000Z (about 6 years ago)
- Last Synced: 2024-10-24T08:32:02.557Z (about 2 months ago)
- Topics: html, html-template, html-webpack-plugin, nunjucks, nunjucks-templates, webpack
- Language: JavaScript
- Homepage: https://easyjs.cn
- Size: 11.7 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: History.md
- License: LICENSE
Awesome Lists containing this project
README
# easywebpack-html
[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![David deps][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url][npm-image]: https://img.shields.io/npm/v/easywebpack-html.svg?style=flat-square
[npm-url]: https://npmjs.org/package/easywebpack-html
[travis-image]: https://img.shields.io/travis/hubcarl/easywebpack-html.svg?style=flat-square
[travis-url]: https://travis-ci.org/hubcarl/easywebpack-html
[codecov-image]: https://img.shields.io/codecov/c/github/hubcarl/easywebpack-html.svg?style=flat-square
[codecov-url]: https://codecov.io/github/hubcarl/easywebpack-html?branch=master
[david-image]: https://img.shields.io/david/hubcarl/easywebpack-html.svg?style=flat-square
[david-url]: https://david-dm.org/hubcarl/easywebpack-html
[snyk-image]: https://snyk.io/test/npm/easywebpack-html/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/easywebpack-html
[download-image]: https://img.shields.io/npm/dm/easywebpack-html.svg?style=flat-square
[download-url]: https://npmjs.org/package/easywebpack-htmlstatic html webpack build for easywebpack.
- support static html template
- support nunjucks html template## Version
- easywebpack ^4.x.x > webpack 4.x.x
- easywebpack ^3.x.x > webpack 3.x.x## Install
```bash
$ npm i easywebpack-html --save-dev
```## Usage
```js
// 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);
}
```## Run
```js
{
"scripts": {
"build": "cross-env NODE_ENV=development node build",
"start" : "cross-env NODE_SERVER=true NODE_ENV=development node build"
}
}
``````bash
npm start
```
## Example
- [easywebpack-multiple-html-boilerplate](https://github.com/hubcarl/easywebpack-multiple-html-boilerplate) Multiple static html build boilerplate.
- you can use [easywebpack-cli](https://github.com/hubcarl/easywebpack-cli) create multiple static html build boilerplate.