Skip to content

Commit 387b5d9

Browse files
authored
Merge pull request #4870 from easyops-cn/fix/brick-container-bootstrap-mini-path
fix(brick-container): 支持 bootstrap-mini 路径识别并防御 templatePackages 为空
2 parents 64b8c5e + 56c3114 commit 387b5d9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/brick-container/serve/getProxies.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,13 @@ module.exports = (env, getRawIndexHtml) => {
120120

121121
const unionRegex =
122122
/^\/next\/sa-static\/.*\/bootstrap-union\.[^.]+\.json$/;
123+
const isBootstrapMini =
124+
/^\/next\/sa-static\/.*\/bootstrap-mini\.[^.]+\.json$/.test(req.path);
123125
if (
124126
regex.test(req.path) ||
125127
regexLegacy.test(req.path) ||
126-
unionRegex.test(req.path)
128+
unionRegex.test(req.path) ||
129+
isBootstrapMini
127130
) {
128131
reqIsBootstrap = true;
129132
isStandalone = true;
@@ -238,7 +241,7 @@ module.exports = (env, getRawIndexHtml) => {
238241
.map((id) => getSingleTemplatePackage(env, id))
239242
.filter(Boolean)
240243
.concat(
241-
data[templatePackages].filter(
244+
(data[templatePackages] || []).filter(
242245
(item) =>
243246
!localTemplates.includes(item.filePath.split("/")[1])
244247
)

0 commit comments

Comments
 (0)