Skip to content

Commit 583b6bb

Browse files
yibuyishengLinusBorg
yibuyisheng
authored andcommitted
fix postcss config (#890)
* Update vue-loader link (#886) * Merge some small fixes (#900) * Remove unused fs require from webpack.base.conf.js (#893) * cleanup some leftover from reverting #688 * fix postcss config * userPostCSS config
1 parent 41cb811 commit 583b6bb

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

template/build/utils.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ exports.cssLoaders = function (options) {
2222
}
2323
}
2424

25+
var postcssLoader = {
26+
loader: 'postcss-loader'
27+
}
28+
2529
// generate loader string to be used with extract text plugin
2630
function generateLoaders (loader, loaderOptions) {
27-
const loaders = [cssLoader]
31+
const loaders = options.usePostCSS !== false ? [cssLoader, postcssLoader] : [cssLoader]
2832
if (loader) {
2933
loaders.push({
3034
loader: loader + '-loader',

template/build/webpack.dev.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const portfinder = require('portfinder')
1010

1111
const devWebpackConfig = merge(baseWebpackConfig, {
1212
module: {
13-
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap })
13+
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
1414
},
1515
// cheap-module-eval-source-map is faster for development
1616
devtool: '#cheap-module-eval-source-map',

template/build/webpack.prod.conf.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ const webpackConfig = merge(baseWebpackConfig, {
1818
module: {
1919
rules: utils.styleLoaders({
2020
sourceMap: config.build.productionSourceMap,
21-
extract: true
21+
extract: true,
22+
usePostCSS: true
2223
})
2324
},
2425
devtool: config.build.productionSourceMap ? '#source-map' : false,

0 commit comments

Comments
 (0)