Created by: ghost
Sometimes, we need to deploy our code on lousy service provider. The service provider supports flat directory only, rather than hierarchical directory.
In above case, building code with create-react-app predefined hierarchical directory make us agonizing.
Service prodivder supports:
├── asset-manifest.json
├── favicon.ico
├── index.html
├── manifest.json
├── service-worker.js
├── main.f58a13b4.css
├── main.f58a13b4.css.map
├── main.1a92a0e5.js
└── main.1a92a0e5.js.map
But creact-react-app outputs:
├── asset-manifest.json
├── favicon.ico
├── index.html
├── manifest.json
├── service-worker.js
└── static
├── css
│ ├── main.f58a13b4.css
│ └── main.f58a13b4.css.map
├── js
├── main.1a92a0e5.js
└── main.1a92a0e5.js.map
So I opened a PR to make setting base directories of assets possible.
This PR does simple things:
- export 3 configurable environment variables:
CSS_DIR
/JS_DIR
/MEDIA_DIR
- configure output path with above 3 environment variables.
If I should do some other things to make it merged, please comment.