xhs-mp-compiler-cli 1.9.2 → 1.9.3

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.
@@ -37,14 +37,14 @@
37
37
  exports.COMPILE_FULL_PKG = 'xhs-full';
38
38
  exports.COMPILE_MAIN_PKG = 'xhs-main';
39
39
  exports.COMPILE_SUB_PKG = 'xhs-sub';
40
- exports.PROD_BROWSERSLIST = ['ios_saf >= 12', 'chrome >= 83'];
40
+ exports.PROD_BROWSERSLIST = ['ios_saf >= 10', 'chrome >= 83'];
41
41
  exports.DEV_BROWSERSLIST = ['last 2 chrome version'];
42
42
  exports.DEV_TARGETS = {
43
43
  chrome: '90'
44
44
  };
45
45
  exports.PROD_TARGETS = {
46
46
  chrome: '83',
47
- ios: '12'
47
+ ios: '10'
48
48
  };
49
49
  exports.ENTRY_CSS_NAME = 'app';
50
50
  exports.FULL_PKG = 'xhs-full';
package/dist/index.d.ts CHANGED
@@ -76,7 +76,6 @@ export declare class ProjectCompiler extends EventEmitter {
76
76
  reCompilePkgs(config: ICompilePkgsConfig): Promise<void>;
77
77
  compileProject(config: ICompileBuildConfig): Promise<void>;
78
78
  compileAndZip(opts: ICompileAndZipOptions): Promise<any>;
79
- private zipWithFullPackageWithAppId;
80
79
  private zipWithFullPackage;
81
80
  private zipWithSubPackage;
82
81
  close(entryType?: string): void;
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  if (v !== undefined) module.exports = v;
17
17
  }
18
18
  else if (typeof define === "function" && define.amd) {
19
- define(["require", "exports", "./config/constant.config", "xhs-mp-project", "events", "fs-extra", "path", "./utils/utils", "./utils/zip", "./utils/project", "./config/dir.config", "./compiler", "./config/constant.config"], factory);
19
+ define(["require", "exports", "./config/constant.config", "xhs-mp-project", "events", "fs-extra", "path", "./utils/utils", "./utils/project", "./config/dir.config", "./compiler", "./config/constant.config"], factory);
20
20
  }
21
21
  })(function (require, exports) {
22
22
  "use strict";
@@ -29,7 +29,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
29
29
  const fs_extra_1 = __importDefault(require("fs-extra"));
30
30
  const path_1 = __importDefault(require("path"));
31
31
  const utils_1 = require("./utils/utils");
32
- const zip_1 = require("./utils/zip");
33
32
  const project_1 = require("./utils/project");
34
33
  const dir_config_1 = require("./config/dir.config");
35
34
  const compiler_1 = require("./compiler");
@@ -323,20 +322,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
323
322
  }
324
323
  else {
325
324
  // 真机调试
326
- // eslint-disable-next-line no-lonely-if
327
- if (!subPackages.length) {
328
- // 真机调试整包zip内产物文件需要放在appid目录下
329
- entryZips = [this.zipWithFullPackageWithAppId(opts, subPackages, 'v0')];
330
- }
331
- else {
332
- // eslint-disable-next-line no-lonely-if
333
- if (enableV2) {
334
- entryZips = [this.zipWithSubPackage(opts, subPackages, 'v2')];
335
- }
336
- else {
337
- entryZips = [this.zipWithSubPackage(opts, subPackages, 'v1')];
338
- }
339
- }
325
+ entryZips = [this.zipWithSubPackage(opts, subPackages, enableV2 ? 'v2' : 'v1')];
340
326
  }
341
327
  const zipTask = yield Promise.all(entryZips.filter(Boolean));
342
328
  const zipResult = zipTask.flat(2);
@@ -352,15 +338,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
352
338
  }
353
339
  }));
354
340
  }
355
- zipWithFullPackageWithAppId(opts_1) {
356
- return __awaiter(this, arguments, void 0, function* (opts, subPackages = [], type) {
357
- const { entryType } = opts;
358
- const buildDir = this.getDistDir(entryType);
359
- const distFullZip = path_1.default.resolve(buildDir, 'v0-full-pack.zip');
360
- const srcDirPath = path_1.default.resolve(buildDir, !subPackages.length ? 'v1' : 'v0'); // 如果没有开启分包,则把v1包当作v0包
361
- return (0, zip_1.genZip)(srcDirPath, distFullZip, this.project.projectAppId);
362
- });
363
- }
364
341
  /* 使用v0的入口,zip整包 */
