Open SoonIter opened 2 weeks ago
I have an idea to refactor rspress to use only one rsbuild instance to solve this issue and get the better performance (maybe).
just like
// rsbuild.config.ts
export default {
source: {
entry({ target }) {
if (target === 'web') {
return {
index: './src/index.client.js',
};
}
if (target === 'node') {
return {
index: './src/index.server.js',
};
}
},
},
tools: {
rspack(options, { env }) {
if (env === 'node') {
options.output.filename = 'main.cjs';
}
},
},
output: {
targets: ['web', 'node'],
}
};
Version
Details
when running
DEBUG=rsbuild rsbuild build
under the rsbuild project withoutput.targets = ['web', 'node']
when running
DEBUG=rsbuild rspress build
and
/demo/rspack.config.node.mjs
will be deletedrelated to https://rspress.dev/api/config/config-build#default-config
For better DEBUG mode under rspress, this part of the code https://github.com/web-infra-dev/rspress/blob/150f770aaa3a02407af3ac3e25f0df36ddc4ac59/packages/shared/src/runtime-utils/index.ts#L24 needs to be refactored.
Reproduce link
rspress/e2e/title-suffix
Reproduce Steps
clone the rspress repo
DEBUG=rsbuild rspress build