🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

vite-plugin-css-injected-by-js

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-css-injected-by-js

A Vite plugin that takes the CSS and adds it to the page through the JS. For those who want a single JS file.

3.5.2
latest
Version published
Weekly downloads
195K
-13.56%
Maintainers
0
Weekly downloads
 
Created

What is vite-plugin-css-injected-by-js?

vite-plugin-css-injected-by-js is a Vite plugin that allows you to inject CSS directly into the JavaScript bundle. This can be useful for scenarios where you want to avoid separate CSS files and ensure that styles are loaded synchronously with your JavaScript.

What are vite-plugin-css-injected-by-js's main functionalities?

Inject CSS into JavaScript

This feature allows you to configure Vite to inject CSS directly into the JavaScript bundle. By using the `cssInjectedByJsPlugin` in the Vite configuration, the CSS will be included in the JavaScript output, ensuring that styles are applied as soon as the JavaScript is executed.

import { defineConfig } from 'vite';
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js';

export default defineConfig({
  plugins: [cssInjectedByJsPlugin()]
});

Other packages similar to vite-plugin-css-injected-by-js

FAQs

Package last updated on 27 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts