-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: should generate correct chunk import path to importee in importe…
…r chunk
- Loading branch information
Showing
17 changed files
with
158 additions
and
51 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
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
2 changes: 0 additions & 2 deletions
2
crates/rolldown/tests/fixtures/code_splitting/ensure_side_effect_executed2/_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
18 changes: 18 additions & 0 deletions
18
...xtures/function/entry_filenames/should_generate_correct_relative_import_path/_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,18 @@ | ||
{ | ||
"config": { | ||
"input": [ | ||
{ | ||
"name": "a", | ||
"import": "./a.js" | ||
}, | ||
{ | ||
"name": "b", | ||
"import": "./b.js" | ||
} | ||
], | ||
"entryFilenames": "./entries/[name].mjs", | ||
"chunkFilenames": "./chunks/[name].mjs" | ||
}, | ||
"_comment": "See comments in `crates/rolldown/tests/common/fixture.rs`", | ||
"expectExecuted": false | ||
} |
6 changes: 6 additions & 0 deletions
6
.../fixtures/function/entry_filenames/should_generate_correct_relative_import_path/_test.mjs
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 assert from 'node:assert'; | ||
import { value, asyncValue } from './dist/entries/a.mjs' | ||
import { value as value2, asyncValue as asyncValue2 } from './dist/entries/b.mjs' | ||
|
||
assert.strictEqual(value, value2); | ||
assert.strictEqual(await asyncValue, await asyncValue2); |
2 changes: 2 additions & 0 deletions
2
...tests/fixtures/function/entry_filenames/should_generate_correct_relative_import_path/a.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 } from './shared.js' | ||
export const asyncValue = import('./async.js') |
43 changes: 43 additions & 0 deletions
43
...ures/function/entry_filenames/should_generate_correct_relative_import_path/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,43 @@ | ||
--- | ||
source: crates/rolldown/tests/common/case.rs | ||
expression: content | ||
input_file: crates/rolldown/tests/fixtures/function/entry_filenames/should_generate_correct_relative_import_path | ||
--- | ||
# Assets | ||
|
||
## ./chunks/async.mjs | ||
|
||
```js | ||
// async.js | ||
const value = 'async'; | ||
|
||
export { value }; | ||
``` | ||
## ./chunks/shared.mjs | ||
```js | ||
// shared.js | ||
const value = 'shared'; | ||
|
||
export { value }; | ||
``` | ||
## ./entries/a.mjs | ||
```js | ||
import { value } from "../chunks/shared.mjs"; | ||
|
||
// a.js | ||
const asyncValue = import('../chunks/async.mjs'); | ||
|
||
export { asyncValue, value }; | ||
``` | ||
## ./entries/b.mjs | ||
```js | ||
import { value } from "../chunks/shared.mjs"; | ||
|
||
// b.js | ||
const asyncValue = import('../chunks/async.mjs'); | ||
|
||
export { asyncValue, value }; | ||
``` |
1 change: 1 addition & 0 deletions
1
...s/fixtures/function/entry_filenames/should_generate_correct_relative_import_path/async.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 @@ | ||
export const value = 'async' |
2 changes: 2 additions & 0 deletions
2
...tests/fixtures/function/entry_filenames/should_generate_correct_relative_import_path/b.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 } from './shared.js' | ||
export const asyncValue = import('./async.js') |
1 change: 1 addition & 0 deletions
1
.../fixtures/function/entry_filenames/should_generate_correct_relative_import_path/shared.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 @@ | ||
export const value = 'shared' |
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