Skip to content

Commit

Permalink
fix: Move trim and scoped postcss plugins at the start of plugin list (
Browse files Browse the repository at this point in the history
…#36)

This prevents `trim` from rewriting output from other plugins like magnification plugin.
  • Loading branch information
znck authored Oct 28, 2018
1 parent c494c69 commit 0d52d86
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/compileStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ export function doCompileStyle(
const source = preProcessedSource ? preProcessedSource.code : options.source

const plugins = (postcssPlugins || []).slice()
if (trim) {
plugins.push(trimPlugin())
}
if (scoped) {
plugins.push(scopedPlugin(id))
plugins.unshift(scopedPlugin(id))
}
if (trim) {
plugins.unshift(trimPlugin())
}

const postCSSOptions: ProcessOptions = {
Expand Down

0 comments on commit 0d52d86

Please sign in to comment.