@cloudbase/lowcode-builder 1.8.103 → 1.8.104

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -326,6 +326,16 @@ function normalizeInputs(inputs, { envId, getWebRootPath, }) {
326
326
  inputs.deployOptions.targetMpAppId = inputs.deployOptions.mpAppId;
327
327
  }
328
328
  }
329
+ else {
330
+ // web 构建
331
+ const { deployOptions = { mode: types_1.DEPLOY_MODE.PREVIEW } } = inputs;
332
+ if (deployOptions.mode === types_1.DEPLOY_MODE.DYNAMIC) {
333
+ inputs.deployOptions = {
334
+ ...deployOptions,
335
+ mode: types_1.DEPLOY_MODE.PREVIEW,
336
+ };
337
+ }
338
+ }
329
339
  if (extraData.isComposite) {
330
340
  Object.keys(extraData.compProps.events).forEach((eName) => {
331
341
  extraData.compProps.events[eName] = `$$EVENT_${eName}$$`;
@@ -53,7 +53,7 @@ if (!process.env.IS_WEB_WORKER) {
53
53
  async function buildH5App({ buildContext, i18nConfig, extraData, cals: _cals, buildTypeList = [common_1.BuildType.WEB], subAppCalsList, mode, devTool, runtime = types_1.RUNTIME.NONE, deployOptions = { mode: types_1.DEPLOY_MODE.PREVIEW }, ignoreInstall = false, cdnEndpoints, }) {
54
54
  var _a, _b, _c, _d, _e, _f;
55
55
  const { projDir: buildDir, domain, materialLibs: dependencies, appId: appKey, isPrivateMode, enableExpiredTag, privatelinkConfig, } = buildContext;
56
- if (!deployOptions.mode) {
56
+ if (!deployOptions.mode || deployOptions.mode === types_1.DEPLOY_MODE.DYNAMIC) {
57
57
  deployOptions.mode = types_1.DEPLOY_MODE.PREVIEW;
58
58
  }
59
59
  try {
@@ -124,7 +124,7 @@ async function buildH5App({ buildContext, i18nConfig, extraData, cals: _cals, bu
124
124
  buildTypeList,
125
125
  isSandbox: false,
126
126
  runtime,
127
- deployOptions,
127
+ deployOptions: deployOptions,
128
128
  _indexPage,
129
129
  isPrivateMode,
130
130
  expirationStartTimesnap: enableExpiredTag ? Date.now() : undefined,
@@ -249,6 +249,7 @@ async function generateWxMp({ buildContext: _buildContext, weapps, calses, deplo
249
249
  appID: appId,
250
250
  resourceAppid: !!options.isCrossAccount ? options.resourceAppId : '',
251
251
  isProd: (deployOptions === null || deployOptions === void 0 ? void 0 : deployOptions.mode) === types_1.DEPLOY_MODE.UPLOAD,
252
+ deployMode: deployOptions === null || deployOptions === void 0 ? void 0 : deployOptions.mode,
252
253
  clientID: ((_g = mainAppData.extra) === null || _g === void 0 ? void 0 : _g.enableLoginStatusShare)
253
254
  ? mainAppData.envId
254
255
  : (_h = mainAppData.extra) === null || _h === void 0 ? void 0 : _h.clientId,
@@ -692,7 +693,6 @@ async function generateFramework(ctx, { cals, weapp: appData }, outDir, options)
692
693
  label: (appData === null || appData === void 0 ? void 0 : appData.label) || '',
693
694
  version: (_a = options === null || options === void 0 ? void 0 : options.deployOptions) === null || _a === void 0 ? void 0 : _a.version,
694
695
  envId: appData.envId,
695
- envVersion: (ctx === null || ctx === void 0 ? void 0 : ctx.isProduction) ? 'production' : 'preview',
696
696
  loginConfigVersion: (_b = cals.extra) === null || _b === void 0 ? void 0 : _b.loginConfigVersion,
697
697
  basename: ctx.wedaRoot,
698
698
  pages: appData.pageInstanceList
@@ -25,7 +25,7 @@ async function writeCode2file(ctx, mod, lowcodeRootDir, opts = {}, themeCode, ex
25
25
  // Generate app lowcode
26
26
  const baseDir = path_1.default.relative(path_1.default.dirname(file), appDir).replace(/\\/g, '/');
27
27
  // 子包混合模式需要添加相对索引到根目录
28
- const relativeRoot = (ctx === null || ctx === void 0 ? void 0 : ctx.isMixMode) && ctx.rootPath ? `${path_1.default.relative(`packages/${ctx.rootPath}`, '')}/` : '';
28
+ const relativeRoot = (ctx === null || ctx === void 0 ? void 0 : ctx.isMixMode) && ctx.rootPath ? `${path_1.default.posix.relative(`packages/${ctx.rootPath}`, '')}/` : '';
29
29
  let weappsApiPrefix = externalAPIImport
30
30
  ? importFromClientSDK(pageId === 'global')
31
31
  : [`import { app, $app${pageId !== 'global' ? '' : ', $w'} } from '${relativeRoot}${baseDir}/app/weapps-api';`]; // windows compatibility