-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
43 lines (41 loc) · 1.05 KB
/
vue.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const glob = require('glob')
const path = require('path')
require('dotenv').config()
module.exports = {
outputDir: "assets/webpack/",
devServer: {
port: process.env.DEV_SERVER_PORT,
host: "0.0.0.0",
public: process.env.DEV_SERVER_PUBLIC,
watchOptions: {
poll: true
},
publicPath: '/',
writeToDisk: true,
https: false,
disableHostCheck: true,
},
publicPath: `themes/${path.basename(__dirname)}/assets/webpack/`,
pages: glob.sync('src/**/*.js').map(entry => ({
entry,
template: entry.replace(/\.js$/, '.htm'),
filename: entry.replace(/\.js$/, '.webpack.htm').replace(/^src/, `${__dirname}/pages`),
minify: {
removeComments: true
}
})).reduce((obj, el) => ({
...obj,
[el.entry]: el,
}), {})
// pages: {
// // TODO: auto scan all files
// test: {
// entry: "src/test.js",
// template: "src/test.htm",
// filename: "../pages/test.htm",
// minify: {
// removeComments: true
// }
// }
// }
}