diff --git a/conf/webpack/Base.js b/conf/webpack/Base.js index e5c515e..7002a83 100644 --- a/conf/webpack/Base.js +++ b/conf/webpack/Base.js @@ -99,22 +99,30 @@ class WebpackBaseConfig { presets: ['es2015'] } }, + { + test: /\.(png|jpg|gif|mp4|ogg|svg|woff|woff2)$/, + loader: 'file-loader' + }, { test: /^.((?!cssmodule).)*\.css$/, loaders: [ { loader: 'style-loader' }, - { loader: 'css-loader' } + { + loader: 'css-loader', + query: { importLoaders: 1 } + }, + { loader: 'postcss-loader' } ] }, - { - test: /\.(png|jpg|gif|mp4|ogg|svg|woff|woff2)$/, - loader: 'file-loader' - }, { test: /^.((?!cssmodule).)*\.(sass|scss)$/, loaders: [ { loader: 'style-loader' }, - { loader: 'css-loader' }, + { + loader: 'css-loader', + query: { importLoaders: 1 } + }, + { loader: 'postcss-loader' }, { loader: 'sass-loader' } ] }, @@ -122,7 +130,11 @@ class WebpackBaseConfig { test: /^.((?!cssmodule).)*\.less$/, loaders: [ { loader: 'style-loader' }, - { loader: 'css-loader' }, + { + loader: 'css-loader', + query: { importLoaders: 1 } + }, + { loader: 'postcss-loader' }, { loader: 'less-loader' } ] }, @@ -130,25 +142,14 @@ class WebpackBaseConfig { test: /^.((?!cssmodule).)*\.styl$/, loaders: [ { loader: 'style-loader' }, - { loader: 'css-loader' }, + { + loader: 'css-loader', + query: { importLoaders: 1 } + }, + { loader: 'postcss-loader' }, { loader: 'stylus-loader' } ] }, - { - test: /\.json$/, - loader: 'json-loader' - }, - { - test: /\.(js|jsx)$/, - include: [].concat( - this.includedPackages, - [this.srcPathAbsolute] - ), - loaders: [ - // Note: Moved this to .babelrc - { loader: 'babel-loader' } - ] - }, { test: /\.cssmodule\.(sass|scss)$/, loaders: [ @@ -157,6 +158,7 @@ class WebpackBaseConfig { loader: 'css-loader', query: cssModulesQuery }, + { loader: 'postcss-loader' }, { loader: 'sass-loader' } ] }, @@ -167,7 +169,8 @@ class WebpackBaseConfig { { loader: 'css-loader', query: cssModulesQuery - } + }, + { loader: 'postcss-loader' } ] }, { @@ -178,6 +181,7 @@ class WebpackBaseConfig { loader: 'css-loader', query: cssModulesQuery }, + { loader: 'postcss-loader' }, { loader: 'less-loader' } ] }, @@ -189,8 +193,24 @@ class WebpackBaseConfig { loader: 'css-loader', query: cssModulesQuery }, + { loader: 'postcss-loader' }, { loader: 'stylus-loader' } ] + }, + { + test: /\.json$/, + loader: 'json-loader' + }, + { + test: /\.(js|jsx)$/, + include: [].concat( + this.includedPackages, + [this.srcPathAbsolute] + ), + loaders: [ + // Note: Moved this to .babelrc + { loader: 'babel-loader' } + ] } ] }, diff --git a/conf/webpack/Test.js b/conf/webpack/Test.js index 93a6b3f..afdae54 100644 --- a/conf/webpack/Test.js +++ b/conf/webpack/Test.js @@ -37,7 +37,8 @@ class WebpackTestConfig extends WebpackBaseConfig { { loader: 'css-loader', query: cssModulesQuery - } + }, + { loader: 'postcss-loader' } ] }, { @@ -48,6 +49,7 @@ class WebpackTestConfig extends WebpackBaseConfig { loader: 'css-loader', query: cssModulesQuery }, + { loader: 'postcss-loader' }, { loader: 'less-loader' } ] }, @@ -59,6 +61,7 @@ class WebpackTestConfig extends WebpackBaseConfig { loader: 'css-loader', query: cssModulesQuery }, + { loader: 'postcss-loader' }, { loader: 'stylus-loader' } ] }, @@ -70,6 +73,7 @@ class WebpackTestConfig extends WebpackBaseConfig { loader: 'css-loader', query: cssModulesQuery }, + { loader: 'postcss-loader' }, { loader: 'sass-loader' } ] }, diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..fe23259 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,3 @@ +module.exports = () => ({ + plugins: [] +});