File tree 2 files changed +34
-0
lines changed
2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ module.exports = {
39
39
'' ,
40
40
'configuration' ,
41
41
'directives' ,
42
+ 'webpack' ,
42
43
] ,
43
44
} ,
44
45
} ,
Original file line number Diff line number Diff line change
1
+ # Webpack configuration
2
+
3
+ In ` api.chainWebpack ` and ` api.configureWebpack ` , you have access to some environment variables:
4
+
5
+ - ** ` process.env.VUE_CLI_SSR_TARGET ` ** : Either ` 'client' ` or ` 'server' `
6
+
7
+ - ** ` process.env.VUE_CLI_MODE ` ** : Vue CLI mode
8
+
9
+ Examples:
10
+
11
+ ``` js
12
+ api .chainWebpack (config => {
13
+ if (process .env .VUE_CLI_SSR_TARGET === ' client' ) {
14
+ // Client-only config
15
+ } else {
16
+ // SSR-only config
17
+ }
18
+ })
19
+ ```
20
+
21
+ ``` js
22
+ api .configureWebpack (config => {
23
+ if (process .env .VUE_CLI_SSR_TARGET === ' client' ) {
24
+ return {
25
+ // Client-only config
26
+ }
27
+ } else {
28
+ return {
29
+ // SSR-only config
30
+ }
31
+ }
32
+ })
33
+ ```
You can’t perform that action at this time.
0 commit comments