unplugin-alias2
v0.2.1
Published
A universal bundler plugin for defining aliases when bundling packages.
Downloads
5
Maintainers
Readme
unplugin-alias2
🍣 A universal bundler plugin for defining aliases when bundling packages.
Install
npm i unplugin-alias2
// vite.config.ts
import UnpluginAlias from 'unplugin-alias2/vite'
export default defineConfig({
plugins: [
UnpluginAlias({
/* options */
}),
],
})
Example: playground/
// rollup.config.js
import UnpluginAlias from 'unplugin-alias2/rollup'
export default {
plugins: [
UnpluginAlias({
/* options */
}),
],
}
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-alias2/webpack')({
/* options */
}),
],
}
// nuxt.config.js
export default defineNuxtConfig({
modules: [
[
'unplugin-alias2/nuxt',
{
/* options */
},
],
],
})
This module works for both Nuxt 2 and Nuxt Vite
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-alias2/webpack')({
/* options */
}),
],
},
}
// 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.