-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathvue.config.js
47 lines (44 loc) · 1.16 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
44
45
46
47
const path = require("path");
const ManifestPlugin = require("webpack-manifest-plugin");
const FileManagerPlugin = require("filemanager-webpack-plugin");
modern = process.env.VUE_CLI_MODERN_MODE;
production = process.env.NODE_ENV === "production";
config = {
protocol: "http",
host: "localhost",
port: 8080,
watchDir: "templates"
};
module.exports = {
runtimeCompiler: true,
publicPath: `${config.protocol}://${config.host}:${config.port}/`,
outputDir: "web/dist",
filenameHashing: true,
css: {
sourceMap: true
},
devServer: {
https: config.https,
host: config.host,
port: config.port,
clientLogLevel: "info",
headers: { "Access-Control-Allow-Origin": "*" },
disableHostCheck: true,
contentBase: path.join(__dirname, config.watchDir),
watchContentBase: true
},
configureWebpack: {
plugins: [
new ManifestPlugin({
fileName: modern ? "manifest.json" : "manifest-legacy.json",
publicPath: production ? "/dist/" : "/"
}),
new FileManagerPlugin({
onEnd: {
// Delete unnecessary index.html file
delete: ["./web/dist/index.html"]
}
})
]
}
};