mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-23 15:08:05 +00:00
Add public url to prod webpack config (#615)
* add public url to prod webpack config * modify travis/webpack config to add public url * add slash
This commit is contained in:
parent
94539ec53e
commit
72268f7232
@ -36,7 +36,12 @@ after_success:
|
||||
else
|
||||
export NODE_ENV=development;
|
||||
fi
|
||||
- if [[ -n "$TRAVIS_TAG" ]]; then export REACT_APP_ENV='production'; fi
|
||||
- |
|
||||
|
||||
if [[ -n "$TRAVIS_TAG" ]]; then
|
||||
export PRODUCTION_DEPLOYMENT=true;
|
||||
export REACT_APP_ENV='production';
|
||||
fi
|
||||
- yarn build
|
||||
# Pull Request - Deploy it to a review environment
|
||||
# Travis doesn't do deploy step with pull requests builds
|
||||
|
@ -54,7 +54,7 @@ function ensureSlash(path, needsSlash) {
|
||||
// like /todos/42/static/js/bundle.7289d.js. We have to know the root.
|
||||
const homepagePath = require(paths.appPackageJson).homepage
|
||||
// var homepagePathname = homepagePath ? url.parse(homepagePath).pathname : '/';
|
||||
const homepagePathname = "/"
|
||||
const homepagePathname = process.env.PRODUCTION_DEPLOYMENT ? "/app/" : "/"
|
||||
// Webpack uses `publicPath` to determine where the app is being served from.
|
||||
// It requires a trailing slash, or the file assets will get an incorrect path.
|
||||
const publicPath = ensureSlash(homepagePathname, true)
|
||||
|
Loading…
x
Reference in New Issue
Block a user