vite-plugin-style-inject
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

vite-plugin-style-inject

NPM version

English中文

The plugin is used to inject CSS into JS files, so there will not generate CSS files. It is mainly used to pack some libraries with fewer styles, for example, A component that has been encapsulated.

The user using the library will not need to import extrally a CSS file.

  • Before
import xxxComponent from 'xxx-component';
import 'xxx-component/dist/xxx.css';
  • Now
import xxxComponent from 'xxx-component';

Install

  • npm
npm i vite-plugin-style-inject --save-dev
  • yarn
yarn add -D vite-plugin-style-inject
``

- pnpm

```bash
pnpm add -D vite-plugin-style-inject

Usage

// vite.config.ts
import { defineConfig } from 'vite';

import VitePluginStyleInject from 'vite-plugin-style-inject';

export default defineConfig({
  plugins: [VitePluginStyleInject()],
  ......
});

License

MIT License © 2022 Name6

Readme

Keywords

none

Package Sidebar

Install

npm i vite-plugin-style-inject

Weekly Downloads

761

Version

0.0.1

License

MIT

Unpacked Size

7.56 kB

Total Files

7

Last publish

Collaborators

  • name6