unplugin / unplugin-vue

✨ Transform Vue 3 SFC to JavaScript. Supports Vite, esbuild, Rollup, Webpack and more.
MIT License
175 stars 7 forks source link

feat: expose more `SFCStyleCompileOptions` in style option #137

Open yuzheng14 opened 1 year ago

yuzheng14 commented 1 year ago

Description

Expose more SFCStyleCompileOptions in style option. Because sometimes we need pass some parameters like preprocessLang into compileStyleAsync in @vue/compiler-sfc.

Additional context

See this code in vue official playground. It produce a css output:

.parent[data-v-7ba5bd90] {
  background-color: black;
&_child[data-v-7ba5bd90] {
    background-color: white;
}
}

But sass can't process this output, so we need pass preprocessLang into compileStyleAsync to call it internal preprocessor. But there isn't option preprocessLang in Options.style. So it need to be expanded.

stackblitz[bot] commented 1 year ago

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

sxzz commented 1 year ago

LGTM, but we'd better contribute the PR to upstream https://github.com/vitejs/vite-plugin-vue first.