File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -502,6 +502,8 @@ export function composeDecoratorsConfig(
502502}
503503
504504export 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
505507 return defineRsbuildConfig ( {
506508 dev : {
507509 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' ;
27import type { GetAsyncFunctionFromUnion } from './utils' ;
38
49export type Format = 'esm' | 'cjs' | 'umd' | 'mf' ;
@@ -299,12 +304,41 @@ export interface LibConfig extends EnvironmentConfig {
299304 * @see {@link https://lib.rsbuild.dev/config/lib/out-base }
300305 */
301306 outBase ?: string ;
307+ /**
308+ * @inheritdoc
309+ */
310+ output ?: RslibOutputConfig ;
302311}
303312
304313export type LibOnlyConfig = Omit < LibConfig , keyof EnvironmentConfig > ;
305314
315+ interface RslibOutputConfig extends OutputConfig {
316+ /**
317+ * @override
318+ * @default 'node'
319+ */
320+ target ?: OutputConfig [ 'target' ] ;
321+ /**
322+ * @override
323+ * @default false
324+ */
325+ filenameHash ?: OutputConfig [ 'filenameHash' ] ;
326+ /**
327+ * @override
328+ * When minify is not specified, Rslib will use a sane default for minify options.
329+ * The default options will only perform dead code elimination and unused code elimination.
330+ *
331+ * @see {@link https://lib.rsbuild.dev/config/rsbuild/output#outputminify }
332+ */
333+ minify ?: OutputConfig [ 'minify' ] ;
334+ }
335+
306336export interface RslibConfig extends RsbuildConfig {
307337 lib : LibConfig [ ] ;
338+ /**
339+ * @inheritdoc
340+ */
341+ output ?: RslibOutputConfig ;
308342}
309343
310344export type ConfigParams = {
You can’t perform that action at this time.
0 commit comments