Open ai opened 3 years ago
I have esm support in the v1 branch, we should probably back port if it's not too much trouble
It will be great and improve onboarding
Another solution is to just turn off the esModule with style-loader option like this:
{ loader: 'style-loader', options: { esModule: false, } },
btw. MiniCssExtractPlugin has also that option in case you hit the same issue with production build..
style-loader
2.0 now returns ES module and breaks Astroturf’srequire()
Right now code like:
will be compiled by
astroturf/loader
to:But webpack 4 will return ESM module on
.astroturf.pcss
import:As the result,
styled
doesn’t work because it expects to get{ cls1, cls2 }
fromrequire
but gets{ __esModule: true, … }
Details
Possible solutions
import
{ __esModule: true, … }
unwrapper