xhs-mp-compiler-cli 2.0.18 → 2.0.19-beta.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/compilerManager.js +29 -33
- package/dist/packs/webpack/webpack.js +8 -1
- package/package.json +11 -11
package/dist/compilerManager.js
CHANGED
|
@@ -195,40 +195,37 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
195
195
|
// 使用的编译目标包类型
|
|
196
196
|
getUsingPackageType() {
|
|
197
197
|
return __awaiter(this, arguments, void 0, function* (entryType = constant_config_1.COMPILE_ENTRY.simulator) {
|
|
198
|
-
let enableV1 = true
|
|
198
|
+
// let enableV1 = true
|
|
199
199
|
// let enableV2 = false
|
|
200
|
-
let enableVDom = false
|
|
201
|
-
const settings = this.project.settings || {}
|
|
202
|
-
const isUpload = entryType ===
|
|
203
|
-
if (this.project.appMode ===
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
// enableV2 = settings.enableV2
|
|
225
|
-
// enableV1 = true
|
|
226
|
-
}
|
|
200
|
+
// let enableVDom = false
|
|
201
|
+
// const settings = this.project.settings || {}
|
|
202
|
+
// const isUpload = entryType === COMPILE_ENTRY.upload
|
|
203
|
+
// if (this.project.appMode === MiniMode.minigame) {
|
|
204
|
+
// // enableV1 = true
|
|
205
|
+
// // enableV2 = false
|
|
206
|
+
// enableVDom = false
|
|
207
|
+
// } else if (entryType === COMPILE_ENTRY.simulator) {
|
|
208
|
+
// if (this.compilerProps.getLibFeatures) {
|
|
209
|
+
// const libFeatures = await this.compilerProps.getLibFeatures()
|
|
210
|
+
// // enableV2 = libFeatures.supportV2 && settings.enableV2
|
|
211
|
+
// enableVDom = libFeatures.supportVDom && settings.enableVDom
|
|
212
|
+
// } else {
|
|
213
|
+
// // enableV2 = settings.enableV2
|
|
214
|
+
// enableVDom = settings.enableVDom
|
|
215
|
+
// }
|
|
216
|
+
// // enableVDom = !enableV2 && settings.enableVDom
|
|
217
|
+
// // enableV1 = !enableV2
|
|
218
|
+
// } else {
|
|
219
|
+
// // 上传模式下按照勾选开启
|
|
220
|
+
// enableVDom = settings.enableVDom
|
|
221
|
+
// // enableV2 = settings.enableV2
|
|
222
|
+
// // enableV1 = true
|
|
223
|
+
// }
|
|
227
224
|
return {
|
|
228
|
-
enableV1,
|
|
225
|
+
enableV1: true,
|
|
229
226
|
// 下掉v2 按需注入包
|
|
230
227
|
enableV2: false,
|
|
231
|
-
enableVDom
|
|
228
|
+
enableVDom: true
|
|
232
229
|
};
|
|
233
230
|
});
|
|
234
231
|
}
|
|
@@ -249,7 +246,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
249
246
|
compilePkgs.push(subPkg.root);
|
|
250
247
|
}
|
|
251
248
|
}
|
|
252
|
-
const config = Object.assign(Object.assign({
|
|
249
|
+
const config = Object.assign(Object.assign(Object.assign({ compressCss: false, compressJs: true, enableSourcemap: true, appendSourcemapComment: true, runInServiceSandbox: true, devWriteToDisk: true }, defaultOptions), opts), { compilePkgs });
|
|
253
250
|
try {
|
|
254
251
|
yield compiler.makePkgsReady(config);
|
|
255
252
|
(_a = this.report) === null || _a === void 0 ? void 0 : _a.call(this, 'compile', {
|
|
@@ -273,12 +270,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
273
270
|
reCompilePkgs(opts) {
|
|
274
271
|
return __awaiter(this, void 0, void 0, function* () {
|
|
275
272
|
var _a, _b, _c;
|
|
276
|
-
const { compilePkgs } = opts;
|
|
277
273
|
const entryType = constant_config_1.COMPILE_ENTRY.simulator;
|
|
278
274
|
const compiler = this.getCompiler(entryType);
|
|
279
275
|
const defaultOptions = yield this.getUsingPackageType(entryType);
|
|
280
276
|
const startTime = Date.now();
|
|
281
|
-
const config = Object.assign(Object.assign({
|
|
277
|
+
const config = Object.assign(Object.assign({ compressCss: false, compressJs: true, enableSourcemap: true, appendSourcemapComment: true, runInServiceSandbox: true, devWriteToDisk: true }, defaultOptions), opts);
|
|
282
278
|
try {
|
|
283
279
|
this.removeCacheDir();
|
|
284
280
|
this.removeDistDir();
|
|
@@ -24,7 +24,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
const watchOptions = {
|
|
25
25
|
aggregateTimeout: 300,
|
|
26
26
|
poll: false,
|
|
27
|
-
ignored: [
|
|
27
|
+
ignored: [
|
|
28
|
+
'**/node_modules',
|
|
29
|
+
'project.config.json',
|
|
30
|
+
'project.private.config.json',
|
|
31
|
+
'**/.git',
|
|
32
|
+
'**/.DS_Store',
|
|
33
|
+
'**/Thumbs.db'
|
|
34
|
+
]
|
|
28
35
|
};
|
|
29
36
|
// 对webpack进行一层包装,和mp-pack对齐
|
|
30
37
|
class WebPack extends xhs_mp_pack_1.AbstractMPPack {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xhs-mp-compiler-cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.19-beta.0",
|
|
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.
|
|
92
|
-
"xhs-mp-compiler-utils": "2.0.
|
|
93
|
-
"xhs-mp-pack": "2.0.
|
|
94
|
-
"xhs-mp-project": "2.0.
|
|
95
|
-
"xhs-mp-shared": "2.0.
|
|
96
|
-
"xhs-mp-shared-fs": "2.0.
|
|
97
|
-
"xhs-mp-sjs-loader": "2.0.
|
|
98
|
-
"xhs-mp-sketch-loader": "2.0.
|
|
91
|
+
"xhs-mp-ml-loader": "2.0.19-beta.0",
|
|
92
|
+
"xhs-mp-compiler-utils": "2.0.19-beta.0",
|
|
93
|
+
"xhs-mp-pack": "2.0.19-beta.0",
|
|
94
|
+
"xhs-mp-project": "2.0.19-beta.0",
|
|
95
|
+
"xhs-mp-shared": "2.0.19-beta.0",
|
|
96
|
+
"xhs-mp-shared-fs": "2.0.19-beta.0",
|
|
97
|
+
"xhs-mp-sjs-loader": "2.0.19-beta.0",
|
|
98
|
+
"xhs-mp-sketch-loader": "2.0.19-beta.0",
|
|
99
99
|
"yauzl": "^2.10.0"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
|
-
"xhs-mp-ml-parser": "2.0.
|
|
102
|
+
"xhs-mp-ml-parser": "2.0.19-beta.0"
|
|
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.
|
|
125
|
+
"xhs-mp-ml-parser": "2.0.19-beta.0"
|
|
126
126
|
},
|
|
127
127
|
"scripts": {
|
|
128
128
|
"version": "formula changelog && git add .",
|