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
Webpak - Critical dependency: the request of a dependency is an expression #199
Comments
Yeap, I understood the problem, but don’t know solution right now. I will try to find some ideas on this weekend. |
@TheLarkInn hi. Can I ask you advice here? Browserslist is used in Autoprefixer and many other tools. If somebody wants to have something like CodePen in the browser, it will load Browserslist. We have Do we have something like |
@frandiox as a temporary solution you can use |
@ai Thanks for answering! Looks like
According to the docs, these props are deprecated and |
@frandiox Thanks for posting that! I looked into using the
Considering that, I think your config example is the correct solution, though I made it Separately, while exploring using plugins: [
// No need for any caniuse regions data (for require context in browserslist)
new webpack.ContextReplacementPlugin(
/caniuse-lite[\/\\]data[\/\\]regions/,
/^$/,
),
], |
@acusti we even have it in docs https://github.com/ai/browserslist#webpack Did we found solution? What I need to add to docs? |
@ai why not just require the caniuse-lite if the context is a browser? that way we don't need to edit our config, in my case, I'm using create-react-app so I can't edit the webpack config, and in previous versions of create-react-app, it just worked out of the box, but I guess since upgrading webpack it has broke. My suggestion here is to check if |
@lifeiscontent hm, good idea. But better way is to use |
@ai sounds good! 👍 |
Done 03c72ca |
Released in 2.11.2 |
Hi! I want to bundle
postcss-cssnext
package with Webpack for a web app andbrowserslist
is also included. I'm following the information mentioned in README.md to remove locales (new webpack.IgnorePlugin(/caniuse-lite\/data\/regions/)
) but have a doubt on something else.There's a scary warning when bundling with Webpack:
Critical dependency: the request of a dependency is an expression
on this line. According to Webpack docs, full dynamic requires fail by default.They mention that ContextReplacementPlugin can be used in this situation but I don't really know what is the actual context and where to redirect it. Any idea on how to fix this?
Thanks!
The text was updated successfully, but these errors were encountered: