vuejs / component-compiler-utils

Lower level utilities for compiling Vue single file components
321 stars 75 forks source link

fix: Add trim and scoped postcss plugins at the start of plugin list #36

Closed znck closed 5 years ago

znck commented 5 years ago

fixes #30

JounQin commented 5 years ago

@znck See https://github.com/vuejs/component-compiler-utils/pull/30#issuecomment-432853890

plugins is always [] at beginning and your fix will not work.

znck commented 5 years ago

Now trim and scoped plugins are added at the start of the plugins list, before any user defined plugins. Just to be sure, I'll add a test so it won't break.

JounQin commented 5 years ago

There is no user defined plugins at all when using vue-loader because .scss files are handled by sass-loader and postcss-loader then it will be transformed into pure .css and no postcss plugins will be passed into compileStyle function.

You can check https://github.com/vuejs/vue-loader/blob/master/lib/loaders/pitcher.js#L92-L105 and https://github.com/vuejs/vue-loader/blob/master/lib/loaders/stylePostLoader.js

znck commented 5 years ago

/cc @yyx990803

trainiac commented 5 years ago

@znck is there something holding up a release of this fix?

znck commented 5 years ago

I am waiting for @yyx990803's take on this.