Skip to content

Commit 92bd251

Browse files
committed
perf(mp): 只允许微信小程序处理子包插件 export 字段
1 parent 1a7f3be commit 92bd251

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/uni-mp-vite/src/plugin/build.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,12 @@ function parseRollupInput(inputDir: string, platform: UniApp.PLATFORM) {
174174
if (process.env.UNI_MP_PLUGIN) {
175175
return inputOptions
176176
}
177-
const pluginExports = getSubpackagePluginExports(inputDir)
178-
Object.keys(pluginExports).forEach((exportPath) => {
179-
inputOptions[exportPath] = pluginExports[exportPath]
180-
})
177+
if (platform === 'mp-weixin') {
178+
const pluginExports = getSubpackagePluginExports(inputDir)
179+
Object.keys(pluginExports).forEach((exportPath) => {
180+
inputOptions[exportPath] = pluginExports[exportPath]
181+
})
182+
}
181183
const manifestJson = parseManifestJsonOnce(inputDir)
182184
const plugins = manifestJson[platform]?.plugins || {}
183185
Object.keys(plugins).forEach((name) => {

0 commit comments

Comments
 (0)