Normally Pleasant Mixture

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

    0.2.5 • Public • Published

    vite-plugin-importer

    Integration for babel-plugin-import

    use

    config same as babel-plugin-import

    npm install vite-plugin-importer --save
    yarn add vite-plugin-importer
    
    // vite.config.js
    import { defineConfig } from "vite";
    import usePluginImport from 'vite-plugin-importer'
    export default defineConfig({
      plugins: [
        ... // other plugins
        usePluginImport({
          libraryName: "ant-design-vue",
          libraryDirectory: "es",
          style: "css",
        }),
        usePluginImport({
          libraryName: "antd",
          libraryDirectory: "es",
          style: "css",
        }),
        usePluginImport({
          libraryName: 'vant',
          libraryDirectory: 'es',
          style: (name) => `${name}/style/less`,
        }),
        usePluginImport({
          libraryName: 'element-plus',
          customStyleName: (name) => {
            return `element-plus/lib/theme-chalk/${name}.css`;
          },
        })
        // Other configurations welcome PR
      ];
    })

    LICENSE

    MIT

    Install

    npm i vite-plugin-importer

    DownloadsWeekly Downloads

    871

    Version

    0.2.5

    License

    MIT

    Unpacked Size

    3.84 kB

    Total Files

    5

    Last publish

    Collaborators

    • ajuner