vuejs / core

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
https://vuejs.org/
MIT License
45.89k stars 8.04k forks source link

Compiler optimization with css module #2417

Open yoyo930021 opened 3 years ago

yoyo930021 commented 3 years ago

What problem does this feature solve?

Ref: https://twitter.com/Linus_Borg/status/1310844386536718339?s=20

Vue 3 compiler currently cannot treat CSS module classes as static. We might have some way of dealing with it. e.g. mark it as static or pre-compile the css module class as a static string.

POC: https://github.com/yoyo930021/vue-pre-css-module/blob/main/src/index.ts#L67 In this POC, I try to use NodeTransform for pre-compile the css module class as a static string. But it lacks information on several key operations. Mainly related to the path and settings.

I think there are two ways to achieve this. One for more information on NodeTransform. One is built into vue-loader or @vue/compiler-dom.

What does the proposed API look like?

No

norangit commented 1 year ago

so far, any update? Is that doing?