Skip to content

Commit

Permalink
fix postcss config (#890)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
yibuyisheng authored and LinusBorg committed Nov 8, 2017
1 parent 41cb811 commit 583b6bb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion template/build/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ exports.cssLoaders = function (options) {
}
}

var postcssLoader = {
loader: 'postcss-loader'
}

// generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) {
const loaders = [cssLoader]
const loaders = options.usePostCSS !== false ? [cssLoader, postcssLoader] : [cssLoader]
if (loader) {
loaders.push({
loader: loader + '-loader',
Expand Down
2 changes: 1 addition & 1 deletion template/build/webpack.dev.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const portfinder = require('portfinder')

const devWebpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap })
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
},
// cheap-module-eval-source-map is faster for development
devtool: '#cheap-module-eval-source-map',
Expand Down
3 changes: 2 additions & 1 deletion template/build/webpack.prod.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const webpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true
extract: true,
usePostCSS: true
})
},
devtool: config.build.productionSourceMap ? '#source-map' : false,
Expand Down

0 comments on commit 583b6bb

Please sign in to comment.