Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve a situation where different default exports referencing the same
original variable would be rendered as two different imports of a chunk which have the same name
- Loading branch information
1 parent
6903425
commit 962362d
Showing
19 changed files
with
114 additions
and
5 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
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_config.js
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,7 @@ | ||
module.exports = { | ||
description: | ||
'do not import variables that reference an original if another variable referencing it is already imported', | ||
options: { | ||
input: ['main1', 'main2'] | ||
} | ||
}; |
8 changes: 8 additions & 0 deletions
8
...form/samples/deduplicate-imports-referencing-originals-2/_expected/amd/generated-chunk.js
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 @@ | ||
define(['exports'], function (exports) { 'use strict'; | ||
|
||
const foo = {}; | ||
|
||
exports.foo = foo; | ||
exports.bar = foo; | ||
|
||
}); |
5 changes: 5 additions & 0 deletions
5
.../chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/amd/main1.js
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,5 @@ | ||
define(['./generated-chunk.js'], function (__chunk_1) { 'use strict'; | ||
|
||
console.log(__chunk_1.bar, __chunk_1.bar); | ||
|
||
}); |
5 changes: 5 additions & 0 deletions
5
.../chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/amd/main2.js
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,5 @@ | ||
define(['./generated-chunk.js'], function (__chunk_1) { 'use strict'; | ||
|
||
console.log(__chunk_1.bar, __chunk_1.bar); | ||
|
||
}); |
6 changes: 6 additions & 0 deletions
6
...form/samples/deduplicate-imports-referencing-originals-2/_expected/cjs/generated-chunk.js
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,6 @@ | ||
'use strict'; | ||
|
||
const foo = {}; | ||
|
||
exports.foo = foo; | ||
exports.bar = foo; |
5 changes: 5 additions & 0 deletions
5
.../chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/cjs/main1.js
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,5 @@ | ||
'use strict'; | ||
|
||
var __chunk_1 = require('./generated-chunk.js'); | ||
|
||
console.log(__chunk_1.bar, __chunk_1.bar); |
5 changes: 5 additions & 0 deletions
5
.../chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/cjs/main2.js
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,5 @@ | ||
'use strict'; | ||
|
||
var __chunk_1 = require('./generated-chunk.js'); | ||
|
||
console.log(__chunk_1.bar, __chunk_1.bar); |
3 changes: 3 additions & 0 deletions
3
...-form/samples/deduplicate-imports-referencing-originals-2/_expected/es/generated-chunk.js
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 @@ | ||
const foo = {}; | ||
|
||
export { foo as a, foo as b }; |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/es/main1.js
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 @@ | ||
import { a as bar } from './generated-chunk.js'; | ||
|
||
console.log(bar, bar); |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/deduplicate-imports-referencing-originals-2/_expected/es/main2.js
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 @@ | ||
import { a as bar } from './generated-chunk.js'; | ||
|
||
console.log(bar, bar); |
14 changes: 14 additions & 0 deletions
14
...m/samples/deduplicate-imports-referencing-originals-2/_expected/system/generated-chunk.js
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,14 @@ | ||
System.register([], function (exports, module) { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
const foo = {}; | ||
|
||
exports('a', foo); | ||
|
||
exports('b', foo); | ||
|
||
} | ||
}; | ||
}); |
14 changes: 14 additions & 0 deletions
14
...unking-form/samples/deduplicate-imports-referencing-originals-2/_expected/system/main1.js
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,14 @@ | ||
System.register(['./generated-chunk.js'], function (exports, module) { | ||
'use strict'; | ||
var bar; | ||
return { | ||
setters: [function (module) { | ||
bar = module.a; | ||
}], | ||
execute: function () { | ||
|
||
console.log(bar, bar); | ||
|
||
} | ||
}; | ||
}); |
14 changes: 14 additions & 0 deletions
14
...unking-form/samples/deduplicate-imports-referencing-originals-2/_expected/system/main2.js
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,14 @@ | ||
System.register(['./generated-chunk.js'], function (exports, module) { | ||
'use strict'; | ||
var bar; | ||
return { | ||
setters: [function (module) { | ||
bar = module.a; | ||
}], | ||
execute: function () { | ||
|
||
console.log(bar, bar); | ||
|
||
} | ||
}; | ||
}); |
1 change: 1 addition & 0 deletions
1
test/chunking-form/samples/deduplicate-imports-referencing-originals-2/foo.js
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 const foo = {}; |
4 changes: 4 additions & 0 deletions
4
test/chunking-form/samples/deduplicate-imports-referencing-originals-2/main1.js
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,4 @@ | ||
import foo from './proxy1'; | ||
import bar from './proxy2'; | ||
|
||
console.log(foo, bar); |
4 changes: 4 additions & 0 deletions
4
test/chunking-form/samples/deduplicate-imports-referencing-originals-2/main2.js
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,4 @@ | ||
import foo from './proxy1'; | ||
import bar from './proxy2'; | ||
|
||
console.log(foo, bar); |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/deduplicate-imports-referencing-originals-2/proxy1.js
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 @@ | ||
import { foo } from './foo'; | ||
|
||
export default foo; |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/deduplicate-imports-referencing-originals-2/proxy2.js
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 @@ | ||
import { foo } from './foo'; | ||
|
||
export default foo; |