File tree 2 files changed +33
-1
lines changed
2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -502,6 +502,8 @@ export function composeDecoratorsConfig(
502
502
}
503
503
504
504
export async function createConstantRsbuildConfig ( ) : Promise < EnvironmentConfig > {
505
+ // When the default configuration is inconsistent with rsbuild, remember to modify the type hints
506
+ // see https://github.com/web-infra-dev/rslib/discussions/856
505
507
return defineRsbuildConfig ( {
506
508
dev : {
507
509
progressBar : false ,
Original file line number Diff line number Diff line change 1
- import type { EnvironmentConfig , RsbuildConfig , Rspack } from '@rsbuild/core' ;
1
+ import type {
2
+ EnvironmentConfig ,
3
+ OutputConfig ,
4
+ RsbuildConfig ,
5
+ Rspack ,
6
+ } from '@rsbuild/core' ;
2
7
import type { GetAsyncFunctionFromUnion } from './utils' ;
3
8
4
9
export type Format = 'esm' | 'cjs' | 'umd' | 'mf' ;
@@ -303,8 +308,33 @@ export interface LibConfig extends EnvironmentConfig {
303
308
304
309
export type LibOnlyConfig = Omit < LibConfig , keyof EnvironmentConfig > ;
305
310
311
+ interface RslibOutputConfig extends OutputConfig {
312
+ /**
313
+ * @override
314
+ * @default 'node'
315
+ */
316
+ target ?: OutputConfig [ 'target' ] ;
317
+ /**
318
+ * @override
319
+ * @default false
320
+ */
321
+ filenameHash ?: OutputConfig [ 'filenameHash' ] ;
322
+ /**
323
+ * @override
324
+ * When minify is not specified, Rslib will use a sane default for minify options.
325
+ * The default options will only perform dead code elimination and unused code elimination.
326
+ *
327
+ * detail: {@link https://lib.rsbuild.dev/config/rsbuild/output#outputminify rsbuild-outputminify}
328
+ */
329
+ minify ?: OutputConfig [ 'minify' ] ;
330
+ }
331
+
306
332
export interface RslibConfig extends RsbuildConfig {
307
333
lib : LibConfig [ ] ;
334
+ /**
335
+ * @inheritdoc
336
+ */
337
+ output ?: RslibOutputConfig ;
308
338
}
309
339
310
340
export type ConfigParams = {
You can’t perform that action at this time.
0 commit comments