Skip to content

Commit e50afa9

Browse files
committed
fix: global默认不进行pollyfill,兼容quickjs
Signed-off-by: lilei946 <[email protected]>
1 parent 28bd33c commit e50afa9

File tree

2 files changed

+4
-11
lines changed
  • __tests__/examples/build-backup/sample
  • packages/hap-toolkit/src/gen-webpack-conf

2 files changed

+4
-11
lines changed

__tests__/examples/build-backup/sample/app.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@
465465
},
466466
"./src/regenerator.js": (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
467467
"use strict";
468-
const injectRef = Object.getPrototypeOf(__webpack_require__.g) || __webpack_require__.g;
468+
const injectRef = Object.getPrototypeOf(global) || global;
469469
injectRef.regeneratorRuntime = __webpack_require__("./node_modules/@babel/runtime/regenerator/index.js");
470470
},
471471
"./node_modules/@babel/runtime/helpers/regeneratorRuntime.js": (module, __unused_webpack_exports, __webpack_require__) => {
@@ -831,16 +831,6 @@
831831
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
832832
return module.exports;
833833
}
834-
(() => {
835-
__webpack_require__.g = function() {
836-
if (typeof globalThis === "object") return globalThis;
837-
try {
838-
return this || new Function("return this")();
839-
} catch (e) {
840-
if (typeof window === "object") return window;
841-
}
842-
}();
843-
})();
844834
var __webpack_exports__ = {};
845835
(() => {
846836
var $app_style$ = {};

packages/hap-toolkit/src/gen-webpack-conf/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ export default async function genWebpackConf(launchOptions, mode) {
225225
}) && !isCard
226226

227227
const webpackConf = {
228+
node: {
229+
global: false
230+
},
228231
context: cwd,
229232
mode,
230233
cache,

0 commit comments

Comments
 (0)