Skip to content

Commit

Permalink
fix: adjust postcss-loader order when using inline minification
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Sep 11, 2018
1 parent 2f19904 commit a2d1095
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/@vue/cli-service/lib/config/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,22 +130,23 @@ module.exports = (api, options) => {
.loader('css-loader')
.options(cssLoaderOptions)

if (hasPostCSSConfig) {
rule
.use('postcss-loader')
.loader('postcss-loader')
.options(Object.assign({ sourceMap }, loaderOptions.postcss))
}

if (needInlineMinification) {
rule
.use('cssnano')
.loader('postcss-loader')
.options({
sourceMap,
plugins: [require('cssnano')(cssnanoOptions)]
})
}

if (hasPostCSSConfig) {
rule
.use('postcss-loader')
.loader('postcss-loader')
.options(Object.assign({ sourceMap }, loaderOptions.postcss))
}

if (loader) {
rule
.use(loader)
Expand Down

0 comments on commit a2d1095

Please sign in to comment.