-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: ✅ add test case for export named ased twice
- Loading branch information
1 parent
3527cd9
commit 53f756d
Showing
6 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
e2e/fixtures/tree-shaking.skip_module.reexport_same_name_twice/expect.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,10 @@ | ||
const assert = require('assert'); | ||
const { parseBuildResult } = require('../../../scripts/test-utils'); | ||
const { files } = parseBuildResult(__dirname); | ||
|
||
const content = files['index.js']; | ||
|
||
assert(!content.includes('src/dep/proxy.js'), `should skip middle files`); | ||
|
||
assert(content.match(/v1:\s+function\(\) {\s+return _dep\.default;\s+}/), `shoule export v1 ref to _dep.default`) | ||
assert(content.match(/v2:\s+function\(\) {\s+return _dep\.default;\s+}/), `shoule export v2 ref to _dep.default`) | ||
3 changes: 3 additions & 0 deletions
3
e2e/fixtures/tree-shaking.skip_module.reexport_same_name_twice/mako.config.json
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 @@ | ||
{ | ||
"optimizePackageImports": false | ||
} |
1 change: 1 addition & 0 deletions
1
e2e/fixtures/tree-shaking.skip_module.reexport_same_name_twice/src/dep/dep.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 1; |
3 changes: 3 additions & 0 deletions
3
e2e/fixtures/tree-shaking.skip_module.reexport_same_name_twice/src/dep/index.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 @@ | ||
export { default as v1, default as v2 } from './proxy.js'; | ||
|
||
console.log('sideEffects') |
1 change: 1 addition & 0 deletions
1
e2e/fixtures/tree-shaking.skip_module.reexport_same_name_twice/src/dep/proxy.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 } from './dep.js' |
3 changes: 3 additions & 0 deletions
3
e2e/fixtures/tree-shaking.skip_module.reexport_same_name_twice/src/index.ts
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 { v1, v2 } from './dep/index.js'; | ||
|
||
console.log(v1,v2); |