12345678910111213141516171819202122232425 |
- let glob = require('glob')
- //配置pages多页面获取当前文件夹下的html和js
- function getEntry(globPath) {
- let entries = {},
- tmp;
- // 读取src/pages/**/底下所有的js文件
- glob.sync(globPath + 'js').forEach(function (entry) {
- tmp = entry.split('/').splice(-3);
- entries[tmp[1]] = {
- entry,
- template: 'index.html', // 当前目录没有有html则以共用的public/index.html作为模板
- filename: tmp[1] + '.html' // 以文件夹名称.html作为访问地址
- };
- });
- return entries;
- }
- let htmls = getEntry('./src/pages/**/*.');
- module.exports = {
- pages: htmls,
- publicPath: './',
- outputDir: 'agreement',
- productionSourceMap: false,
- lintOnSave: false
- }
|