unplugin-vue icon indicating copy to clipboard operation
unplugin-vue copied to clipboard

feat: expose more `SFCStyleCompileOptions` in style option

Open yuzheng14 opened this issue 2 years ago • 2 comments

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.

yuzheng14 avatar Oct 12 '23 08:10 yuzheng14

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

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

sxzz avatar Nov 16 '23 21:11 sxzz