@caiguanhao/vite-plugin-css-injected-by-js

1.0.1 • Public • Published

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(),
  ]
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    1

Package Sidebar

Install

npm i @caiguanhao/vite-plugin-css-injected-by-js

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

4.05 kB

Total Files

4

Last publish

Collaborators

  • caiguanhao