xhs-mp-compiler-cli 2.0.7 → 2.0.8

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.
@@ -51,7 +51,7 @@ export declare class MPPackDevCompiler extends AbstractCompiler {
51
51
  constructor(props: any, args: any);
52
52
  makePoolReady(): void;
53
53
  reset(): void;
54
- doCompilePkgs(opts: ICheckOptions): Promise<unknown>;
54
+ private doCompilePkgs;
55
55
  private compilePkgsAndWatch;
56
56
  private addPkgsToWatch;
57
57
  changeCompileOptions(options: any): void;
package/dist/compiler.js CHANGED
@@ -265,10 +265,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
265
265
  reCompilePkgs(options) {
266
266
  return __awaiter(this, void 0, void 0, function* () {
267
267
  this.readyPkgs = [];
268
- this.changeCompileOptions(options);
269
- if (!this.pending && !this.watching) {
270
- this.pendingPkgs = {};
271
- }
268
+ this.pendingPkgs = {};
269
+ this.pending = false;
270
+ this.watching = false;
271
+ this.close();
272
272
  yield this.doCompilePkgs(options);
273
273
  });
274
274
  }
@@ -166,6 +166,7 @@ const handlers = {
166
166
  var _a;
167
167
  (_a = projectPacker === null || projectPacker === void 0 ? void 0 : projectPacker.close) === null || _a === void 0 ? void 0 : _a.call(projectPacker, () => { });
168
168
  projectPacker = null;
169
+ globalConfig = null;
169
170
  }
170
171
  };
171
172
  workerpool.worker(handlers);
@@ -204,38 +204,39 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
204
204
  // 使用的编译目标包类型
205
205
  getUsingPackageType() {
206
206
  return __awaiter(this, arguments, void 0, function* (entryType = constant_config_1.COMPILE_ENTRY.simulator) {
207
- let enableV1 = false;
208
- let enableV2 = true;
207
+ let enableV1 = true;
208
+ // let enableV2 = false
209
209
  let enableVDom = false;
210
210
  const settings = this.project.settings || {};
211
211
  const isUpload = entryType === constant_config_1.COMPILE_ENTRY.upload;
212
212
  if (this.project.appMode === constant_config_1.MiniMode.minigame) {
213
- enableV1 = true;
214
- enableV2 = false;
213
+ // enableV1 = true
214
+ // enableV2 = false
215
215
  enableVDom = false;
216
216
  }
217
217
  else if (entryType === constant_config_1.COMPILE_ENTRY.simulator) {
218
218
  if (this.compilerProps.getLibFeatures) {
219
219
  const libFeatures = yield this.compilerProps.getLibFeatures();
220
- enableV2 = libFeatures.supportV2 && settings.enableV2;
221
- enableVDom = !enableV2 && libFeatures.supportVDom && settings.enableVDom;
220
+ // enableV2 = libFeatures.supportV2 && settings.enableV2
221
+ enableVDom = libFeatures.supportVDom && settings.enableVDom;
222
222
  }
223
223
  else {
224
- enableV2 = settings.enableV2;
225
- enableVDom = !enableV2 && settings.enableVDom;
224
+ // enableV2 = settings.enableV2
225
+ enableVDom = settings.enableVDom;
226
226
  }
227
227
  // enableVDom = !enableV2 && settings.enableVDom
228
- enableV1 = !enableV2;
228
+ // enableV1 = !enableV2
229
229
  }
230
230
  else {
231
231
  // 上传模式下按照勾选开启
232
232
  enableVDom = settings.enableVDom;
233
- enableV2 = settings.enableV2;
234
- enableV1 = true;
233
+ // enableV2 = settings.enableV2
234
+ // enableV1 = true
235
235
  }
236
236
  return {
237
237
  enableV1,
238
- enableV2,
238
+ // 下掉v2 按需注入包
239
+ enableV2: false,
239
240
  enableVDom
240
241
  };
241
242
  });
@@ -294,6 +295,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
294
295
  console.log('[compiler]reCompilePkgs', config);
295
296
  try {
296
297
  this.emit('recompile-pkgs-start', { config });
298
+ this.removeCacheDir();
299
+ this.removeDistDir();
297
300
  (_a = (0, sharedFs_1.default)(true)) === null || _a === void 0 ? void 0 : _a.clear();
298
301
  yield compiler.reCompilePkgs(config);
299
302
  this.emit('recompile-pkgs-end', { config });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xhs-mp-compiler-cli",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
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.1.3",
91
- "xhs-mp-ml-loader": "2.0.7",
92
- "xhs-mp-compiler-utils": "2.0.7",
93
- "xhs-mp-pack": "2.0.7",
94
- "xhs-mp-project": "2.0.7",
95
- "xhs-mp-shared": "2.0.7",
96
- "xhs-mp-shared-fs": "2.0.7",
97
- "xhs-mp-sjs-loader": "2.0.7",
98
- "xhs-mp-sketch-loader": "2.0.7",
91
+ "xhs-mp-ml-loader": "2.0.8",
92
+ "xhs-mp-compiler-utils": "2.0.8",
93
+ "xhs-mp-pack": "2.0.8",
94
+ "xhs-mp-project": "2.0.8",
95
+ "xhs-mp-shared": "2.0.8",
96
+ "xhs-mp-shared-fs": "2.0.8",
97
+ "xhs-mp-sjs-loader": "2.0.8",
98
+ "xhs-mp-sketch-loader": "2.0.8",
99
99
  "yauzl": "^2.10.0"
100
100
  },
101
101
  "peerDependencies": {
102
- "xhs-mp-ml-parser": "2.0.7"
102
+ "xhs-mp-ml-parser": "2.0.8"
103
103
  },
104
104
  "devDependencies": {
105
105
  "@types/babel__generator": "7.6.3",
@@ -123,7 +123,7 @@
123
123
  "typescript": "5.1.6",
124
124
  "vue3-jest": "27.0.0-alpha.2",
125
125
  "webpack-dev-server": "4.0.0-beta.3",
126
- "xhs-mp-ml-parser": "2.0.7"
126
+ "xhs-mp-ml-parser": "2.0.8"
127
127
  },
128
128
  "scripts": {
129
129
  "version": "formula changelog && git add .",