@caiguanhao/vite-plugin-css-injected-by-js
v1.0.1
Published
A Vite plugin that takes the CSS and adds it to the page through the JS. For those who want a single JS file.
Downloads
10
Maintainers
Readme
Vite Plugin: CssInjectedByJs
A Vite plugin that takes the CSS and adds it to the page through the JS. For those who want a single JS file.
How does it work
Essentially what it does is take all the CSS generated by the build process and add it through javascript. The CSS file is therefore not generated and the declaration in the generated HTML file is also removed.
Installation
yarn add -D @caiguanhao/vite-plugin-css-injected-by-js
Usage
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js'
export default {
plugins: [
cssInJsPlugin(),
]
}