fix(embark-ui): specify PUBLIC_URL=/ for production builds

Create React App automatically determines the base path for links within
production build artifacts based on the project's `"homepage"` field in
`package.json`.

An [alternative][alt-setting] is to set the `PUBLIC_URL` environment variable
in `.env.production`. Take that approach so embark-ui's `"homepage"` can
continue to point to its home in the monorepo on GitHub.

Generate source maps in the production build of embark-ui. Doing so increases
the size of the package's tarball by a few MB (it was already large because of
the editor component), but the benefits of being able to much more easily debug
a production build (e.g. when interacting with users experiencing problems)
outweigh the size cost.

[alt-setting]: https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/config/paths.js#L36
This commit is contained in:
Michael Bradley, Jr 2019-03-17 18:37:26 -05:00 committed by Iuri Matias
parent db40f03d68
commit f4626f8fec
2 changed files with 1 additions and 2 deletions

View File

@ -1 +1 @@
GENERATE_SOURCEMAP=false
PUBLIC_URL=/

View File

@ -112,7 +112,6 @@ export default class Server {
}
instance.app.use("/", ui);
instance.app.use("/*", ui);
return instance;
}