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

[Bug] addLessLoader throw error with newest css-loader #242

Open
xyy94813 opened this issue May 5, 2020 · 0 comments
Open

[Bug] addLessLoader throw error with newest css-loader #242

xyy94813 opened this issue May 5, 2020 · 0 comments

Comments

@xyy94813
Copy link

xyy94813 commented May 5, 2020

Newest css-loader validate the options of css-loader.
And support new usage with css modules.

react-scripts has depended on css-loader@3.4.2

Use the addLessLoader newest react-scripts will throw error:

ValidationError: Invalid options object. CSS Loader has been initialized using an options object that does not match the API schema.
 - options has an unknown property 'localIdentName'. These properties are valid:
   object { url?, import?, modules?, sourceMap?, importLoaders?, localsConvention?, onlyLocals?, esModule? }

So, we need rewrite these line to support newest css-loader options.

const localIdentName =
loaderOptions.localIdentName || "[path][name]__[local]--[hash:base64:5]";

modules: true,
localIdentName: localIdentName

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant