1. vite-plugin-style-inject
[![NPM version](https://img.shields.io/npm/v/vite-plugin-style-inject?color=a1b858&label=)](https://www.npmjs.com/package/vite-plugin-style-inject)
vite-plugin-style-inject
Package: vite-plugin-style-inject
Last modified: Tue, 12 Jul 2022 05:27:32 GMT
Version: 0.0.1
License: MIT
Downloads: 630

Install

npm install vite-plugin-style-inject
yarn add vite-plugin-style-inject

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

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin