lbqdly / webpack-multiple-page-boilerplate

webpack-multiple-page-boilerplate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

webpack multiple page boilerplate

This is a webpack multiple page boilerplate,we don't need router.

这是一个使用webpack构建多页面样版,避免了使用router。

usage

Just add the options to entries.js config as follows ( base on html-webpack-plugin) :

只需要向 entries.js 文件添加配置即可,如下所示(配置文件是基于 html-webpack-plugin 的拓展):

{   
  //page html name
  filename: 'page0.html',
  //page entry js
  entry: './pages/page0',
  //commons chunks
  chunks: ['vendor'],
  //title: 'my website',
  //template:'',
  //inject:'head||body',
  //favicon:'',
  //...
  //https://github.com/jantimon/html-webpack-plugin
}

开始编码

npm run dev

构建可用于发布的代码

npm run build

About

webpack-multiple-page-boilerplate


Languages

Language:JavaScript 83.2%Language:HTML 13.1%Language:CSS 3.7%