Mercurial > gemma
annotate client/vue.config.js @ 1287:54b7d8e2b224
merge
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Thu, 22 Nov 2018 11:48:54 +0100 |
parents | bc55ffaeb639 |
children | ef388dcbb946 |
rev | line source |
---|---|
568
99968a7394f7
feat: PurgeCSS added to remove unnecessary CSS weight
Thomas Junk <thomas.junk@intevation.de>
parents:
500
diff
changeset
|
1 const CopyWebpackPlugin = require("copy-webpack-plugin"); |
1069
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
990
diff
changeset
|
2 const PurgecssPlugin = require("purgecss-webpack-plugin"); |
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
990
diff
changeset
|
3 const glob = require("glob-all"); |
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
990
diff
changeset
|
4 const path = require("path"); |
23 | 5 |
3 | 6 module.exports = { |
21
d16f799e0469
Configure Webpack to put its output to web-folder
Thomas Junk <thomas.junk@intevation.de>
parents:
13
diff
changeset
|
7 outputDir: "../web", |
23 | 8 chainWebpack: config => { |
9 let vendorImgPath = process.env.VUE_APP_VENDOR_IMG_PATH; | |
10 if (!vendorImgPath) return; | |
11 config | |
12 .plugin("CopyWebpackPlugin") | |
13 .use(CopyWebpackPlugin, [[{ from: vendorImgPath, to: "img" }]], { | |
14 copyUnmodified: true | |
15 }); | |
1069
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
990
diff
changeset
|
16 config.plugin("PurgecssPlugin").use(PurgecssPlugin, [ |
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
990
diff
changeset
|
17 { |
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
990
diff
changeset
|
18 paths: glob.sync([ |
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
990
diff
changeset
|
19 path.join(__dirname, "./src/index.html"), |
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
990
diff
changeset
|
20 path.join(__dirname, "./**/*.vue"), |
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
990
diff
changeset
|
21 path.join(__dirname, "./src/**/*.js") |
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
990
diff
changeset
|
22 ]) |
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
990
diff
changeset
|
23 } |
51e42c2e110a
fix: Re-enable PurgeCSS
Thomas Junk <thomas.junk@intevation.de>
parents:
990
diff
changeset
|
24 ]); |
23 | 25 }, |
629
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
568
diff
changeset
|
26 css: { |
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
568
diff
changeset
|
27 loaderOptions: { |
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
568
diff
changeset
|
28 // pass options to sass-loader |
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
568
diff
changeset
|
29 sass: { |
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
568
diff
changeset
|
30 // @/ is an alias to src/ |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
1191
diff
changeset
|
31 data: `@import "@/assets/application.sass";` |
629
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
568
diff
changeset
|
32 } |
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
568
diff
changeset
|
33 } |
8278b2fb0c33
refac: UI refactorization
Thomas Junk <thomas.junk@intevation.de>
parents:
568
diff
changeset
|
34 }, |
3 | 35 devServer: { |
36 proxy: { | |
329
71970f03c9e8
SPA: Fixed setup for proxy in "serve" dev server mode.
Sascha Wilde <wilde@intevation.de>
parents:
23
diff
changeset
|
37 "/api": { |
353
a80e589c5ade
fix: Fix broken environment variable setting
Thomas Junk <thomas.junk@intevation.de>
parents:
329
diff
changeset
|
38 target: process.env.VUE_BACKEND_API_URL, |
3 | 39 secure: false |
11
e0b5dd98665e
current frontend with asset server configured
Thomas Junk <thomas.junk@intevation.de>
parents:
3
diff
changeset
|
40 }, |
23 | 41 "/img/*": { |
11
e0b5dd98665e
current frontend with asset server configured
Thomas Junk <thomas.junk@intevation.de>
parents:
3
diff
changeset
|
42 target: "http://localhost:5000", |
e0b5dd98665e
current frontend with asset server configured
Thomas Junk <thomas.junk@intevation.de>
parents:
3
diff
changeset
|
43 secure: false |
3 | 44 } |
500
f6d61657b487
Allow accessing client from outside localhost via hostname
Tom Gottfried <tom@intevation.de>
parents:
353
diff
changeset
|
45 }, |
f6d61657b487
Allow accessing client from outside localhost via hostname
Tom Gottfried <tom@intevation.de>
parents:
353
diff
changeset
|
46 disableHostCheck: true |
3 | 47 } |
48 }; |