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

[2.5.0-next.2] ContextReplacementPlugin apparently ignored #78

Open
jlowcs opened this issue Jul 25, 2020 · 2 comments
Open

[2.5.0-next.2] ContextReplacementPlugin apparently ignored #78

jlowcs opened this issue Jul 25, 2020 · 2 comments

Comments

@jlowcs
Copy link

jlowcs commented Jul 25, 2020

Hello!

I'm trying to use the plugin on our app, and everything seems to be working, except for our exclusion of dynamic imported locale files.

For that, we were using ContextReplacementPlugin to only include specific local files from intl-related dependencies. But that plugin does not seem to be compatible with BabelMultiTargetPlugin, as all locale files are now outputted as chunks.

If that's not supposed to happen, do you have any insight at what I might be missing here?

new webpack.ContextReplacementPlugin(/intl\/locale-data\/jsonp$/, /(fr-FR|en-US).js$/),
await import(/* webpackChunkName: "intl/[request]" */ `intl/locale-data/jsonp/${intlLocale}.js`);
@jlowcs jlowcs changed the title ContextReplacementPlugin apparently ignored [2.5.0-next.2] ContextReplacementPlugin apparently ignored Jul 25, 2020
@jlowcs
Copy link
Author

jlowcs commented Jul 25, 2020

Here is a branch where you can reproduce the issues: https://github.com/jlowcs/webpack-babel-multi-target-plugin/tree/bug-ContextReplacementPlugin

When using BabelMultiTargetPlugin, 2 plugin chunks (well, 4 if you count the modern files) are generated by the es6-dynamic-import example.

When using babel-loader, 1 plugin chunk is generated.

@DanielSchaffer
Copy link
Owner

@jlowcs thanks for the report, I'll take a look.

@DanielSchaffer DanielSchaffer removed this from the 2.6.0 milestone Jul 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants