Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/core/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,11 @@ const composeFormatConfig = ({
// experimentalEsmOutput don't need concatenateModules
concatenateModules: !experimentalEsmOutput,
sideEffects: experimentalEsmOutput ? true : 'flag',
runtimeChunk: experimentalEsmOutput ? 'single' : undefined,
runtimeChunk: experimentalEsmOutput
? {
name: 'rslib-runtime',
}
: undefined,
avoidEntryIife: true,
splitChunks: {
// Splitted "sync" chunks will make entry modules can't be inlined.
Expand Down
4 changes: 3 additions & 1 deletion packages/core/tests/__snapshots__/config.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,9 @@ exports[`Should compose create Rsbuild config correctly > Enable experiment.adva
nodeEnv: false,
concatenateModules: false,
sideEffects: true,
runtimeChunk: 'single',
runtimeChunk: {
name: 'rslib-runtime'
},
avoidEntryIife: true
},
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/resolve/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test('resolve false', async () => {
expect(isSuccess).toBeTruthy();
if (process.env.ADVANCED_ESM) {
expect(entries.esm).toMatchInlineSnapshot(`
"import { __webpack_require__ } from "./runtime.js";
"import { __webpack_require__ } from "./rslib-runtime.js";
__webpack_require__.add({
"?b5d4": function() {}
});
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/style/css-modules-named/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test('should extract css-modules named export successfully in bundle', async ()
`);
if (process.env.ADVANCED_ESM) {
expect(js.entries.esm).toMatchInlineSnapshot(`
"import "./runtime.js";
"import "./rslib-runtime.js";
var _1 = "content-wrapper-iNtwbA";
const src_button = _1;
export { src_button as button };
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/vue/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe.runIf(platform() !== 'win32')('ESM', async () => {
if (process.env.ADVANCED_ESM) {
expect(js.contents.esm1).toMatchInlineSnapshot(`
{
"<ROOT>/tests/integration/vue/dist/bundle/index.js": "import "./runtime.js";
"<ROOT>/tests/integration/vue/dist/bundle/index.js": "import "./rslib-runtime.js";
import { createElementBlock, openBlock, ref, toDisplayString } from "vue";
const _00_2Fplugin_vue_2Fexport_helper = (sfc, props)=>{
const target = sfc.__vccOpts || sfc;
Expand Down Expand Up @@ -87,7 +87,7 @@ describe.runIf(platform() !== 'win32')('ESM', async () => {
]);
export { Button, Card };
",
"<ROOT>/tests/integration/vue/dist/bundle/runtime.js": "var __webpack_modules__ = {};
"<ROOT>/tests/integration/vue/dist/bundle/rslib-runtime.js": "var __webpack_modules__ = {};
var __webpack_module_cache__ = {};
function __webpack_require__(moduleId) {
var cachedModule = __webpack_module_cache__[moduleId];
Expand Down
Loading