Thanks to visit codestin.com
Credit goes to github.com

Skip to content

File tree

crates/rolldown/src/utils/chunk/render_chunk_exports.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ pub fn render_chunk_exports(
126126
}
127127
Some(OutputExports::Default) => {
128128
if matches!(options.format, OutputFormat::Cjs) {
129-
concat_string!("module.exports = ", canonical_name.as_str(), ";")
129+
concat_string!("module.exports = ", exported_value.as_str(), ";")
130130
} else {
131-
concat_string!("return ", canonical_name.as_str(), ";")
131+
concat_string!("return ", exported_value.as_str(), ";")
132132
}
133133
}
134134
Some(OutputExports::None) => String::new(),
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"config": {
3+
"format": "cjs",
4+
"platform": "node"
5+
}
6+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
source: crates/rolldown_testing/src/integration_test.rs
3+
snapshot_kind: text
4+
---
5+
# Assets
6+
7+
## main.js
8+
9+
```js
10+
"use strict";
11+
12+
const node_path = __toESM(require("node:path"));
13+
14+
module.exports = node_path.default;
15+
```
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import path from 'node:path';
2+
export { path as default };
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"config": {
3+
"format": "cjs",
4+
"platform": "node"
5+
}
6+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
source: crates/rolldown_testing/src/integration_test.rs
3+
snapshot_kind: text
4+
---
5+
# Assets
6+
7+
## main.js
8+
9+
```js
10+
"use strict";
11+
12+
const node_path = __toESM(require("node:path"));
13+
14+
module.exports = node_path.default;
15+
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from 'node:path';

crates/rolldown/tests/snapshots/integration_rolldown__filename_with_hash.snap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4501,6 +4501,14 @@ snapshot_kind: text
45014501
- main2-!~{001}~.js => main2-EKxH9I8y.js
45024502
- chunk-!~{002}~.js => chunk-CrpGerW8.js
45034503
4504+
# tests/rolldown/issues/2903_2
4505+
4506+
- main-!~{000}~.js => main-BcrDU5fs.js
4507+
4508+
# tests/rolldown/issues/2903_3
4509+
4510+
- main-!~{000}~.js => main-BcrDU5fs.js
4511+
45044512
# tests/rolldown/issues/376
45054513
45064514
- main-!~{000}~.js => main-CfuHZZW7.js

0 commit comments

Comments
 (0)