Skip to content

Commit

Permalink
Merge pull request #112 from LiangCY/4.2.13
Browse files Browse the repository at this point in the history
update version
  • Loading branch information
ascoders authored Feb 8, 2021
2 parents 1e59674 + 6d374cc commit 86a3e08
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pri",
"version": "4.2.12",
"version": "4.2.13",
"types": "src/node/index.ts",
"main": "built/node/index.js",
"scripts": {
Expand Down
10 changes: 4 additions & 6 deletions src/utils/define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,10 @@ export class ProjectInfo {
}

/**
* circle dependence detected config
* circular dependency detect config
*/
interface ICricleDependDetectedConfig {
// is enable detected or not
interface ICircularDetectConfig {
enable?: boolean;
// exlude path for detected: default /node_modules/
exclude?: RegExp;
}

Expand Down Expand Up @@ -303,9 +301,9 @@ export class ProjectConfig {
public entries: IEntryPath;

/**
* circle dependence detected config
* circular dependency detect config
*/
public circleDetected?: ICricleDependDetectedConfig;
public circularDetect?: ICircularDetectConfig;
}

export type SetPipe = (pipeName: string, callback: PipeCallback) => void;
Expand Down
6 changes: 2 additions & 4 deletions src/utils/webpack-dev-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,10 @@ export const runWebpackDevServer = async (opts: IOptions<IExtraOptions>) => {
webpackConfig.plugins.push(new WebpackBar());

// If set open in project config, perform a circular dependency check
if (globalState.projectConfig.circleDetected?.enable === true) {
if (globalState.projectConfig.circularDetect?.enable) {
webpackConfig.plugins.push(
// Add circular dependency plugin
new CircularDependencyPlugin({
// Give priority to the exclude path in the project configuration. If there is no configuration, node_modules will be excluded by default
exclude: globalState.projectConfig.circleDetected?.exclude ?? /node_modules/,
exclude: globalState.projectConfig.circularDetect?.exclude ?? /node_modules/,
cwd: process.cwd(),
}),
);
Expand Down

0 comments on commit 86a3e08

Please sign in to comment.