Skip to content

Commit 7995320

Browse files
author
chengyu.chengyulia
committed
fix: circular detect exclude
1 parent 0df42bf commit 7995320

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/utils/define.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class ProjectInfo {
7979
*/
8080
interface ICircularDetectConfig {
8181
enable?: boolean;
82-
exclude?: RegExp;
82+
exclude?: string;
8383
}
8484

8585
/**

src/utils/webpack-dev-server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ export const runWebpackDevServer = async (opts: IOptions<IExtraOptions>) => {
5454

5555
// If set open in project config, perform a circular dependency check
5656
if (globalState.projectConfig.circularDetect?.enable) {
57+
const exclude = globalState.projectConfig.circularDetect?.exclude;
5758
webpackConfig.plugins.push(
5859
new CircularDependencyPlugin({
59-
exclude: globalState.projectConfig.circularDetect?.exclude ?? /node_modules/,
60+
exclude: exclude ? new RegExp(exclude) : /node_modules/,
6061
cwd: process.cwd(),
6162
}),
6263
);

0 commit comments

Comments
 (0)