Skip to content

Commit 0d52d86

Browse files
authored
fix: Move trim and scoped postcss plugins at the start of plugin list (vuejs#36)
This prevents `trim` from rewriting output from other plugins like magnification plugin.
1 parent c494c69 commit 0d52d86

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/compileStyle.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ export function doCompileStyle(
6262
const source = preProcessedSource ? preProcessedSource.code : options.source
6363

6464
const plugins = (postcssPlugins || []).slice()
65-
if (trim) {
66-
plugins.push(trimPlugin())
67-
}
6865
if (scoped) {
69-
plugins.push(scopedPlugin(id))
66+
plugins.unshift(scopedPlugin(id))
67+
}
68+
if (trim) {
69+
plugins.unshift(trimPlugin())
7070
}
7171

7272
const postCSSOptions: ProcessOptions = {

0 commit comments

Comments
 (0)