-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test case for handling and deduplicating multiple synthetic named…
… and default imports
- Loading branch information
1 parent
bb5b1b3
commit 3124824
Showing
7 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
test/chunking-form/samples/deduplicate-synthetic-named-exports-and-default/_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,17 @@ | ||
module.exports = { | ||
description: 'handles importing a synthetic named export together with the default export', | ||
options: { | ||
input: ['main', 'main2'], | ||
plugins: [ | ||
{ | ||
name: 'test-plugin', | ||
transform(code) { | ||
return { | ||
code, | ||
syntheticNamedExports: true | ||
}; | ||
} | ||
} | ||
] | ||
} | ||
}; |
4 changes: 4 additions & 0 deletions
4
...orm/samples/deduplicate-synthetic-named-exports-and-default/_expected/es/generated-lib.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 @@ | ||
var lib = { foo: true, bar: true, baz: true }; | ||
|
||
var foo = lib.foo; | ||
export { foo as f, lib as l }; |
1 change: 1 addition & 0 deletions
1
...hunking-form/samples/deduplicate-synthetic-named-exports-and-default/_expected/es/main.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 { f as foo, l as lib } from './generated-lib.js'; |
3 changes: 3 additions & 0 deletions
3
...unking-form/samples/deduplicate-synthetic-named-exports-and-default/_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 { l as lib } from './generated-lib.js'; | ||
|
||
console.log(lib, lib.foo, lib.bar, lib.baz); |
1 change: 1 addition & 0 deletions
1
test/chunking-form/samples/deduplicate-synthetic-named-exports-and-default/lib.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 default { foo: true, bar: true, baz: true }; |
1 change: 1 addition & 0 deletions
1
test/chunking-form/samples/deduplicate-synthetic-named-exports-and-default/main.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 { default as lib, foo } from './lib.js'; |
2 changes: 2 additions & 0 deletions
2
test/chunking-form/samples/deduplicate-synthetic-named-exports-and-default/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,2 @@ | ||
import lib, { foo, bar, baz } from './lib.js'; | ||
console.log(lib, foo, bar, baz); |