underfin / vite-plugin-vue2

Vue2 plugin for Vite
620 stars 83 forks source link

Inject CSS in JavaScript #177

Open Djaler opened 2 years ago

Djaler commented 2 years ago

It would be cool to have an option like css in old good rollup-plugin-vue: https://github.com/vuejs/rollup-plugin-vue/blob/v5.1.9/src/index.ts#L119

dcherman commented 2 years ago

Would a pull request for this be accepted? Alternatively, could we consider exposing some additional metadata on the .vue that includes what scripts/stylesheets/templates were extracted from the SFC? If we had access to that, writing a plugin to inline the CSS in the JS is relatively trivial.

It's doable right now, but you have to copy/paste those implementation details that I mentioned above which are not exposed from this plugin at the moment.