@arco-plugins/vite-react
For Vite build, load Arco Design styles on demand
Last updated 2 years ago by jinghm318 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @arco-plugins/vite-react 
SYNC missed versions from official npm registry.

@arco-plugins/vite-react

Feature

  1. Style lazy load
  2. Theme import
  3. Icon replacement

Style lazy load doesn't work during development for better experience.

Install

npm i @arco-plugins/vite-react -D

Usage

// vite.config.js

import vitePluginForArco from '@arco-plugins/vite-react'

export default {
  ...
  plugins: [
    vitePluginForArco(options),
  ],
}
// react
import { Button } from '@arco-design/web-react';

export default () => (
  <div>
    <Button type="secondary">Cancel</Button>
    <Button type="primary">Submit</Button>
  </div>
);

Options

The plugin supports the following parameters:

Params Type Default Value Description
theme {String} '' Theme package name
iconBox {String} '' Icon library package name
modifyVars {Object} {} Less variables
style {'css'\|Boolean} true Style import method
varsInjectScope {(string\|RegExp)[]} [] Scope of injection of less variables (modifyVars and the theme package's variables)

**Style import methods **

style: true will import less file

import '@arco-design/web-react/Affix/style';

style: 'css' will import css file

import '@arco-design/web-react/Affix/style/css';

style: false will not import any style file

Current Tags

  • 1.3.3                                ...           latest (2 years ago)

13 Versions

  • 1.3.3                                ...           2 years ago
  • 1.3.2                                ...           2 years ago
  • 1.3.1                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.6                                ...           3 years ago
  • 1.0.5                                ...           3 years ago
  • 1.0.4                                ...           3 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (2)
Dependents (0)
None

© 2010 - cnpmjs.org x YWFE | Home | YWFE