From 254d31daea5b30c8174d6e4cfb8bcc0321fa4b36 Mon Sep 17 00:00:00 2001 From: Yunfei He Date: Mon, 11 Sep 2023 17:04:46 +0800 Subject: [PATCH] feat(config): warn while using `experiments.newSplitChunks` (#4169) --- packages/rspack/src/config/zod.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/rspack/src/config/zod.ts b/packages/rspack/src/config/zod.ts index b3e4ec53103..afb8ee3a64c 100644 --- a/packages/rspack/src/config/zod.ts +++ b/packages/rspack/src/config/zod.ts @@ -960,7 +960,15 @@ const experiments = z.strictObject({ incrementalRebuild: z.boolean().or(incrementalRebuildOptions).optional(), asyncWebAssembly: z.boolean().optional(), outputModule: z.boolean().optional(), - newSplitChunks: z.boolean().optional(), + newSplitChunks: z + .boolean() + .optional() + .refine(_ => { + console.warn( + "`experiments.newSplitChunks` will be removed at 0.4.0. See details at https://github.com/web-infra-dev/rspack/discussions/4168" + ); + return true; + }), css: z.boolean().optional(), futureDefaults: z.boolean().optional(), rspackFuture: rspackFutureOptions.optional()