From 8c9f46ba220d3a92917b64167d0b7a930878c473 Mon Sep 17 00:00:00 2001 From: sthzg Date: Fri, 24 Jun 2016 18:01:40 +0200 Subject: [PATCH] Updated CSS loaders to support CSSModules #32 --- conf/webpack/Base.js | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/conf/webpack/Base.js b/conf/webpack/Base.js index daa4983..5298073 100644 --- a/conf/webpack/Base.js +++ b/conf/webpack/Base.js @@ -103,7 +103,15 @@ class WebpackBaseConfig { ] }, { - test: /\.(sass|scss)$/, + test: /\.cssmodule\.(sass|scss)$/, + loaders: [ + 'style', + 'css?modules&importLoaders=1&localIdentName=[name]-[local]-[hash:base64:5]', + 'sass' + ] + }, + { + test: /^.((?!cssmodule).)*\.(sass|scss)$/, loaders: [ 'style', 'css', @@ -111,7 +119,15 @@ class WebpackBaseConfig { ] }, { - test: /\.less$/, + test: /\.cssmodule\.less$/, + loaders: [ + 'style', + 'css?modules&importLoaders=1&localIdentName=[name]-[local]-[hash:base64:5]', + 'less' + ] + }, + { + test: /^.((?!cssmodule).)*\.less$/, loaders: [ 'style', 'css', @@ -119,7 +135,15 @@ class WebpackBaseConfig { ] }, { - test: /\.styl$/, + test: /\.cssmodule\.styl$/, + loaders: [ + 'style', + 'css?modules&importLoaders=1&localIdentName=[name]-[local]-[hash:base64:5]', + 'stylus' + ] + }, + { + test: /^.((?!cssmodule).)*\.styl$/, loaders: [ 'style', 'css',