Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle multiple export * from external declarations (#1252)
- Loading branch information
1 parent
4bbf9fd
commit 457be9c
Showing
8 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
description: 'correctly handles multiple export * declarations (#1252)', | ||
options: { | ||
external: [ 'foo', 'bar', 'baz' ], | ||
globals: { foo: 'foo', bar: 'bar', baz: 'baz' }, | ||
moduleName: 'myBundle' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
define(['exports', 'foo', 'bar', 'baz'], function (exports, foo, bar, baz) { 'use strict'; | ||
|
||
|
||
|
||
Object.keys(foo).forEach(function (key) { exports[key] = foo[key]; }); | ||
Object.keys(bar).forEach(function (key) { exports[key] = bar[key]; }); | ||
Object.keys(baz).forEach(function (key) { exports[key] = baz[key]; }); | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
var foo = require('foo'); | ||
var bar = require('bar'); | ||
var baz = require('baz'); | ||
|
||
|
||
|
||
Object.keys(foo).forEach(function (key) { exports[key] = foo[key]; }); | ||
Object.keys(bar).forEach(function (key) { exports[key] = bar[key]; }); | ||
Object.keys(baz).forEach(function (key) { exports[key] = baz[key]; }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from 'foo'; | ||
export * from 'bar'; | ||
export * from 'baz'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(function (exports,foo,bar,baz) { | ||
'use strict'; | ||
|
||
|
||
|
||
Object.keys(foo).forEach(function (key) { exports[key] = foo[key]; }); | ||
Object.keys(bar).forEach(function (key) { exports[key] = bar[key]; }); | ||
Object.keys(baz).forEach(function (key) { exports[key] = baz[key]; }); | ||
|
||
}((this.myBundle = this.myBundle || {}),foo,bar,baz)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('foo'), require('bar'), require('baz')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'foo', 'bar', 'baz'], factory) : | ||
(factory((global.myBundle = global.myBundle || {}),global.foo,global.bar,global.baz)); | ||
}(this, (function (exports,foo,bar,baz) { 'use strict'; | ||
|
||
Object.keys(foo).forEach(function (key) { exports[key] = foo[key]; }); | ||
Object.keys(bar).forEach(function (key) { exports[key] = bar[key]; }); | ||
Object.keys(baz).forEach(function (key) { exports[key] = baz[key]; }); | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from 'foo'; | ||
export * from 'bar'; | ||
export * from 'baz'; |