Commit 4e25a17b authored by Pan's avatar Pan

fix:fix postcss config

parent 61095a9f
...@@ -20,9 +20,13 @@ exports.cssLoaders = function (options) { ...@@ -20,9 +20,13 @@ exports.cssLoaders = function (options) {
} }
} }
var postcssLoader = {
loader: 'postcss-loader'
}
// generate loader string to be used with extract text plugin // generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) { function generateLoaders (loader, loaderOptions) {
var loaders = [cssLoader] var loaders = options.usePostCSS !== false ? [cssLoader, postcssLoader] : [cssLoader]
if (loader) { if (loader) {
loaders.push({ loaders.push({
loader: loader + '-loader', loader: loader + '-loader',
......
...@@ -19,9 +19,7 @@ function resolveApp(relativePath) { ...@@ -19,9 +19,7 @@ function resolveApp(relativePath) {
module.exports = merge(baseWebpackConfig, { module.exports = merge(baseWebpackConfig, {
module: { module: {
rules: utils.styleLoaders({ rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
sourceMap: config.dev.cssSourceMap
})
}, },
// cheap-source-map is faster for development // cheap-source-map is faster for development
devtool: '#cheap-source-map', devtool: '#cheap-source-map',
......
...@@ -20,7 +20,8 @@ var webpackConfig = merge(baseWebpackConfig, { ...@@ -20,7 +20,8 @@ var webpackConfig = merge(baseWebpackConfig, {
module: { module: {
rules: utils.styleLoaders({ rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap, sourceMap: config.build.productionSourceMap,
extract: true extract: true,
usePostCSS: true
}) })
}, },
devtool: config.build.productionSourceMap ? '#source-map' : false, devtool: config.build.productionSourceMap ? '#source-map' : false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment