Skip to content

Commit

Permalink
Merge pull request #315 from developit/alias
Browse files Browse the repository at this point in the history
Add support for --alias
  • Loading branch information
developit committed Feb 19, 2019
2 parents fca649a + 1a9828e commit 3021595
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.js
Expand Up @@ -291,6 +291,9 @@ function createConfig(options, entry, format, writeMeta) {
if (options.multipleEntries) {
aliases['.'] = './' + basename(options.output);
}
if (options.alias) {
aliases = Object.assign(aliases, parseGlobals(options.alias));
}

const peerDeps = Object.keys(pkg.peerDependencies || {});
if (options.external === 'none') {
Expand Down
2 changes: 2 additions & 0 deletions src/prog.js
Expand Up @@ -24,6 +24,8 @@ export default handler => {
.option('--external', `Specify external dependencies, or 'none'`)
.option('--globals', `Specify globals dependencies, or 'none'`)
.example('microbundle --globals react=React,jquery=$')
.option('--alias', `Map imports to different modules`)
.example('microbundle --alias react=preact')
.option('--compress', 'Compress output using Terser', null)
.option('--strict', 'Enforce undefined global context and add "use strict"')
.option('--name', 'Specify name exposed in UMD builds')
Expand Down

0 comments on commit 3021595

Please sign in to comment.