@@ -4,7 +4,8 @@ const HtmlWebpackPlugin = require("html-webpack-plugin");
4
4
const HtmlWebpackIncludeAssetsPlugin = require ( 'html-webpack-include-assets-plugin' ) ;
5
5
const {
6
6
project,
7
- env
7
+ env,
8
+ multi
8
9
} = require ( './project' ) ;
9
10
const config = require ( '../config/index' ) ;
10
11
let reg = / \. \S + $ / ;
@@ -16,12 +17,12 @@ let VUE = config.vue;
16
17
let minify = undefined ;
17
18
// console.log(config);
18
19
if ( env === 'prod' ) {
19
- minify = {
20
- removeComments : true ,
21
- collapseWhitespace : true ,
22
- removeAttributeQuotes : true ,
23
- chunksSortMode : 'dependency'
24
- } ;
20
+ // minify = {
21
+ // removeComments: true,
22
+ // collapseWhitespace: true,
23
+ // removeAttributeQuotes: true,
24
+ // chunksSortMode: 'dependency'
25
+ // };
25
26
projectDistDir = path . resolve ( __dirname , '../../dist/' + project ) + '/' ; //项目多页面的pages目录
26
27
}
27
28
fs . readdirSync ( pagesDir )
@@ -41,6 +42,7 @@ const extraEntry = pagesPath;
41
42
// // 生成HtmlWebpackPlugin
42
43
let extraHtmlWebpackPlugins = [ ] ;
43
44
for ( let i in pagesPath ) {
45
+
44
46
extraHtmlWebpackPlugins . push (
45
47
new HtmlWebpackPlugin ( {
46
48
filename : projectDistDir + i + ".html" ,
@@ -49,7 +51,7 @@ for (let i in pagesPath) {
49
51
minify : env === 'prod' ? minify : { }
50
52
} ) ,
51
53
new HtmlWebpackIncludeAssetsPlugin ( {
52
- assets : env === 'prod' ? [ 'vendor.dll.js' ] : [ 'static/js/vendor.dll.js' ] ,
54
+ assets : env === 'prod' ? [ '../static/js/ vendor.dll.js' ] : [ 'static/js/vendor.dll.js' ] ,
53
55
append : false
54
56
} )
55
57
) ;
0 commit comments