npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@luban-ui/vite-plugin-vue

v1.1.0

Published

> Vite plugin presets, for vue sites.

Downloads

23

Readme

vite plugin for vue sites

Vite plugin presets, for vue sites.

Install

npm i vite @luban-ui/vite-plugin-vue -D

Create config file

// vite.config.ts
import * as path from 'node:path';
import { defineConfig } from 'vite';
import viteLubanPlugin from '@luban-ui/vite-plugin-vue';

export default defineConfig(() => {
  const root = __dirname;

  return {
    // default: process.cwd()
    root: process.cwd(),
    // default: {root}/envs/
    envDir: path.resolve(root, './envs'),
    // default: /
    base: '/',
    server: {
      host: '0.0.0.0',
      port: 5175
    },
    plugins: [viteLubanPlugin({
      root
      // ...other options
    })],
    build: {
      rollupOptions: {
        input: {
          main: path.resolve(__dirname, 'index.html')
        }
      }
    }
  };
});

Options

export interface PluginOption {
  root?: string;

  // @vitejs/plugin-vue
  // https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#readme
  vue?: {
    // default: true
    enable?: boolean;
  };

  // @vitejs/plugin-basic-ssl
  // https://github.com/vitejs/vite-plugin-basic-ssl/#readme
  ssl?: {
    // default: true
    enable?: boolean;
  };

  // vite-plugin-mkcert
  // https://github.com/liuweiGL/vite-plugin-mkcert/blob/main/README-zh_CN.md
  mkcert?: {
    enable?: boolean;
    options?: MkcertPluginOptions;
  };

  // vite-svg-loader
  // https://github.com/jpkleemans/vite-svg-loader#readme
  svg?: {
    // default: true
    enable?: boolean;
  };

  // @intlify/unplugin-vue-i18n/vite
  // https://github.com/intlify/bundle-tools/blob/main/packages/unplugin-vue-i18n/README.md
  i18n?: {
    // default: true
    enable?: boolean;
    options?: {
      // default: {root}/src/i18n/locales/**/*.json
      includes?: string | string[];
    };
  };

  // @vitejs/plugin-legacy
  // https://github.com/vitejs/vite/tree/main/packages/plugin-legacy
  // https://www.npmjs.com/package/vite-plugin-legacy-extends
  legacy?: {
    // default: true
    enable?: boolean;
    options?: {
      targets?: Targets;
      modernTargets?: Targets;
    };
  };

  // rollup-plugin-visualizer
  // https://github.com/btd/rollup-plugin-visualizer
  visualizer?: {
    // default: true
    enable?: boolean;
    options?: {
      // default: {root}/stats.html
      filename?: string;
    };
  };

  // vite-plugin-circular-dependency
  // https://github.com/threedayAAAAA/rollup-plugin-circular-dependency#readme
  circularDependency?: {
    // default: true
    enable?: boolean;
  };

  // @luban-ui/vite-plugun-css-modules-dts
  // https://github.com/luban-dev/vite-plugun-css-modules-dts
  cssModulesDts?: {
    // default: true
    enable?: boolean;
    options?: {
      // **/*.module.scss
      files: string[];
      namedExports: boolean;
    };
  };

  // @luban-ui/vite-plugun-env-dts
  // https://github.com/luban-dev/vite-plugun-env-dts
  envDts?: {
    // default: true
    enable?: boolean;
    options?: {
      filename?: string;
      name?: string;
    };
  };

  // @luban-ui/vite-plugun-sitemap
  // https://github.com/luban-dev/vite-plugun-sitemap
  sitemap?: {
    // default: false
    enable?: boolean;
    options?: {
      domains: string[];
      pages: {
        path: string;
        languages?: string[];
        defaultLanguage?: string;
        priority?: number;
      }[];
      languages: string[];
      defaultLanguage?: string;
      getLanguagePath?: (page: string, lang: string) => string;
      filename?: (domain: string) => string;
    };
  };

  split?: {
    // default: true
    enable?: boolean;
  };

  cdn?: {
    url?: string;
    assetsPattern?: RegExp;
  };
}