How to build multiple entries with different targets #1565
Answered
by
chenjiahan
longht021189
asked this question in
Q&A
-
I'd like to build multiple entries with:
But Rsbuild only provides multiple targets in output. |
Beta Was this translation helpful? Give feedback.
Answered by
chenjiahan
Feb 14, 2024
Replies: 1 comment 1 reply
-
You can use tools.rspack to set different entries or aliases for different targets. We will support this feature in the Rsbuild configuration later. export default defineConfig({
output: {
targets: ['web', 'node']
},
tools: {
rspack(config, { target }) {
if (target === 'web') {
config.entry = {};
config.resolve!.alias = {};
} else {
// ...
}
}
}
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
longht021189
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use tools.rspack to set different entries or aliases for different targets. We will support this feature in the Rsbuild configuration later.