Skip to content

Commit

Permalink
test(rust/esbuild): enable export_other_nested_common_js case.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cecil0o0 committed May 26, 2024
1 parent 67f908a commit e542b25
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"input": {
"config": {
"input": [
{
"name": "entry_js",
"import": "entry.js"
}
]
],
"format": "cjs"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
source: crates/rolldown/tests/common/case.rs
expression: content
input_file: crates/rolldown/tests/esbuild/import_star/export_other_common_js
---
# Assets

## entry_js.cjs

```js
const { __commonJSMin, __toESM } = require("./$runtime$.cjs");
// foo.js
var require_foo = __commonJSMin((exports, module) => {
exports.foo = 123;
});
// entry.js
var import_foo = __toESM(require_foo());
exports.bar = import_foo.bar;;
```
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"input": {
"config": {
"input": [
{
"name": "entry_js",
"import": "entry.js"
}
]
],
"format": "cjs"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
source: crates/rolldown/tests/common/case.rs
expression: content
input_file: crates/rolldown/tests/esbuild/import_star/export_other_nested_common_js
---
# Assets

## entry_js.cjs

```js
const { __commonJSMin, __toESM } = require("./$runtime$.cjs");
// foo.js
var require_foo = __commonJSMin((exports, module) => {
exports.foo = 123;
});
// bar.js
var import_foo = __toESM(require_foo());
exports.y = import_foo.x;;
```
10 changes: 10 additions & 0 deletions crates/rolldown/tests/snapshots/fixtures__filename_with_hash.snap
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,16 @@ expression: "snapshot_outputs.join(\"\\n\")"
- $runtime$-!~{001}~.cjs => $runtime$-r1VW0EHT.cjs
- entry_js-!~{000}~.cjs => entry_js-9V0NuFff.cjs

# tests/esbuild/import_star/export_other_common_js

- $runtime$-!~{001}~.cjs => $runtime$-r1VW0EHT.cjs
- entry_js-!~{000}~.cjs => entry_js-Py4UDEQS.cjs

# tests/esbuild/import_star/export_other_nested_common_js

- $runtime$-!~{001}~.cjs => $runtime$-r1VW0EHT.cjs
- entry_js-!~{000}~.cjs => entry_js-ChHWKU2T.cjs

# tests/esbuild/import_star/export_self_as_namespace_common_js

- $runtime$-!~{001}~.cjs => $runtime$-ffpSX9w6.cjs
Expand Down

0 comments on commit e542b25

Please sign in to comment.