rollup-plugin-alias-module-specifiers

0.1.7 • Public • Published

rollup-plugin-alias-module-specifiers

Rollup plugin to alias module specifiers (named specifiers and paths).

install

$ npm install -D rollup-plugin-alias-module-specifiers

example

import tool from 'utility/tool.js';

turns into

import tool from './third-party/some-utils/tool.js';

with a rollup config of

import aliasModuleSpecifiers from 'rollup-plugin-alias-module-specifiers';

export default {
    entry: 'index.js',
    plugins: [
        aliasModuleSpecifiers({
            'utility/': './third-party/some-util/'
        })
    ]
};

The options passed to aliasModuleSpecifiers are used to match the specifier by key and replace it with the given value. Keys must match from the start of the specifier and only the matched part is replaced.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.71latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.71
0.1.61
0.1.51
0.1.41
0.1.31
0.1.21
0.1.11
0.1.01

Package Sidebar

Install

npm i rollup-plugin-alias-module-specifiers

Weekly Downloads

8

Version

0.1.7

License

MIT

Last publish

Collaborators

  • mindtouchdev
  • jeremyrh