-
Notifications
You must be signed in to change notification settings - Fork 503
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
84 additions
and
18 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
37 changes: 37 additions & 0 deletions
37
crates/rolldown/tests/esbuild/default/common_js_from_es6/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,37 @@ | ||
--- | ||
source: crates/rolldown/tests/common/case.rs | ||
expression: content | ||
input_file: crates/rolldown/tests/esbuild/default/common_js_from_es6 | ||
--- | ||
# main.js | ||
|
||
```js | ||
// bar.js | ||
function bar$1() { | ||
return 'bar' | ||
} | ||
var bar_ns = { | ||
get bar() { return bar$1 } | ||
}; | ||
var init_bar = __esm({ | ||
'bar.js'() { | ||
|
||
} | ||
}); | ||
// foo.js | ||
function foo$1() { | ||
return 'foo' | ||
} | ||
var foo_ns = { | ||
get foo() { return foo$1 } | ||
}; | ||
var init_foo = __esm({ | ||
'foo.js'() { | ||
|
||
} | ||
}); | ||
// main.js | ||
const {foo} = (init_foo(), __toCommonJS(foo_ns)) | ||
console.log(foo(), bar()) | ||
const {bar} = (init_bar(), __toCommonJS(bar_ns)) // This should not be hoisted | ||
``` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions
20
crates/rolldown/tests/esbuild/default/simple_common_js/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,20 @@ | ||
--- | ||
source: crates/rolldown/tests/common/case.rs | ||
expression: content | ||
input_file: crates/rolldown/tests/esbuild/default/simple_common_js | ||
--- | ||
# main.js | ||
|
||
```js | ||
// foo.js | ||
var require_foo = __commonJS({ | ||
'foo.js'(exports, module) { | ||
module.exports = function() { | ||
return 123 | ||
} | ||
} | ||
}); | ||
// main.js | ||
const fn = require_foo() | ||
console.log(fn()) | ||
``` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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