Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
import { something } from 'package/dep.js'
import { something2 } from 'package/dep2.js'
import { something3 } from 'package-directive/dep.js'

it('should not include a module that is side effect free and exports are not used due to static analysis', () => {
const modules = Object.keys(__turbopack_modules__)
expect(modules).toContainEqual(
expect.stringMatching(/input\/node_modules\/package\/dep2\.js/)
)
expect(modules).not.toContainEqual(
expect.stringMatching(/input\/node_modules\/package\/dep\.js/)
)

if (true) {
something2()
return
}
something()
})

it('should not include a module that is side effect free via directive and exports are not used due to static analysis', () => {
const modules = Object.keys(__turbopack_modules__)
expect(modules).not.toContainEqual(
expect.stringMatching(/input\/node_modules\/package-directive\/dep\.js/)
)

if (true) {
} else {
something3()
}
})

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"treeShakingMode": "reexports-only"
"treeShakingMode": "reexports-only",
"scopeHoisting": false
}
Loading