fix:fix postcss config
This commit is contained in:
parent
61095a9f2c
commit
4e25a17bff
3 changed files with 8 additions and 5 deletions
|
@ -20,9 +20,13 @@ exports.cssLoaders = function (options) {
|
|||
}
|
||||
}
|
||||
|
||||
var postcssLoader = {
|
||||
loader: 'postcss-loader'
|
||||
}
|
||||
|
||||
// generate loader string to be used with extract text plugin
|
||||
function generateLoaders (loader, loaderOptions) {
|
||||
var loaders = [cssLoader]
|
||||
var loaders = options.usePostCSS !== false ? [cssLoader, postcssLoader] : [cssLoader]
|
||||
if (loader) {
|
||||
loaders.push({
|
||||
loader: loader + '-loader',
|
||||
|
|
|
@ -19,9 +19,7 @@ function resolveApp(relativePath) {
|
|||
|
||||
module.exports = merge(baseWebpackConfig, {
|
||||
module: {
|
||||
rules: utils.styleLoaders({
|
||||
sourceMap: config.dev.cssSourceMap
|
||||
})
|
||||
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
|
||||
},
|
||||
// cheap-source-map is faster for development
|
||||
devtool: '#cheap-source-map',
|
||||
|
|
|
@ -20,7 +20,8 @@ var webpackConfig = merge(baseWebpackConfig, {
|
|||
module: {
|
||||
rules: utils.styleLoaders({
|
||||
sourceMap: config.build.productionSourceMap,
|
||||
extract: true
|
||||
extract: true,
|
||||
usePostCSS: true
|
||||
})
|
||||
},
|
||||
devtool: config.build.productionSourceMap ? '#source-map' : false,
|
||||
|
|
Loading…
Reference in a new issue