insin / nwb

A toolkit for React, Preact, Inferno & vanilla JS apps, React libraries and other npm modules for the web, with no configuration (until you need it)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automatic CSS Modules

insin opened this issue · comments

css-loader now has config for automatically enabling CSS modules for .module.{ext} files:

 createLoader(name('css'), {
   loader: require.resolve('css-loader'),
   options: {
     // Apply postcss-loader to @imports
     importLoaders: 1,
   },
+  // Automatically enable css modules for .module.{ext} files
+  modules: {auto: true},
 }),

Should we turn this on?

Sure, please add it by default.