Skip to content

Commit 1f976e0

Browse files
author
wfc
committed
feat: output target
1 parent 9ce2302 commit 1f976e0

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

config/rslib-config/src/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { defineConfig, LibConfig } from '@rslib/core';
1+
import {
2+
defineConfig,
3+
LibConfig,
4+
RsbuildConfigOutputTarget,
5+
} from '@rslib/core';
26

37
type LibFormat = LibConfig['format'];
48
export type BundleType = boolean | 'excludeExternal';
@@ -8,14 +12,16 @@ interface Options {
812
bundle?: BundleType;
913
tsconfigPath?: string;
1014
umdName?: string;
15+
target?: RsbuildConfigOutputTarget;
1116
}
1217
const defaultOptions = {
1318
format: ['esm', 'cjs'] as LibFormat[],
1419
bundle: true,
20+
target: 'web' as RsbuildConfigOutputTarget,
1521
};
1622

1723
function getRslibConfig(options: Options) {
18-
const { format, bundle, umdName, tsconfigPath } = {
24+
const { format, bundle, umdName, tsconfigPath, target } = {
1925
...defaultOptions,
2026
...options,
2127
};
@@ -43,7 +49,7 @@ function getRslibConfig(options: Options) {
4349
tsconfigPath,
4450
},
4551
output: {
46-
target: 'web',
52+
target,
4753
},
4854
lib: libs,
4955
});

0 commit comments

Comments
 (0)