-
Notifications
You must be signed in to change notification settings - Fork 85
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 use some source twice
- Loading branch information
1 parent
ffcdfb5
commit 020e2dc
Showing
5 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
e2e/fixtures/tree-shaking.skip_module.use_multi_same_source/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,11 @@ | ||
const assert = require('assert'); | ||
const { parseBuildResult } = require('../../../scripts/test-utils'); | ||
const { files } = parseBuildResult(__dirname); | ||
|
||
const content = files['index.js']; | ||
|
||
assert( | ||
content.includes('src/dep/index.js'), | ||
`dep/index.js should keep in chunk`, | ||
); | ||
assert(content.includes('src/dep/dep.js'), `dep/dep.js should keep in chunk`); |
3 changes: 3 additions & 0 deletions
3
e2e/fixtures/tree-shaking.skip_module.use_multi_same_source/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 | ||
} |
3 changes: 3 additions & 0 deletions
3
e2e/fixtures/tree-shaking.skip_module.use_multi_same_source/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,3 @@ | ||
export const x = 'x'; | ||
export const y = 'y'; | ||
export const z = 'z'; |
2 changes: 2 additions & 0 deletions
2
e2e/fixtures/tree-shaking.skip_module.use_multi_same_source/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,2 @@ | ||
export * from './dep.js'; | ||
export const a = 'a'; |
4 changes: 4 additions & 0 deletions
4
e2e/fixtures/tree-shaking.skip_module.use_multi_same_source/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,4 @@ | ||
import { a, x } from './dep'; | ||
import { y } from './dep'; | ||
|
||
console.log(a, x, y); |