vite-plugin-react-scope-css
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

Vite plugin - React Scoped Css

Move Vue scoped css to react

Usage

npm add vite-plugin-react-scope-css -D

vite.config.js:

import reactScopedCss from "vite-plugin-react-scope-css";

export default {
    //...
    plugins: [reactScopedCss(), react()],
   //...
  };


   // with options
  export default {
    plugins: [
      // The example options is default value, The css filename with end of '.scoped.css' will be scoped, eg: test.scoped.css
      reactScopedCss({
         include: /\.[jt]sx$/,
         cssReg: /\.scoped\.(le|sa|sc|c)ss$/,
      })
   ]
  }

Demo

Related Package

@vue/compiler-sfc

Readme

Keywords

Package Sidebar

Install

npm i vite-plugin-react-scope-css

Weekly Downloads

2

Version

1.0.5

License

ISC

Unpacked Size

5.36 kB

Total Files

6

Last publish

Collaborators

  • madao2019