Fixes #3329 - Tweak webpack config to share CSS loaders for production builders. Updated production builds to use ExtractTextPlugin so styles are not built into JS.
This commit is contained in:
45
webpack.dist-style.config.js
Normal file
45
webpack.dist-style.config.js
Normal file
@@ -0,0 +1,45 @@
|
||||
const ExtractTextPlugin = require("extract-text-webpack-plugin")
|
||||
|
||||
module.exports = [{
|
||||
test: /\.(css)(\?.*)?$/,
|
||||
use: ExtractTextPlugin.extract({
|
||||
fallback: "style-loader",
|
||||
use: [
|
||||
"css-loader",
|
||||
"postcss-loader"
|
||||
]
|
||||
})
|
||||
},
|
||||
{ test: /\.(scss)(\?.*)?$/,
|
||||
use: ExtractTextPlugin.extract({
|
||||
fallback: "style-loader",
|
||||
use: [
|
||||
{
|
||||
loader: "css-loader",
|
||||
options: { minimize: true }
|
||||
},
|
||||
{
|
||||
loader: "postcss-loader",
|
||||
options: { sourceMap: true }
|
||||
},
|
||||
{ loader: "sass-loader",
|
||||
options: {
|
||||
outputStyle: "expanded",
|
||||
sourceMap: true,
|
||||
sourceMapContents: "true"
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
{ test: /\.(less)(\?.*)?$/,
|
||||
use: ExtractTextPlugin.extract({
|
||||
fallback: "style-loader",
|
||||
use: ["css-loader",
|
||||
{
|
||||
loader: "postcss-loader",
|
||||
},
|
||||
"less-loader"
|
||||
]
|
||||
})
|
||||
}]
|
||||
Reference in New Issue
Block a user