-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cjs): aovid generate assgin pattern if chunk imports nothing (#1959)
<!-- Thank you for contributing! --> ### Description <!-- Please insert your description here and provide especially info about the "what" this PR is solving -->
- Loading branch information
Showing
5 changed files
with
62 additions
and
6 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
17 changes: 17 additions & 0 deletions
17
crates/rolldown/tests/rolldown/function/format/cjs/share_chunk_without_symbol/_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,17 @@ | ||
{ | ||
"config": { | ||
"input": [ | ||
{ | ||
"name": "entry1", | ||
"import": "./main.js" | ||
}, | ||
{ | ||
"name": "entry2", | ||
"import": "./main.js" | ||
} | ||
], | ||
"format": "cjs" | ||
}, | ||
"expectExecuted": false, | ||
"hiddenRuntimeModule": false | ||
} |
28 changes: 28 additions & 0 deletions
28
crates/rolldown/tests/rolldown/function/format/cjs/share_chunk_without_symbol/artifacts.snap
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,28 @@ | ||
--- | ||
source: crates/rolldown_testing/src/integration_test.rs | ||
--- | ||
# Assets | ||
|
||
## entry1.cjs | ||
|
||
```js | ||
"use strict"; | ||
require('./main.cjs'); | ||
``` | ||
## entry2.cjs | ||
|
||
```js | ||
"use strict"; | ||
require('./main.cjs'); | ||
``` | ||
## main.cjs | ||
|
||
```js | ||
//#region main.js | ||
console.log("share"); | ||
//#endregion | ||
``` |
1 change: 1 addition & 0 deletions
1
crates/rolldown/tests/rolldown/function/format/cjs/share_chunk_without_symbol/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 @@ | ||
console.log('share') |
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