Skip to content
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

Merged
merged 3 commits into from
Mar 20, 2024

Conversation

gabrielBusta
Copy link
Member

@gabrielBusta gabrielBusta commented Mar 20, 2024

Looks like Neutrino was doing this for us.
This should take care of the eval calls in the transpiled production code.

alias: {
'react-native': 'react-native-web',
'react-dom': '@hot-loader/react-dom',
module.exports = env => {
Copy link
Member Author

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.

Copy link
Contributor

@bhearsum bhearsum left a 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',
Copy link
Member Author

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'] : []),
Copy link
Member Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing here.

@bhearsum
Copy link
Contributor

I don't really understand all of the changes to webpack.config.js -- is this a generated file?

Oh - nevermind. Hiding whitespace gets rid of most of it.

@gabrielBusta
Copy link
Member Author

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.

@gabrielBusta gabrielBusta merged commit bec478e into main Mar 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants