How to configure a lib with multiple targets? #703
-
Example would be this setup of a Rspress plugin where they have
But they are using Modern.js instead. Can Rslib be configured this way, considering that |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Sure, just modify // rslib.config.ts
import { defineConfig } from '@rslib/core';
export default defineConfig({
lib: [
{
format: 'esm',
output: {
target: 'web',
},
},
{
format: 'esm',
output: {
target: 'node',
},
},
],
}); |
Beta Was this translation helpful? Give feedback.
-
You could check the migrated Rslib config of the case you provided. https://github.com/web-infra-dev/rspress/pull/1770/files#diff-605f1ec46dc20df4ee9c502cd9c8b342db2c6ec5b3d7dd40b0fc8aad00fc0673R4-R57 |
Beta Was this translation helpful? Give feedback.
-
Thank you for the quick responses! |
Beta Was this translation helpful? Give feedback.
Sure, just modify
target
in each item oflib
array.