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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(react-i18n): disable sideEffect to allow webpack tree-shaking #133

Merged
merged 1 commit into from Nov 27, 2023

Conversation

jpoissonnet
Copy link
Contributor

@jpoissonnet jpoissonnet commented Sep 20, 2023

馃 Why?

When requiring the lib, webpack can't do its tree-shaking properly because of the commonjs require.

The problem I face is that, I need to import the translateFunction but I can't require it because when Webpack require the whole lib Next.JS throws an error because of the createContext used elsewhere in the lib. If we enable the treeshaking, only the function that I need will be imported and Next.JS won't throw an error.

馃捇 How?

  • Added the property sideEffects: false in the package.json of react-i18n as specified in the webpack doc

@yfrommelt yfrommelt merged commit 2e57c1b into BedrockStreaming:master Nov 27, 2023
4 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

4 participants