@@ -79,11 +79,11 @@ node server.js
7979 ``` js
8080 const entries = {}
8181 const chunks = []
82- glob .sync (' ./src/pages/**/* .js' ).forEach (path => {
82+ glob .sync (' ./src/pages/**/app .js' ).forEach (path => {
8383 // Get all the entry js files and forEach them
8484
85- const chunk = path .split (' ./src/pages/' )[1 ].split (' .js' )[0 ]
86- // E.g, chunk = 'user/index/app ' path = './src/pages/user/index/app.js'
85+ const chunk = path .split (' ./src/pages/' )[1 ].split (' /app .js' )[0 ]
86+ // E.g, chunk = 'user/index' path = './src/pages/user/index/app.js'
8787
8888 entries[chunk] = path
8989 // Now we got the entries
@@ -116,15 +116,15 @@ node server.js
116116 // ...
117117 }
118118 // ...
119- glob.sync('./src/pages/**/* .html').forEach(path => {
119+ glob.sync('./src/pages/**/app .html').forEach(path => {
120120 // Get all the html template files and forEach them
121121 // E.g, path = './src/pages/user/index/app.html'
122122
123123 const filename = path.split('./src/pages/')[1].split('/app.html')[0] + '.html'
124124 // E.g, the html filename will be 'user/index.html' in the 'dist' folder
125125
126- const chunk = path.split('./src/pages/')[1].split('.html')[0]
127- // E,g. the chunk will be 'user/login/app '
126+ const chunk = path.split('./src/pages/')[1].split('/app .html')[0]
127+ // E,g. the chunk will be 'user/login'
128128
129129 const htmlConf = {
130130 filename: filename,
@@ -141,4 +141,5 @@ node server.js
141141## Inspired by [element- starter](https: // github.com/ElementUI/element-starter)
142142
143143## License
144+
144145MIT
0 commit comments