Socket
Book a DemoInstallSign in
Socket

@dpapejs/vite-plugin-import-component

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dpapejs/vite-plugin-import-component

🛠️ Vite 插件组件按需引入

latest
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

@dpapejs/vite-plugin-import-component

Modular import plugin for vite plugin, compatible with @dpapejs/cmod-ui, Element UI 2.X, and so on.

Use

Install

npm i @dpapejs/vite-plugin-import-component -D
# OR
yarn add @dpapejs/vite-plugin-import-component -D

vite.config.js

import { defineConfig } from "vite";
import vitePluginImport from '@dpapejs/vite-plugin-import-component'
export default defineConfig({
  plugins: [
    ... // other plugins
     usePluginImport({
      libraryName: '@dpapejs/cmod-ui',
      libraryDirectory: 'es',
      style: true
    })
    // Other configurations welcome PR
  ];
})

API

{ "libraryName": "@dpapejs/cmod-ui" }

<template>
  <div class="example">
    <Button> Button Text </Button>
  </div>
</template>
import { Button } from '@dpapejs/cmod-ui';

      ↓ ↓ ↓ ↓ ↓ ↓

import Button from '@dpapejs/cmod-ui/lib/button/index.js';
import '@dpapejs/cmod-ui/lib/button/style.js'

LICENSE

MIT

Keywords

vite

FAQs

Package last updated on 12 Mar 2025

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