brk_rolldown 0.8.0

Fast JavaScript bundler in Rust, designed for the future of Vite
Documentation
---
source: crates/rolldown_testing/src/integration_test.rs
---
# Assets

## imp.js

```js
// HIDDEN [rolldown:runtime]
//#region imp.js
var imp_exports = /* @__PURE__ */ __exportAll({
	imp2: () => imp2,
	imp22: () => imp22
});
const imp2 = 2;
const imp22 = 22;

//#endregion
export { imp22 as n, imp_exports as r, imp2 as t };
```

## main.js

```js
import { n as imp22, t as imp2 } from "./imp.js";
import assert from "node:assert";

//#region main.js
assert.strictEqual(imp2, 2);
assert.strictEqual(imp22, 22);
const load = async () => {
	import("./imp.js").then((n) => n.r).then((m) => {
		assert.strictEqual(m.imp22, 22);
	});
};
load();

//#endregion
```

# Variant: [format: Cjs]

## Assets

### imp2.js

```js
const require_rolldown_runtime = require('./rolldown-runtime.js');

//#region imp.js
var imp_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
	imp2: () => imp2,
	imp22: () => imp22
});
const imp2 = 2;
const imp22 = 22;

//#endregion
Object.defineProperty(exports, 'imp2', {
  enumerable: true,
  get: function () {
    return imp2;
  }
});
Object.defineProperty(exports, 'imp22', {
  enumerable: true,
  get: function () {
    return imp22;
  }
});
Object.defineProperty(exports, 'imp_exports', {
  enumerable: true,
  get: function () {
    return imp_exports;
  }
});
```

### main.js

```js
const require_rolldown_runtime = require('./rolldown-runtime.js');
const require_imp = require('./imp2.js');
let node_assert = require("node:assert");
node_assert = require_rolldown_runtime.__toESM(node_assert);

//#region main.js
node_assert.default.strictEqual(require_imp.imp2, 2);
node_assert.default.strictEqual(require_imp.imp22, 22);
const load = async () => {
	Promise.resolve().then(() => require("./imp2.js")).then((n) => n.imp_exports).then((m) => {
		node_assert.default.strictEqual(m.imp22, 22);
	});
};
load();

//#endregion
```

### rolldown-runtime.js

```js
// HIDDEN [rolldown:runtime]

Object.defineProperty(exports, '__exportAll', {
  enumerable: true,
  get: function () {
    return __exportAll;
  }
});
Object.defineProperty(exports, '__toESM', {
  enumerable: true,
  get: function () {
    return __toESM;
  }
});
```