Deployment
As the example of application URL: https://example.com/my/app
.
-
Setup baseURL via homepage
entry in
package.json
.
"name": "default",
"version": "0.1.0",
"private": true,
- "homepage": "https://keenthemes.com/metronic/preview/react"
+ "homepage": "https://example.com/my/app",
"scripts": {
-
Setup correct destinations and source in serve.json
.
"redirects": [{
"source": "/",
- "destination": "/metronic/preview/react",
+ "destination": "/my/app",
}],
"rewrites": [{
- "source": "/metronic/preview/react/**",
+ "source": "/my/app/**",
- "destination": "/metronic/preview/react/index.html"
+ "destination": "/my/app/index.html"
}]
-
Run build.
yarn build
Serve production mode
As the example of application URL: http://localhost:5000
.
-
Setup baseURL via homepage
entry in
package.json
.
"name": "default",
"version": "0.1.0",
"private": true,
- "homepage": "https://keenthemes.com/metronic/preview/react"
+ "homepage": "https://localhost:5000",
"scripts": {
-
Setup correct destinations and source in serve.json
.
"redirects": [{
"source": "/",
- "destination": "/metronic/preview/react",
+ "destination": "",
}],
"rewrites": [{
- "source": "/metronic/preview/react/**",
+ "source": "/**",
- "destination": "/metronic/preview/react/index.html"
+ "destination": "/index.html"
}]
-
Run build.
yarn build
-
For environments using Node, the easiest way to handle this would be to install serve and let it handle the rest:
Run npm install -g serve
and serve -s build -l 5000
- Open
http://localhost:5000 URL in your browser