-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
35 lines (31 loc) · 1.2 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
module.exports = {
publicPath:
process.env.NODE_ENV === "production"
? "/static/dist/"
: "http://127.0.0.1:8080",
outputDir: "./static/dist",
indexPath: "../../templates/base-vue.html", // relative to outputDir!
chainWebpack: (config) => {
/*
The arrow function in writeToDisk(...) tells the dev server to write
only index.html to the disk.
The indexPath option (see above) instructs Webpack to also rename
index.html to base-vue.html and save it to Django templates folder.
We don't need other assets on the disk (CSS, JS...) - the dev server
can serve them from memory.
See also:
https://cli.vuejs.org/config/#indexpath
https://webpack.js.org/configuration/dev-server/#devserverwritetodisk-
*/
config.devServer
.public("http://127.0.0.1:8080")
.hotOnly(true)
.headers({ "Access-Control-Allow-Origin": "*" })
.writeToDisk((filePath) => filePath.endsWith("index.html"));
config.entryPoints.delete("app");
config.entry("main").add("./frontend/src/main.js");
config.plugin("html").tap((args) => {
return [{ template: "./frontend/public/index.html" }];
});
},
};