Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: deduplicate reexports and renderedExports to simplify output (#…
…4759) * fix: deduplicate reexports and renderedExports * test: regression es test * test: regression amd and cjs test * test: regression system test * Revert "test: regression amd and cjs test" This reverts commit 5c3ae7a. * Revert "test: regression system test" This reverts commit 9159eb4. * fix: only for es format
- Loading branch information
Showing
27 changed files
with
84 additions
and
36 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
3 changes: 2 additions & 1 deletion
3
test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/es/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,8 +1,9 @@ | ||
import foo from './default.js'; | ||
export { default } from './default.js'; | ||
import { value } from './named.js'; | ||
|
||
console.log(foo, value); | ||
|
||
import('./default.js').then(result => console.log(result.default)); | ||
import('./named.js').then(result => console.log(result.value)); | ||
|
||
export { foo as default }; |
3 changes: 2 additions & 1 deletion
3
test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/other.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,4 +1,5 @@ | ||
import { __exports as other } from './_virtual/other.js'; | ||
export { __exports as default } from './_virtual/other.js'; | ||
|
||
other.value = 43; | ||
|
||
export { other as default }; |
3 changes: 2 additions & 1 deletion
3
.../chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/es/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,8 +1,9 @@ | ||
import foo from './default.js'; | ||
export { default } from './default.js'; | ||
import { value } from './named.js'; | ||
|
||
console.log(foo, value); | ||
|
||
import('./default.js').then(result => console.log(result.default)); | ||
import('./named.js').then(result => console.log(result.value)); | ||
|
||
export { foo as default }; |
5 changes: 4 additions & 1 deletion
5
.../chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/es/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,2 +1,5 @@ | ||
import foo from './dep2.js'; | ||
export { default } from './dep2.js'; | ||
|
||
|
||
|
||
export { foo as default }; |
3 changes: 2 additions & 1 deletion
3
...oved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expected/es/generated-dynamic2.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,4 +1,5 @@ | ||
import { value } from './main.js'; | ||
export { value } from './main.js'; | ||
|
||
console.log('dynamic2', value); | ||
|
||
export { value }; |
3 changes: 2 additions & 1 deletion
3
...samples/improved-dynamic-chunks/dynamic-import-dynamic/_expected/es/generated-dynamic2.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,4 +1,5 @@ | ||
import { value } from './generated-dynamic1.js'; | ||
export { value } from './generated-dynamic1.js'; | ||
|
||
console.log('dynamic2', value); | ||
|
||
export { value }; |
4 changes: 2 additions & 2 deletions
4
...ic-chunks/multi-entry-different-and-shared-dependencies/_expected/es/generated-dynamic.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,6 +1,6 @@ | ||
import { v as value1 } from './generated-from-main-1-and-dynamic.js'; | ||
export { v as value1 } from './generated-from-main-1-and-dynamic.js'; | ||
import { v as value2 } from './generated-from-main-1-and-2.js'; | ||
export { v as value2 } from './generated-from-main-1-and-2.js'; | ||
|
||
console.log('dynamic1', value1, value2); | ||
|
||
export { value1, value2 }; |
4 changes: 2 additions & 2 deletions
4
...proved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/es/main1.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,7 +1,7 @@ | ||
import { v as value1 } from './generated-from-main-1-and-dynamic.js'; | ||
export { v as value1 } from './generated-from-main-1-and-dynamic.js'; | ||
import { v as value2, a as value3 } from './generated-from-main-1-and-2.js'; | ||
export { v as value2, a as value3 } from './generated-from-main-1-and-2.js'; | ||
|
||
console.log('main1', value1, value2, value3); | ||
import('./generated-dynamic.js'); | ||
|
||
export { value1, value2, value3 }; |
3 changes: 2 additions & 1 deletion
3
...proved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/es/main2.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,5 +1,6 @@ | ||
import { v as value2, a as value3 } from './generated-from-main-1-and-2.js'; | ||
export { v as value2, a as value3 } from './generated-from-main-1-and-2.js'; | ||
|
||
console.log('main2', value2, value3); | ||
import('./generated-dynamic.js'); | ||
|
||
export { value2, value3 }; |
4 changes: 2 additions & 2 deletions
4
...roved-dynamic-chunks/multi-entry-different-dependencies/_expected/es/generated-dynamic.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,6 +1,6 @@ | ||
import { v as value1 } from './generated-dep1.js'; | ||
export { v as value1 } from './generated-dep1.js'; | ||
import { v as value2 } from './generated-dep2.js'; | ||
export { v as value2 } from './generated-dep2.js'; | ||
|
||
console.log('dynamic1', value1, value2); | ||
|
||
export { value1, value2 }; |
4 changes: 2 additions & 2 deletions
4
.../samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/es/main1.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,9 +1,9 @@ | ||
import { v as value1 } from './generated-dep1.js'; | ||
export { v as value1 } from './generated-dep1.js'; | ||
import { v as value2 } from './generated-dep2.js'; | ||
export { v as value2 } from './generated-dep2.js'; | ||
|
||
const something = 'something'; | ||
|
||
console.log('main1', value1, value2, something); | ||
import('./generated-dynamic.js'); | ||
|
||
export { value1, value2 }; |
3 changes: 2 additions & 1 deletion
3
.../samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/es/main2.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,5 +1,6 @@ | ||
import { v as value2 } from './generated-dep2.js'; | ||
export { v as value2 } from './generated-dep2.js'; | ||
|
||
console.log('main2', value2); | ||
import('./generated-dynamic.js'); | ||
|
||
export { value2 }; |
3 changes: 2 additions & 1 deletion
3
...namic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/es/generated-dynamic1.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,5 +1,6 @@ | ||
import { value1 } from './main1.js'; | ||
export { value1 } from './main1.js'; | ||
import './generated-dep2.js'; | ||
|
||
console.log('dynamic1', value1); | ||
|
||
export { value1 }; |
3 changes: 2 additions & 1 deletion
3
...namic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/es/generated-dynamic2.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,4 +1,5 @@ | ||
import { v as value2 } from './generated-dep2.js'; | ||
export { v as value2 } from './generated-dep2.js'; | ||
|
||
console.log('dynamic2', value2); | ||
|
||
export { value2 }; |
3 changes: 1 addition & 2 deletions
3
...s/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/es/main1.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,9 +1,8 @@ | ||
import { v as value2 } from './generated-dep2.js'; | ||
export { v as value2 } from './generated-dep2.js'; | ||
|
||
const value1 = 'shared1'; | ||
|
||
console.log('main1', value1, value2); | ||
import('./generated-dynamic1.js'); | ||
|
||
export { value1 }; | ||
export { value1, value2 }; |
3 changes: 2 additions & 1 deletion
3
...s/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/es/main2.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,5 +1,6 @@ | ||
import { v as value2 } from './generated-dep2.js'; | ||
export { v as value2 } from './generated-dep2.js'; | ||
|
||
console.log('main2', value2); | ||
import('./generated-dynamic2.js'); | ||
|
||
export { value2 }; |
3 changes: 2 additions & 1 deletion
3
...improved-dynamic-chunks/single-dynamic-multiple-imports/_expected/es/generated-dynamic.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,4 +1,5 @@ | ||
import { value } from './main.js'; | ||
export { value } from './main.js'; | ||
|
||
console.log('dynamic', value); | ||
|
||
export { value }; |
3 changes: 2 additions & 1 deletion
3
...ing-form/samples/improved-dynamic-chunks/single-dynamic/_expected/es/generated-dynamic.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,4 +1,5 @@ | ||
import { value } from './main.js'; | ||
export { value } from './main.js'; | ||
|
||
console.log('dynamic', value); | ||
|
||
export { value }; |
3 changes: 2 additions & 1 deletion
3
test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/es/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,8 +1,9 @@ | ||
import foo from './default.js'; | ||
export { default } from './default.js'; | ||
import { value } from './named.js'; | ||
|
||
console.log(foo, value); | ||
|
||
import('./default.js').then(result => console.log(result.default)); | ||
import('./named.js').then(result => console.log(result.value)); | ||
|
||
export { foo as default }; |
3 changes: 2 additions & 1 deletion
3
test/chunking-form/samples/preserve-modules-commonjs/_expected/es/other.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,4 +1,5 @@ | ||
import { __exports as other } from './_virtual/other.js'; | ||
export { __exports as default } from './_virtual/other.js'; | ||
|
||
other.value = 43; | ||
|
||
export { other as default }; |
3 changes: 2 additions & 1 deletion
3
test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/es/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,5 +1,6 @@ | ||
import * as lib from './lib.js'; | ||
export { lib }; | ||
|
||
console.log(lib); | ||
import('./lib.js').then(console.log); | ||
|
||
export { lib }; |
3 changes: 2 additions & 1 deletion
3
test/chunking-form/samples/preserve-modules-named-export-mode/_expected/es/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,8 +1,9 @@ | ||
import foo from './default.js'; | ||
export { default } from './default.js'; | ||
import { value } from './named.js'; | ||
|
||
console.log(foo, value); | ||
|
||
import('./default.js').then(result => console.log(result.default)); | ||
import('./named.js').then(result => console.log(result.value)); | ||
|
||
export { foo as default }; |
5 changes: 4 additions & 1 deletion
5
test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/es/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,2 +1,5 @@ | ||
import foo from './dep2.js'; | ||
export { default } from './dep2.js'; | ||
|
||
|
||
|
||
export { foo as default }; |
3 changes: 2 additions & 1 deletion
3
.../samples/preserve-modules-root/_expected/es/custom_modules/@my-scope/my-base-pkg/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 |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { __exports as myBasePkg } from '../../../_virtual/index.js'; | ||
export { __exports as default } from '../../../_virtual/index.js'; | ||
|
||
Object.defineProperty(myBasePkg, '__esModule', { value: true }); | ||
|
||
var hello = 'world'; | ||
|
||
myBasePkg.hello = hello; | ||
|
||
export { myBasePkg as default }; |
5 changes: 4 additions & 1 deletion
5
test/chunking-form/samples/reexport-shortpaths/_expected/es/main1.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,2 +1,5 @@ | ||
import { f as foo } from './generated-dep2.js'; | ||
export { f as default } from './generated-dep2.js'; | ||
|
||
|
||
|
||
export { foo as default }; |
3 changes: 1 addition & 2 deletions
3
...hetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/es/main1.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,7 +1,6 @@ | ||
import { l as lib } from './generated-lib.js'; | ||
export { l as lib } from './generated-lib.js'; | ||
|
||
|
||
|
||
var foo = lib.foo; | ||
export { foo }; | ||
export { foo, lib }; |