@rollup/plugin-alias

  • Version 5.1.1
  • Published
  • 20.9 kB
  • No dependencies
  • MIT license

Install

npm i @rollup/plugin-alias
yarn add @rollup/plugin-alias
pnpm add @rollup/plugin-alias

Overview

Define and resolve aliases for bundle dependencies

Index

Functions

function alias

alias: (options?: RollupAliasOptions) => Plugin;
  • 🍣 A Rollup plugin for defining aliases when bundling packages.

Interfaces

interface Alias

interface Alias {}

    property customResolver

    customResolver?: ResolverFunction | ResolverObject | null;

      property find

      find: string | RegExp;

        property replacement

        replacement: string;

          interface ResolvedAlias

          interface ResolvedAlias {}

            property find

            find: string | RegExp;

              property replacement

              replacement: string;

                property resolverFunction

                resolverFunction: ResolverFunction | null;

                  interface ResolverObject

                  interface ResolverObject {}

                    property buildStart

                    buildStart?: PluginHooks['buildStart'];

                      property resolveId

                      resolveId: ResolverFunction;

                        interface RollupAliasOptions

                        interface RollupAliasOptions {}

                          property customResolver

                          customResolver?: ResolverFunction | ResolverObject | null;
                          • Instructs the plugin to use an alternative resolving algorithm, rather than the Rollup's resolver. null

                          property entries

                          entries?: readonly Alias[] | { [find: string]: string };
                          • Specifies an Object, or an Array of Object, which defines aliases used to replace values in import or require statements. With either format, the order of the entries is important, in that the first defined rules are applied first.

                          Type Aliases

                          type MapToFunction

                          type MapToFunction<T> = T extends Function ? T : never;

                            type ResolverFunction

                            type ResolverFunction = MapToFunction<PluginHooks['resolveId']>;

                              Package Files (1)

                              Dependencies (0)

                              No dependencies.

                              Dev Dependencies (5)

                              Peer Dependencies (1)

                              Badge

                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@rollup/plugin-alias.

                              • Markdown
                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@rollup/plugin-alias)
                              • HTML
                                <a href="https://www.jsdocs.io/package/@rollup/plugin-alias"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>