Skip to content

Commit 5a2f608

Browse files
zhengyanan18zhengyanan1
authored andcommitted
fix: command为空时(Taro项目外的taro命令,去掉所有build阶段加载的全局插件)
1 parent ade74d4 commit 5a2f608

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/taro-service/src/utils/index.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,18 @@ export function printHelpLog (command, optionsList: Map<string, string>, synopsi
118118
}
119119
}
120120

121+
const ExcludePluginTagsForNullCommand = ['@jdtaro/plugin-build-']
121122
export function filterGlobalConfig (globalConfig: IProjectConfig, command: string) {
123+
const config = globalConfig
124+
122125
if (!command) {
123-
return globalConfig
126+
if (config.plugins?.length) {
127+
config.plugins = config.plugins.filter(pluginName => {
128+
return !ExcludePluginTagsForNullCommand.some(tag => pluginName.includes(tag))
129+
})
130+
}
131+
return config
124132
}
125-
const config = globalConfig
126133

127134
const RelatedPluginTag = `@jdtaro/plugin-${command}-`
128135
if (config.plugins?.length) {

0 commit comments

Comments
 (0)