Repository navigation
Replies: 1 comment
|
FYI we partly solved the issue: in node_modules/react-scripts/scripts/build.js : near the top of the file, change both of these variables to 'development' , viz: // Do this as the first thing so that any code reading it knows the right env. in node_modules/react-scripts/config/webpack.config.js : find where the isEnv* variables are set up, and set the isEnv* variables to the proper boolean values to force development mode: module.exports = function(webpackEnv) { then a yarn build makes a dist folder that seems to run ok in browser without note that the two files build.js and webpack.config.js get overwritten upon yarn install, so you may have |
Uh oh!
There was an error while loading. Please reload this page.
per title, yarn start gives a running app. excellent.
but when we try yarn build to make a package for serving, app starts with "whitescreen,"
and in browser console we see:
ReferenceError: Can't find variable: exports
note: this is used in the context of react-native-web build for a browser
i suspect that there is a difference in the build process for development versus production that is somehow
not using some babel setting that is needed, but with the stackup of react-scripts, webpack, babel, babel plugins, babel settings, etc, where this setting is getting lost on the production build is difficult to trace.
it would be good if we could take a "development look-alike" build and make a server build for this, and then gradually put in production efficiency refinements rather than jumping directly from full devel to full production.
All reactions