365
342
  zipWithFullPackage(opts_1) {
366
343
  return __awaiter(this, arguments, void 0, function* (opts, subPackages = [], type) {
@@ -2,7 +2,6 @@ import { Config } from '../packs';
2
2
  import { IPresetOptions } from '../types';
3
3
  /**
4
4
  * babel 仅关注语法转换,polyfill 在 js-core 中已经内置
5
- * 目前 polyfill 仅支持到 'ios_saf >= 10', 'chrome >= 83'。语法构建中,会默认支持。
6
5
  */
7
6
  declare const getBaseConfig: (chain: Config, options: IPresetOptions) => void;
8
7
  export default getBaseConfig;
@@ -13,7 +13,6 @@
13
13
  const types_1 = require("../types");
14
14
  /**
15
15
  * babel 仅关注语法转换,polyfill 在 js-core 中已经内置
16
- * 目前 polyfill 仅支持到 'ios_saf >= 10', 'chrome >= 83'。语法构建中,会默认支持。
17
16
  */
18
17
  const getBaseConfig = (chain, options) => {
19
18
  const { packSetting } = options;
package/dist/utils/css.js CHANGED
@@ -7,20 +7,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
7
7
  if (v !== undefined) module.exports = v;
8
8
  }
9
9
  else if (typeof define === "function" && define.amd) {
10
- define(["require", "exports", "postcss-preset-env", "./postcssRpx2Vw", "./const", "../types"], factory);
10
+ define(["require", "exports", "postcss-preset-env", "./postcssRpx2Vw", "../types", "../config/constant.config"], factory);
11
11
  }
12
12
  })(function (require, exports) {
13
13
  "use strict";
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- // @ts-nocheck
16
15
  const postcss_preset_env_1 = __importDefault(require("postcss-preset-env"));
17
16
  const postcssRpx2Vw_1 = __importDefault(require("./postcssRpx2Vw"));
18
- const const_1 = __importDefault(require("./const"));
19
17
  const types_1 = require("../types");
20
- const { DEV_BROWSERSLIST, PROD_BROWSERSLIST } = const_1.default;
18
+ const constant_config_1 = require("../config/constant.config");
21
19
  const getCssConfig = (options, presets) => {
22
20
  const isDev = options.env === types_1.ENV.development;
23
- const browsers = isDev ? DEV_BROWSERSLIST : PROD_BROWSERSLIST;
21
+ const browsers = isDev ? constant_config_1.DEV_BROWSERSLIST : constant_config_1.PROD_BROWSERSLIST;
24
22
  const loaders = {
25
23
  'mini-style-loader': {
26
24
  loader: require.resolve('../presets/loaders/mini-style-loader'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xhs-mp-compiler-cli",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "description": "xhs mp command tool.",
5
5
  "preferGlobal": true,
6
6
  "category": "esm",
@@ -94,13 +94,13 @@
94
94
  "webpack-chain": "^6.5.1",
95
95
  "webpack-sources": "^3.2.2",
96
96
  "xhs-mp-workerpool": "^9.1.3",
97
- "xhs-mp-compiler-ml-loader": "3.0.2",
98
- "xhs-mp-compiler-utils": "1.9.2",
99
- "xhs-mp-pack": "1.9.2",
100
- "xhs-mp-project": "1.9.2",
101
- "xhs-mp-utils": "1.9.2",
102
- "xhs-mp-shared-fs": "1.4.2",
103
- "xhs-mp-compiler-sjs-loader": "1.9.2",
97
+ "xhs-mp-compiler-ml-loader": "3.0.3",
98
+ "xhs-mp-compiler-utils": "1.9.3",
99
+ "xhs-mp-pack": "1.9.3",
100
+ "xhs-mp-project": "1.9.3",
101
+ "xhs-mp-utils": "1.9.3",
102
+ "xhs-mp-shared-fs": "1.4.3",
103
+ "xhs-mp-compiler-sjs-loader": "1.9.3",
104
104
  "yauzl": "^2.10.0"
105
105
  },
106
106
  "devDependencies": {
@@ -1,27 +0,0 @@
1
- declare const CONSTANTS: {
2
- PROD_BROWSERSLIST: string[];
3
- DEV_BROWSERSLIST: string[];
4
- DEV_TARGETS: {
5
- chrome: string;
6
- };
7
- PROD_TARGETS: {
8
- chrome: string;
9
- ios: string;
10
- };
11
- ENTRY_CSS_NAME: string;
12
- FULL_PKG: string;
13
- MAIN_PKG: string;
14
- SUB_PKG: string;
15
- BUILD_REASON: {
16
- INIT: string;
17
- FILE_CHANGE: string;
18
- ACTIVATE_PKG: string;
19
- RECOMPILE: string;
20
- };
21
- ASSETS_EXTS: string[];
22
- PACK_MODE: {
23
- MPPACK: string;
24
- WEBPACK: string;
25
- };
26
- };
27
- export default CONSTANTS;
@@ -1,57 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const CONSTANTS = {
13
- PROD_BROWSERSLIST: ['ios_saf >= 12', 'chrome >= 83'],
14
- DEV_BROWSERSLIST: ['last 2 chrome version'],
15
- DEV_TARGETS: {
16
- chrome: '90',
17
- },
18
- PROD_TARGETS: {
19
- chrome: '83',
20
- ios: '12'
21
- },
22
- ENTRY_CSS_NAME: 'app',
23
- FULL_PKG: 'xhs-full',
24
- MAIN_PKG: 'xhs-main',
25
- SUB_PKG: 'xhs-sub',
26
- BUILD_REASON: {
27
- INIT: 'INIT',
28
- FILE_CHANGE: 'FILE_CHANGE',
29
- ACTIVATE_PKG: 'ACTIVATE_PKG',
30
- RECOMPILE: 'RECOMPILE',
31
- },
32
- ASSETS_EXTS: [
33
- 'png',
34
- 'jpg',
35
- 'jpeg',
36
- 'gif',
37
- 'svg',
38
- 'webp',
39
- 'cer',
40
- 'mp3',
41
- 'aac',
42
- 'm4a',
43
- 'mp4',
44
- 'wav',
45
- 'ogg',
46
- 'silk',
47
- 'wasm',
48
- 'br',
49
- 'plist',
50
- ],
51
- PACK_MODE: {
52
- MPPACK: 'mp-pack',
53
- WEBPACK: 'webpack'
54
- }
55
- };
56
- exports.default = CONSTANTS;
57
- });