Skip to content

Commit f55e8e5

Browse files
committed
working...
1 parent abf45f4 commit f55e8e5

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

Development.md

+29-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,32 @@
66

77
`Mode` is an important concept in Vue CLI projects. By default, there are three modes:
88

9-
-
9+
- `development` is used by `vue-cli-service serve`
10+
- `test` is used by `vue-cli-service test:unit`
11+
- `production` is used by `vue-cli-service build` and `vue-cli-service e2e`
12+
13+
However, you can overwrite the mode default used for a command by using `--mode` option flag.
14+
15+
```
16+
vue-cli-service build --mode development
17+
```
18+
19+
### Environment Variables
20+
21+
You can specify env variable by placing the following file in your project root.
22+
23+
```
24+
.env # loaded in all cases
25+
.env.local # loaded in all cases, ignored by git
26+
.env.[mode] # only loaded in specified mode
27+
.env.[mode].local # only loaded in specified mode, ignored by git
28+
```
29+
30+
An env file simply contains key=value pairs of envaironment variables:
31+
32+
```
33+
FOO=bar
34+
VUE_APP_NOT_SECRET_CODE=some_value
35+
```
36+
37+
Do not store any secrets (such as API private key) in your project.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"scripts": {
66
"serve": "vue-cli-service serve",
77
"build": "vue-cli-service build",
8-
"lint": "vue-cli-service lint"
8+
"lint": "vue-cli-service lint",
9+
"test:unit": "vue-cli-service test:unit"
910
},
1011
"dependencies": {
1112
"core-js": "^3.8.3",

vue.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ const { defineConfig } = require("@vue/cli-service");
22

33
module.exports = defineConfig({
44
transpileDependencies: true,
5-
publicPath: "/test/",
5+
publicPath:
6+
process.env.NODE_ENV === "production" ? "/production" : "/development",
67
});

0 commit comments

Comments
 (0)