Vite plugin to load theme style
npm i vite-plugin-theme-style -D
# yarn
yarn add vite-plugin-theme-style -D
# pnpm
pnpm add vite-plugin-theme-style -D
// vite.config.js / vite.config.ts
import ViteTheme from 'vite-plugin-theme-style'
export default {
plugins: [
ViteTheme()
]
}
input
<style lang="scss" theme="theme-custom" scoped>
.home-text {
background: green;
}
</style>
output
.theme-custom .home-text[data-v-a763a6ae]{
background: green;
}