update readme

This commit is contained in:
张磊 2019-01-08 11:54:56 +08:00
parent 208248f2ee
commit dc670f8930
1 changed files with 22 additions and 2 deletions

View File

@ -300,7 +300,27 @@ Directory description:
│ └─ index.js //Entry js of compilerwill build to index.html
```
About compiled website URL
### scripts
```json
"scripts": {
"start": "node scripts/start.js",
"build": "PUBLIC_URL=. node scripts/build.js",
"build-windows": "set PUBLIC_URL=.&& node scripts/build.js",
"fix": "eslint src --fix"
}
```
You can set up the PUBLIC_URL, such as
```json
...
"build": "PUBLIC_URL=https://fe.wxpay.oa.com/dv node scripts/build.js",
"build-windows": "set PUBLIC_URL=https://fe.wxpay.oa.com/dv&& node scripts/build.js",
...
```
<!-- About compiled website URL
* [build env doc](https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables#referencing-environment-variables-in-the-html)
* [build problem](https://stackoverflow.com/questions/42686149/create-react-app-build-with-public-url)
@ -331,7 +351,7 @@ If you only want to use relative addresses:
```
"build":"set PUBLIC_URL=.&& npm run _build" //windows
"build":"PUBLIC_URL=. npm run _build", //mac os
```
``` -->
### Project Template