Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Respect configured entry order and creates facades from later entries
- Loading branch information
1 parent
d0312ff
commit 1c97de9
Showing
5 changed files
with
47 additions
and
19 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
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,27 @@ | ||
const assert = require('assert'); | ||
|
||
module.exports = { | ||
description: 'respects the order of entry points when there are additional facades for chunks', | ||
options: { | ||
input: { | ||
main: 'main', | ||
'main-alias': 'main', | ||
other: 'other' | ||
}, | ||
plugins: { | ||
generateBundle(options, bundle) { | ||
assert.deepStrictEqual( | ||
Object.keys(bundle).map(id => [id, bundle[id].code]), | ||
[ | ||
['main.js', "'use strict';\n\nvar main = 'main1';\n\nmodule.exports = main;\n"], | ||
['other.js', "'use strict';\n\nvar other = 'main2';\n\nmodule.exports = other;\n"], | ||
[ | ||
'main-alias.js', | ||
"'use strict';\n\nvar main = require('./main.js');\n\n\n\nmodule.exports = main;\n" | ||
] | ||
] | ||
); | ||
} | ||
} | ||
} | ||
}; |
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 @@ | ||
export default 'main1'; |
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 @@ | ||
export default 'main2'; |