Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d7651b
commit b11a14c
Showing
6 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
test/function/samples/respect-reexporter-side-effects/_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,9 @@ | ||
module.exports = { | ||
// solo: true, | ||
description: 'respect side-effects in reexporting modules even if moduleSideEffects are off', | ||
options: { | ||
treeshake: { | ||
moduleSideEffects: false | ||
} | ||
} | ||
}; |
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 = {}; |
6 changes: 6 additions & 0 deletions
6
test/function/samples/respect-reexporter-side-effects/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,6 @@ | ||
import { foo as fooIndirect } from './reexporter-indirect.js'; | ||
import { foo as fooDirect } from './reexporter-direct'; | ||
import { foo as fooIndirectIgnored } from './reexporter-indirect-ignored'; | ||
|
||
assert.deepStrictEqual(fooIndirect, { indirect: 'modified' }); | ||
assert.deepStrictEqual(fooDirect, { indirect: 'modified' }); |
3 changes: 3 additions & 0 deletions
3
test/function/samples/respect-reexporter-side-effects/reexporter-direct.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.js'; | ||
foo.direct = 'should not be modified'; | ||
export { foo } from './foo.js'; |
3 changes: 3 additions & 0 deletions
3
test/function/samples/respect-reexporter-side-effects/reexporter-indirect-ignored.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.js'; | ||
foo.indirectIgnored = 'should not be modified'; | ||
export { foo }; |
3 changes: 3 additions & 0 deletions
3
test/function/samples/respect-reexporter-side-effects/reexporter-indirect.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.js'; | ||
foo.indirect = 'modified'; | ||
export { foo }; |