xhs-mp-compiler-cli 1.4.0 → 1.4.1-beta.1

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.
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const packs_1 = require("../../../../packs");
4
4
  const injectCSS = `
5
- globalThis.__XHS_IS_WEBVIEW = (globalThis.localStorage && document && document.querySelectorAll)
5
+ globalThis.__XHS_IS_WEBVIEW = (globalThis.localStorage && globalThis.document && globalThis.document.querySelectorAll)
6
6
  globalThis.__XHS_APPEND_CSS = function(cssText){
7
7
  if (!globalThis.__XHS_IS_WEBVIEW) return;
8
8
  var headTags = document.getElementsByTagName('head')
@@ -122,7 +122,9 @@ function genServiceLoderScript(project, context, opts) {
122
122
  const addAppJs = () => {
123
123
  if (fs_extra_1.default.existsSync(`${projectMiniprogramPath}/app.js`) ||
124
124
  fs_extra_1.default.existsSync(`${projectMiniprogramPath}/app.ts`)) {
125
- modules.unshift(`;globalThis['${name}'].default['app'] = require('${(0, loader_utils_1.formatPath)(`${projectMiniprogramPath}/app`)}')`);
125
+ // 2.0架构下app.js由基础库控制执行
126
+ modules.unshift(`const loadAppJs = () => require('${(0, loader_utils_1.formatPath)(`${projectMiniprogramPath}/app`)}');
127
+ globalThis['${name}'].default['app'] = globalThis.usingFramework === '2.0' ? loadAppJs : loadAppJs()`);
126
128
  }
127
129
  };
128
130
  if (pkg === xhs_mp_pack_1.CONSTANTS.FULL_PKG) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xhs-mp-compiler-cli",
3
- "version": "1.4.0",
3
+ "version": "1.4.1-beta.1",
4
4
  "description": "xhs mp command tool.",
5
5
  "preferGlobal": true,
6
6
  "category": "esm",
@@ -82,11 +82,11 @@
82
82
  "webpack-bundle-analyzer": "^4.4.0",
83
83
  "webpack-chain": "^6.5.1",
84
84
  "webpack-sources": "^3.2.2",
85
- "xhs-mp-compiler-ml-loader": "1.4.0",
86
- "xhs-mp-compiler-utils": "1.2.5",
87
- "xhs-mp-pack": "^1.2.5",
88
- "xhs-mp-project": "^1.2.5",
89
- "xhs-mp-utils": "^1.4.0"
85
+ "xhs-mp-compiler-ml-loader": "1.4.1-beta.1",
86
+ "xhs-mp-compiler-utils": "1.2.6-beta.1",
87
+ "xhs-mp-pack": "^1.2.6-beta.1",
88
+ "xhs-mp-project": "^1.2.6-beta.1",
89
+ "xhs-mp-utils": "^1.4.1-beta.1"
90
90
  },
91
91
  "devDependencies": {
92
92
  "@types/babel__generator": "7.6.3",