Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure external re-exports are included for moduleSideEffects: fal…
…se (#2905) * Always include external reexports even when moduleSideEffects are false * Treat implicit external modules the same way as explicit ones for module side-effects
- Loading branch information
1 parent
c68bd95
commit 0a0b67f
Showing
7 changed files
with
51 additions
and
9 deletions.
There are no files selected for viewing
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
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
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
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
1 change: 1 addition & 0 deletions
1
test/function/samples/module-side-effects/external-false/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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import 'pluginsideeffects-false'; | ||
import 'pluginsideeffects-true'; | ||
import 'internal'; | ||
import 'implicit-external'; |
24 changes: 24 additions & 0 deletions
24
test/function/samples/module-side-effects/reexport-from-external/_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,24 @@ | ||
const assert = require('assert'); | ||
|
||
module.exports = { | ||
description: 'handles reexporting external values when module side-effects are false', | ||
context: { | ||
require(id) { | ||
return { value: id }; | ||
} | ||
}, | ||
exports(exports) { | ||
assert.deepStrictEqual(exports, { | ||
external: 'external', | ||
value: 'externalStar' | ||
}); | ||
}, | ||
options: { | ||
external() { | ||
return true; | ||
}, | ||
treeshake: { | ||
moduleSideEffects: false | ||
} | ||
} | ||
}; |
2 changes: 2 additions & 0 deletions
2
test/function/samples/module-side-effects/reexport-from-external/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,2 @@ | ||
export { value as external } from 'external'; | ||
export * from 'externalStar'; |