Css-loader: disabling css modules on a per-stylesheet basis

Created on 9 Jan 2016  路  3Comments  路  Source: webpack-contrib/css-loader

assuming you have css modules enabled in your config, how do you disable css modules for specific css files? specifically, i want to disable it for dependencies, otherwise none of its styling will work.

anyone solve this?

Most helpful comment

Would be nice to specify somehow through the import statement. Maybe Im missing something

All 3 comments

You can configure different loaders for different files, even though they're the same file type. Use CSS Modules for your locally scoped files, use global CSS for all your legacy files. A simple way you can achieve this is by naming all of your CSS Modules files like this: MyComponent.local.css, and then matching that pattern in your webpack config.

@markdalgleish FYI - This seems to result in duplicated CSS.

Would be nice to specify somehow through the import statement. Maybe Im missing something

Was this page helpful?
0 / 5 - 0 ratings

Related issues

heldrida picture heldrida  路  4Comments

kcjonson picture kcjonson  路  3Comments

danielgomonea picture danielgomonea  路  3Comments

fengyun2 picture fengyun2  路  4Comments

aZolo77 picture aZolo77  路  3Comments