-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure webpack production build to avoid using devtools that rely on eval #3103
Conversation
alias: { | ||
'react-native': 'react-native-web', | ||
'react-dom': '@hot-loader/react-dom', | ||
module.exports = env => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a lot of noise around here because the indentation changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand all of the changes to webpack.config.js
-- is this a generated file?
[ | ||
'@babel/preset-react', | ||
{ | ||
development: env === 'development', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't set development
to true in production builds.
}, | ||
plugins: [ | ||
'@babel/plugin-syntax-dynamic-import', | ||
...(env === 'development' ? ['react-hot-loader/babel'] : []), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use react-hot-loader/babel
in production builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here.
Oh - nevermind. Hiding whitespace gets rid of most of it. |
Yes. The reason for this is that we are now reading the env and configuring the build based on that. Because the export is now a function instead of a plain object the indentation changed and it looks like more changes than it is. |
Looks like Neutrino was doing this for us.
This should take care of the eval calls in the transpiled production code.