universal-webpack icon indicating copy to clipboard operation
universal-webpack copied to clipboard

support css-loader v2

Open ambar opened this issue 6 years ago • 7 comments

https://github.com/catamphetamine/universal-webpack/blob/a5f30556af5cc658acb5189c7f10a5643c085a3a/source/server%20configuration.js#L325-L331

https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md#200-2018-12-07 css-loader/locals was dropped in favor exportOnlyLocals option

ambar avatar Dec 13 '18 07:12 ambar

It is very stupid that they renamed /locals to /exportOnlyLocals. They should have left that name the same. You can create an issue in their repo telling them to add back locals.js as a backwards-compatible alias.

There's no way to determine the version of css-loader from webpack configuration. I have added an envirnoment variable called UNIVERSAL_WEBPACK_CSS_LOADER_V2 in [email protected].

catamphetamine avatar Dec 13 '18 12:12 catamphetamine

I'm getting following error Module not found: Error: Can't resolve 'css-loader/exportOnlyLocals'

Iuriy-Budnikov avatar Dec 24 '18 17:12 Iuriy-Budnikov

@Iuriy-Budnikov Is this when using UNIVERSAL_WEBPACK_CSS_LOADER_V2 env variable?

catamphetamine avatar Dec 24 '18 17:12 catamphetamine

@Iuriy-Budnikov Actually, turns out that exportOnlyLocals is not a loader but is an option. I'll fix the code.

catamphetamine avatar Dec 24 '18 17:12 catamphetamine

@Iuriy-Budnikov Is this when using UNIVERSAL_WEBPACK_CSS_LOADER_V2 env variable?

Yeah.

Iuriy-Budnikov avatar Dec 24 '18 17:12 Iuriy-Budnikov

@Iuriy-Budnikov Released [email protected].

catamphetamine avatar Dec 24 '18 17:12 catamphetamine

thanks, that works!

Iuriy-Budnikov avatar Dec 24 '18 17:12 Iuriy-Budnikov