Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Commit

Permalink
fix(#84): Move postcss-modules plugins to last
Browse files Browse the repository at this point in the history
  • Loading branch information
znck committed Apr 11, 2019
1 parent c4bcd40 commit 8cd2076
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions src/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,22 +229,24 @@ export class SFCCompiler {
style.module === true || typeof style.module === 'string'
const needsCleanCSS =
this.template.isProduction && !(this.style.postcssCleanOptions && this.style.postcssCleanOptions.disabled)
const postcssPlugins = [
needsCSSModules
? postcssModules({
generateScopedName: '[path][local]-[hash:base64:4]',
...this.style.postcssModulesOptions,
getJSON: (t: any) => {
tokens = t
}
})
: undefined,
needsCleanCSS
? postcssClean(this.style.postcssCleanOptions)
: undefined
]
.concat(this.style.postcssPlugins)
const postcssPlugins = (this.style.postcssPlugins || [])
.slice()
.concat([
needsCleanCSS
? postcssClean(this.style.postcssCleanOptions)
: undefined,
needsCSSModules
? postcssModules({
generateScopedName: '[path][local]-[hash:base64:4]',
...this.style.postcssModulesOptions,
getJSON: (t: any) => {
tokens = t
}
})
: undefined,
])
.filter(Boolean)

const preprocessOptions =
(style.lang &&
this.style.preprocessOptions &&
Expand Down

0 comments on commit 8cd2076

Please sign in to comment.