@cloudbase/lowcode-builder 1.8.44-alpha.2 → 1.8.45-alpha.0
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.
- package/dist/builder.web.js +1 -1
- package/lib/builder/h5/index.js +6 -2
- package/lib/builder/mp/index.js +1 -0
- package/lib/builder.web.js +1 -1
- package/lib/utils/transform.d.ts +1 -1
- package/lib/utils/transform.js +63 -69
- package/package.json +4 -3
- package/template/mp/common/util.js +11 -3
- package/template/mp/page/api.js +2 -1
package/lib/builder/h5/index.js
CHANGED
|
@@ -45,7 +45,11 @@ const config_1 = require("../config");
|
|
|
45
45
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
46
46
|
const junk = __importStar(require("../util/junk"));
|
|
47
47
|
const url_1 = require("url");
|
|
48
|
-
|
|
48
|
+
let BabelTransform = (code, options) => code;
|
|
49
|
+
if (!process.env.IS_WEB_WORKER) {
|
|
50
|
+
let transform = require('../../utils/transform');
|
|
51
|
+
BabelTransform = transform.BabelTransform;
|
|
52
|
+
}
|
|
49
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, }) {
|
|
50
54
|
var _a, _b, _c;
|
|
51
55
|
const { projDir: buildDir, domain, materialLibs: dependencies, appId: appKey, isPrivateMode, enableExpiredTag, } = buildContext;
|
|
@@ -246,7 +250,7 @@ function _BabelTransformCalsExpression(key, value) {
|
|
|
246
250
|
value = value.replace(FOR_IN_REG, '');
|
|
247
251
|
}
|
|
248
252
|
}
|
|
249
|
-
value =
|
|
253
|
+
value = BabelTransform(value, { IIFE: true });
|
|
250
254
|
if (forPrefix) {
|
|
251
255
|
value = `${forPrefix}${value}`;
|
|
252
256
|
}
|
package/lib/builder/mp/index.js
CHANGED
|
@@ -347,6 +347,7 @@ async function generatePkg(ctx, weapp, appRoot, pageConfigs) {
|
|
|
347
347
|
const pageFileData = {
|
|
348
348
|
[`api.js|api.js`]: {
|
|
349
349
|
subLevelPath: rootPath ? `${path_1.default.posix.relative(rootPath, '')}/` : '',
|
|
350
|
+
packageName: rootPath || '',
|
|
350
351
|
uuid: rootPath ? `${rootPath}/${page.id}` : page.id,
|
|
351
352
|
label: ((_b = (_a = page === null || page === void 0 ? void 0 : page.data) === null || _a === void 0 ? void 0 : _a.navigationBarTitleText) === null || _b === void 0 ? void 0 : _b.value) || ((_d = (_c = page === null || page === void 0 ? void 0 : page.data) === null || _c === void 0 ? void 0 : _c.title) === null || _d === void 0 ? void 0 : _d.value),
|
|
352
353
|
},
|