Skip to content

Commit bc2eb53

Browse files
author
zhisai.szs
committed
fix: excludeRootDepList
1 parent 9815353 commit bc2eb53

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pri",
3-
"version": "4.3.17",
3+
"version": "4.3.18",
44
"types": "src/node/index.ts",
55
"main": "built/node/index.js",
66
"scripts": {

src/built-in-plugins/command-publish/plugin/run-publish.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,9 @@ async function addMissingDeps(
427427
};
428428
}
429429

430+
// Exclude root dep list
431+
const excludeRootDepList = pri.projectConfig.publishConfig?.excludeRootDepList || ['react', 'react-dom', 'antd'];
432+
430433
if (depMap) {
431434
const { depMonoPackages, depNpmPackages } = depMap.get(sourceType);
432435

@@ -474,7 +477,7 @@ async function addMissingDeps(
474477
newPackageJson.dependencies = {
475478
...newPackageJson.dependencies,
476479
...depNpmPackages
477-
.filter(npmName => !['react', 'react-dom', 'antd'].includes(npmName))
480+
.filter(npmName => !excludeRootDepList.includes(npmName))
478481
.reduce((root, next) => {
479482
if (!sourceDeps[next]) {
480483
logFatal(

src/utils/define.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,4 +405,6 @@ export type IAfterTestRun = (result?: any) => any;
405405
export interface IPublishConfig {
406406
// Allow publish branch
407407
publishBranch?: string;
408+
// Exclude root dep list
409+
excludeRootDepList?: string[];
408410
}

0 commit comments

Comments
 (0)