Closed johnnynia closed 5 years ago
I recon this is terser - a new uglification plugin. Let me play with latest webpack version.
Pretty sure v5.4.0 would solve your issue. Now imported uses only one variable, and any code changes would not break it.
Thank you so much for the update, unfortunately the RegEx-matching still fails. Now the function string looks like this:
'function(){return e="imported_-1g25iq8_component",t=Promise.resolve().then(function(){return n(481)}),"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(e,t),t;var e,t}'
But the new RegEx in importMatch()
still expects an opening parenthesis as first character:
/\(['"]imported_(.*)_component['"]/
Also there is nothing like __webpack_require__
in the string. 😕
Missed the open parenthesis, will fix it in a few minutes.
Unfortunately, I could not generate the code you have - for me it's always more or less the same (but yeah, there is no __webpack_require__
- just a n(481)
)
I guess I've tracked it down to @babel/env
. The issue only arrises if I include IE: 11
in targets
. Maybe some transpiling or polyfilling is overriding or forestalling react-imported-component/babel
. Could this be the culprit?
I've also tried to add
exclude: [
'es7.symbol.async-iterator',
'proposal-async-generator-functions',
'transform-async-to-generator'
],
to @babel/env
options but unfortunately to no avail.
Sorry - I forgot to release a fixed version. Try 5.4.1
Thank you very much! 👍
Hi and thanks so much for this plugin.
Sorry to bother but I can't get it to work in production. I seem to miss something obvious and the problem may very much be rooted in my config.
I'm doing something like this:
In development SSR and client side seem to work perfectly. But when I deploy the app I get an error that I could trace back to the RegEx matching in importMatch.
In your test case the RegEx
matches correctly
But when I inspect my code, what's getting matched against the RegEx is
It seems to me that Webpack is not picking up the import? The relevant bit of the config looks like this:
Do you have any clue what I might be missing? Any hint would be appreciated. :-)