We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f38b2ca commit ed9c835Copy full SHA for ed9c835
packages/uni-mp-vite/src/plugin/build.ts
@@ -218,6 +218,16 @@ function createMoveToVendorChunkFn(): GetManualChunk | undefined {
218
// 处理资源文件
219
if (DEFAULT_ASSETS_RE.test(filename)) {
220
debugChunk('common/assets', normalizedId)
221
+ const { subPackages } = getSubPackages()
222
+ if (subPackages.length) {
223
+ const relativePath = normalizePath(path.relative(inputDir, filename))
224
+ const subPackageRoot = subPackages.find((subPackage) =>
225
+ relativePath.startsWith(subPackage)
226
+ )
227
+ if (subPackageRoot) {
228
+ return subPackageRoot + 'common/assets'
229
+ }
230
231
return 'common/assets'
232
}
233
// 处理项目内的js,ts文件
0 commit comments