xhs-mp-compiler-cli 1.9.0 → 1.9.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.
@@ -31,7 +31,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
31
31
  const enableV2 = commander.opts().enableV2 === "true";
32
32
  const enableVDom = commander.opts().enableVDom === "true";
33
33
  const compressJs = commander.opts().compressJs === "true";
34
- const multiCompiler = (0, packs_1.createPacker)({
34
+ const projectPacker = (0, packs_1.createPacker)({
35
35
  projectPath,
36
36
  action: 'build',
37
37
  platform,
@@ -40,11 +40,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
40
40
  enableV1,
41
41
  enableV2,
42
42
  enableVDom,
43
+ packMode: 'webpack',
43
44
  });
44
- multiCompiler.run((err, stats) => {
45
+ projectPacker.on('buildInfo', data => {
46
+ if (data.resource) {
47
+ console.log(`资源编译:${data.resource}`);
48
+ }
49
+ });
50
+ projectPacker.build((err, stats) => {
51
+ console.log('编译完成');
45
52
  console.log(stats.toString({ warnings: true, errors: true, all: false }));
46
- multiCompiler.close(() => {
47
- // noop
48
- });
49
53
  });
50
54
  });
@@ -33,37 +33,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
33
33
  const enableV1 = commander.opts().enableV1 === "true";
34
34
  const enableV2 = commander.opts().enableV2 === "true";
35
35
  const enableVDom = commander.opts().enableVDom === "true";
36
- process.env.PRETTIER_XHSML = "true";
37
- if (out) {
38
- const multiCompiler = (0, packs_1.createPacker)({
39
- projectPath,
40
- action: 'dev',
41
- platform,
42
- compressJs: false,
43
- enableSourcemap: false,
44
- enableV1,
45
- enableV2,
46
- enableVDom,
47
- });
48
- multiCompiler.run((err, stats) => {
49
- console.log(stats.toString({ warnings: true, errors: true, all: false }));
50
- multiCompiler.close(() => {
51
- // noop
52
- });
53
- });
54
- }
55
- else {
56
- (0, packs_1.createPacker)({
57
- projectPath,
58
- action: 'dev',
59
- enableDevServer: true,
60
- platform,
61
- compressJs: false,
62
- devServerPort,
63
- enableSourcemap: true,
64
- enableV1,
65
- enableV2,
66
- enableVDom,
67
- });
68
- }
36
+ const projectPacker = (0, packs_1.createPacker)({
37
+ projectPath,
38
+ action: 'dev',
39
+ enableDevServer: true,
40
+ platform,
41
+ compressJs: false,
42
+ devServerPort,
43
+ enableSourcemap: true,
44
+ enableV1,
45
+ enableV2,
46
+ enableVDom,
47
+ packMode: 'webpack',
48
+ });
49
+ projectPacker.on('buildInfo', data => {
50
+ if (data.resource) {
51
+ console.log(`资源编译:${data.resource}`);
52
+ }
53
+ });
54
+ projectPacker.watch({
55
+ scene: 'watch',
56
+ }, (err, stats) => {
57
+ console.log(stats.toString({ warnings: true, errors: true, all: false }));
58
+ });
69
59
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xhs-mp-compiler-cli",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
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.0",
98
- "xhs-mp-compiler-utils": "1.9.0",
99
- "xhs-mp-pack": "1.9.0",
100
- "xhs-mp-project": "1.9.0",
101
- "xhs-mp-utils": "1.9.0",
102
- "xhs-mp-shared-fs": "1.4.0",
103
- "xhs-mp-compiler-sjs-loader": "1.9.0",
97
+ "xhs-mp-compiler-ml-loader": "3.0.1",
98
+ "xhs-mp-compiler-utils": "1.9.1",
99
+ "xhs-mp-pack": "1.9.1",
100
+ "xhs-mp-project": "1.9.1",
101
+ "xhs-mp-utils": "1.9.1",
102
+ "xhs-mp-shared-fs": "1.4.1",
103
+ "xhs-mp-compiler-sjs-loader": "1.9.1",
104
104
  "yauzl": "^2.10.0"
105
105
  },
106
106
  "devDependencies": {