annotate client/vue.config.js @ 500:f6d61657b487

Allow accessing client from outside localhost via hostname yarn serve only accepted IP adresses or localhost in the Host-Header before.
author Tom Gottfried <tom@intevation.de>
date Fri, 24 Aug 2018 15:17:35 +0200
parents a80e589c5ade
children 99968a7394f7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23
c1ef0be0ae3d Improve build chain
Thomas Junk <thomas.junk@intevation.de>
parents: 21
diff changeset
1 var CopyWebpackPlugin = require("copy-webpack-plugin");
c1ef0be0ae3d Improve build chain
Thomas Junk <thomas.junk@intevation.de>
parents: 21
diff changeset
2
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
3 module.exports = {
21
d16f799e0469 Configure Webpack to put its output to web-folder
Thomas Junk <thomas.junk@intevation.de>
parents: 13
diff changeset
4 outputDir: "../web",
23
c1ef0be0ae3d Improve build chain
Thomas Junk <thomas.junk@intevation.de>
parents: 21
diff changeset
5 chainWebpack: config => {
c1ef0be0ae3d Improve build chain
Thomas Junk <thomas.junk@intevation.de>
parents: 21
diff changeset
6 let vendorImgPath = process.env.VUE_APP_VENDOR_IMG_PATH;
c1ef0be0ae3d Improve build chain
Thomas Junk <thomas.junk@intevation.de>
parents: 21
diff changeset
7 if (!vendorImgPath) return;
c1ef0be0ae3d Improve build chain
Thomas Junk <thomas.junk@intevation.de>
parents: 21
diff changeset
8 config
c1ef0be0ae3d Improve build chain
Thomas Junk <thomas.junk@intevation.de>
parents: 21
diff changeset
9 .plugin("CopyWebpackPlugin")
c1ef0be0ae3d Improve build chain
Thomas Junk <thomas.junk@intevation.de>
parents: 21
diff changeset
10 .use(CopyWebpackPlugin, [[{ from: vendorImgPath, to: "img" }]], {
c1ef0be0ae3d Improve build chain
Thomas Junk <thomas.junk@intevation.de>
parents: 21
diff changeset
11 copyUnmodified: true
c1ef0be0ae3d Improve build chain
Thomas Junk <thomas.junk@intevation.de>
parents: 21
diff changeset
12 });
c1ef0be0ae3d Improve build chain
Thomas Junk <thomas.junk@intevation.de>
parents: 21
diff changeset
13 },
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
14 devServer: {
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
15 proxy: {
329
71970f03c9e8 SPA: Fixed setup for proxy in "serve" dev server mode.
Sascha Wilde <wilde@intevation.de>
parents: 23
diff changeset
16 "/api": {
353
a80e589c5ade fix: Fix broken environment variable setting
Thomas Junk <thomas.junk@intevation.de>
parents: 329
diff changeset
17 target: process.env.VUE_BACKEND_API_URL,
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
18 secure: false
11
e0b5dd98665e current frontend with asset server configured
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
19 },
23
c1ef0be0ae3d Improve build chain
Thomas Junk <thomas.junk@intevation.de>
parents: 21
diff changeset
20 "/img/*": {
11
e0b5dd98665e current frontend with asset server configured
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
21 target: "http://localhost:5000",
e0b5dd98665e current frontend with asset server configured
Thomas Junk <thomas.junk@intevation.de>
parents: 3
diff changeset
22 secure: false
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
23 }
500
f6d61657b487 Allow accessing client from outside localhost via hostname
Tom Gottfried <tom@intevation.de>
parents: 353
diff changeset
24 },
f6d61657b487 Allow accessing client from outside localhost via hostname
Tom Gottfried <tom@intevation.de>
parents: 353
diff changeset
25 disableHostCheck: true
3
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
26 }
1597506a2241 merge with vue-cli
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
27 };