xhs-mp-compiler-cli 2.0.33-beta.2 → 2.0.33-beta.4
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.
|
@@ -17,10 +17,7 @@
|
|
|
17
17
|
* 本函数最后要toString() 获得函数体 所以不能依赖外部变量,所有实现均在内部实现
|
|
18
18
|
*/
|
|
19
19
|
const getXHSSandBox = function () {
|
|
20
|
-
|
|
21
|
-
return globalThis;
|
|
22
|
-
}
|
|
23
|
-
const FrameworkGlobalThis = globalThis;
|
|
20
|
+
const FrameworkGlobalThis = globalThis || new Function('return this')();
|
|
24
21
|
const BussinessGlobalThis = Object.create(FrameworkGlobalThis.constructor.prototype);
|
|
25
22
|
/**
|
|
26
23
|
* 框架提供的能力, 都是可写可读的
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Compilation, sources } from 'webpack';
|
|
1
2
|
import { IXhsCompiler } from 'xhs-mp-pack';
|
|
2
3
|
import { IPresetOptions } from '../../../../types';
|
|
3
|
-
import { Compilation, sources } from 'webpack';
|
|
4
4
|
type SourceMapSourceType = sources.SourceMapSource;
|
|
5
5
|
type RawSourceType = sources.RawSource;
|
|
6
6
|
type ConcatSourceType = sources.ConcatSource;
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
2
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
3
|
-
};
|
|
4
1
|
(function (factory) {
|
|
5
2
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
6
3
|
var v = factory(require, exports);
|
|
7
4
|
if (v !== undefined) module.exports = v;
|
|
8
5
|
}
|
|
9
6
|
else if (typeof define === "function" && define.amd) {
|
|
10
|
-
define(["require", "exports", "
|
|
7
|
+
define(["require", "exports", "webpack", "xhs-mp-compiler-utils", "./sanbox"], factory);
|
|
11
8
|
}
|
|
12
9
|
})(function (require, exports) {
|
|
13
10
|
"use strict";
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const path_1 = __importDefault(require("path"));
|
|
16
12
|
const webpack_1 = require("webpack");
|
|
13
|
+
const xhs_mp_compiler_utils_1 = require("xhs-mp-compiler-utils");
|
|
17
14
|
const sanbox_1 = require("./sanbox");
|
|
18
15
|
// 使用 webpack 内置的 sources 类型
|
|
19
16
|
const { SourceMapSource, RawSource, ConcatSource } = webpack_1.sources;
|
|
@@ -219,7 +216,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
219
216
|
.filter((sub) => sub.independent)
|
|
220
217
|
.forEach((sub) => {
|
|
221
218
|
var _a;
|
|
222
|
-
const servicePath =
|
|
219
|
+
const servicePath = (0, xhs_mp_compiler_utils_1.unixJoin)(usingPackageType, sub.root, 'service.js');
|
|
223
220
|
if (compilation.getAsset(servicePath)) {
|
|
224
221
|
const independentServiceSource = (_a = compilation.getAsset(servicePath)) === null || _a === void 0 ? void 0 : _a.source;
|
|
225
222
|
// 创建独立分包的业务代码(只包含 runtime + service,不包含 common)
|
|
@@ -248,7 +245,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
248
245
|
.filter((sub) => !sub.independent) // 非独立分包
|
|
249
246
|
.forEach((sub) => {
|
|
250
247
|
var _a;
|
|
251
|
-
const servicePath =
|
|
248
|
+
const servicePath = (0, xhs_mp_compiler_utils_1.unixJoin)(usingPackageType, sub.root, 'service.js');
|
|
252
249
|
if (compilation.getAsset(servicePath)) {
|
|
253
250
|
const nonIndependentServiceSource = (_a = compilation.getAsset(servicePath)) === null || _a === void 0 ? void 0 : _a.source;
|
|
254
251
|
// 非独立分包只需要处理自己的 service 代码,不需要 runtime 和 common
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xhs-mp-compiler-cli",
|
|
3
|
-
"version": "2.0.33-beta.
|
|
3
|
+
"version": "2.0.33-beta.4",
|
|
4
4
|
"description": "xhs mp command tool.",
|
|
5
5
|
"preferGlobal": true,
|
|
6
6
|
"category": "esm",
|
|
@@ -88,18 +88,18 @@
|
|
|
88
88
|
"webpack-chain": "^6.5.1",
|
|
89
89
|
"webpack-sources": "^3.2.2",
|
|
90
90
|
"xhs-mp-workerpool": "^9.2.0",
|
|
91
|
-
"xhs-mp-ml-loader": "2.0.33-beta.
|
|
92
|
-
"xhs-mp-compiler-utils": "2.0.33-beta.
|
|
93
|
-
"xhs-mp-pack": "2.0.33-beta.
|
|
94
|
-
"xhs-mp-project": "2.0.33-beta.
|
|
95
|
-
"xhs-mp-shared": "2.0.33-beta.
|
|
96
|
-
"xhs-mp-shared-fs": "2.0.33-beta.
|
|
97
|
-
"xhs-mp-sjs-loader": "2.0.33-beta.
|
|
98
|
-
"xhs-mp-sketch-loader": "2.0.33-beta.
|
|
91
|
+
"xhs-mp-ml-loader": "2.0.33-beta.4",
|
|
92
|
+
"xhs-mp-compiler-utils": "2.0.33-beta.4",
|
|
93
|
+
"xhs-mp-pack": "2.0.33-beta.4",
|
|
94
|
+
"xhs-mp-project": "2.0.33-beta.4",
|
|
95
|
+
"xhs-mp-shared": "2.0.33-beta.4",
|
|
96
|
+
"xhs-mp-shared-fs": "2.0.33-beta.4",
|
|
97
|
+
"xhs-mp-sjs-loader": "2.0.33-beta.4",
|
|
98
|
+
"xhs-mp-sketch-loader": "2.0.33-beta.4",
|
|
99
99
|
"yauzl": "^2.10.0"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
|
-
"xhs-mp-ml-parser": "2.0.33-beta.
|
|
102
|
+
"xhs-mp-ml-parser": "2.0.33-beta.4"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
105
|
"@types/babel__generator": "7.6.3",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"@types/node": "14",
|
|
123
123
|
"typescript": "5.1.6",
|
|
124
124
|
"webpack-dev-server": "4.0.0-beta.3",
|
|
125
|
-
"xhs-mp-ml-parser": "2.0.33-beta.
|
|
125
|
+
"xhs-mp-ml-parser": "2.0.33-beta.4"
|
|
126
126
|
},
|
|
127
127
|
"scripts": {
|
|
128
128
|
"version": "formula changelog && git add .",
|