Skip to content

Commit f2d3a30

Browse files
committed
feat(): new option: oneOfRulesForBabel
1 parent 1bd10b5 commit f2d3a30

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

packages/build-next-bricks/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export interface BuildNextBricksConfig {
8989
imageAssetFilename?: string | ((pathData: any, assetInfo: any) => string);
9090
plugins?: Configuration["plugins"];
9191
moduleRules?: RuleSetRule[];
92+
oneOfRulesForBabel?: RuleSetRule[];
9293
resolve?: ResolveOptions;
9394
exposes?: ConstructorParameters<
9495
typeof container.ModuleFederationPlugin

packages/build-next-bricks/src/build.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,17 @@ async function getWebpackConfig(config) {
358358
],
359359
},
360360
{
361-
test: /\.[tj]sx?$/,
362-
loader: "babel-loader",
363-
exclude: /node_modules|\.d\.ts$/,
364-
options: {
365-
rootMode: "upward",
366-
},
361+
oneOf: [
362+
...(config.oneOfRulesForBabel ?? []),
363+
{
364+
test: /\.[tj]sx?$/,
365+
loader: "babel-loader",
366+
exclude: /node_modules|\.d\.ts$/,
367+
options: {
368+
rootMode: "upward",
369+
},
370+
},
371+
],
367372
},
368373
{
369374
// Images

0 commit comments

Comments
 (0)