unplugin-alias2
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

unplugin-alias2

NPM version

🍣 A universal bundler plugin for defining aliases when bundling packages.

Install

npm i unplugin-alias2
Vite
// vite.config.ts
import UnpluginAlias from 'unplugin-alias2/vite'

export default defineConfig({
  plugins: [
    UnpluginAlias({
      /* options */
    }),
  ],
})

Example: playground/


Rollup
// rollup.config.js
import UnpluginAlias from 'unplugin-alias2/rollup'

export default {
  plugins: [
    UnpluginAlias({
      /* options */
    }),
  ],
}


Webpack
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('unplugin-alias2/webpack')({
      /* options */
    }),
  ],
}


Nuxt
// nuxt.config.js
export default defineNuxtConfig({
  modules: [
    [
      'unplugin-alias2/nuxt',
      {
        /* options */
      },
    ],
  ],
})

This module works for both Nuxt 2 and Nuxt Vite


Vue CLI
// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require('unplugin-alias2/webpack')({
        /* options */
      }),
    ],
  },
}


esbuild
// esbuild.config.js
import { build } from 'esbuild'
import UnpluginAlias from 'unplugin-alias2/esbuild'

build({
  plugins: [UnpluginAlias()],
})


Usage

Options

For all options please refer to docs.

This plugin accepts all @rollup/plugin-alias options.

/unplugin-alias2/

    Package Sidebar

    Install

    npm i unplugin-alias2

    Weekly Downloads

    2

    Version

    0.2.1

    License

    MIT

    Unpacked Size

    25.6 kB

    Total Files

    45

    Last publish

    Collaborators

    • wzc520pyfm