xhs-mp-compiler-cli 1.1.6-beta.0 → 1.2.0-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/index.js CHANGED
@@ -95,6 +95,7 @@ class Compiler extends events_1.default {
95
95
  compileDirPath = dir_config_1.mpCompileDirPath;
96
96
  compileCachePath = dir_config_1.mpCompileCachePath;
97
97
  }
98
+ // this.logger.log('compileDirPath:', compileDirPath)
98
99
  return {
99
100
  mpCompileDirPath: compileDirPath,
100
101
  mpCompileCachePath: compileCachePath
@@ -185,7 +186,6 @@ class Compiler extends events_1.default {
185
186
  }
186
187
  createCompilerImpl(entryType = constant_config_1.COMPILE_ENTRY.simulator) {
187
188
  const { nodeJsPath, mpDevJsonPath } = this.compilerProps;
188
- const { mpCompileDirPath } = this.getCompilerDir();
189
189
  const distDir = this.getDistDir(entryType);
190
190
  const cacheDir = this.getCacheDir(entryType);
191
191
  const compilerType = this.getCompilerType(entryType);
@@ -1,3 +1,3 @@
1
1
  import { IStart } from '../../types';
2
2
  import { MPPack } from 'xhs-mp-pack';
3
- export declare const createCompiler: (startConfig: IStart) => Promise<void> | MPPack;
3
+ export declare const createCompiler: (startConfig: IStart) => MPPack;
@@ -7,7 +7,6 @@ exports.createCompiler = void 0;
7
7
  const presets_1 = require("../../presets");
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const xhs_mp_pack_1 = require("xhs-mp-pack");
10
- const dev_server_1 = __importDefault(require("../webpack/dev-server"));
11
10
  const createCompiler = (startConfig) => {
12
11
  const { action, enableDevServer } = startConfig;
13
12
  const mppack = new xhs_mp_pack_1.MPPack(startConfig);
@@ -19,13 +18,10 @@ const createCompiler = (startConfig) => {
19
18
  mpPackConfigs.forEach(config => {
20
19
  var _a, _b, _c, _d;
21
20
  /* 修改在ide里的node_modules的路径 */
22
- (_b = (_a = config.resolve) === null || _a === void 0 ? void 0 : _a.modules) === null || _b === void 0 ? void 0 : _b.push(path_1.default.resolve(__dirname, '../../../'));
21
+ (_b = (_a = config.resolve) === null || _a === void 0 ? void 0 : _a.modules) === null || _b === void 0 ? void 0 : _b.push(path_1.default.resolve(__dirname, '../../../../'));
23
22
  // cli的node_modules路径
24
23
  (_d = (_c = config.resolve) === null || _c === void 0 ? void 0 : _c.modules) === null || _d === void 0 ? void 0 : _d.push(path_1.default.resolve(__dirname, '../../'));
25
24
  });
26
- if (action === 'dev' && enableDevServer) {
27
- return (0, dev_server_1.default)(compilerOptions);
28
- }
29
25
  mppack.createCompiler(mpPackConfigs);
30
26
  return mppack;
31
27
  };
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.presetRender = exports.getRenderEntry = void 0;
7
- const path_1 = __importDefault(require("path"));
8
7
  const css_1 = __importDefault(require("../../../../utils/css"));
9
8
  const getSuffixName_1 = require("../../../../utils/getSuffixName");
10
9
  const sjsEntryPlugin_1 = __importDefault(require("./sjsEntryPlugin"));
@@ -29,10 +28,10 @@ const presetRender = (chain, options) => {
29
28
  libraryTarget: 'umd',
30
29
  uniqueName: 'MpRender',
31
30
  },
32
- cache: {
33
- type: 'filesystem',
34
- cacheDirectory: path_1.default.join(cacheDirectory, 'render'),
35
- },
31
+ // cache: {
32
+ // type: 'filesystem',
33
+ // cacheDirectory: path.join(cacheDirectory!, 'render'),
34
+ // },
36
35
  module: {
37
36
  rule: {
38
37
  ml: {
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.presetService = exports.getServiceEntry = void 0;
7
- const path_1 = __importDefault(require("path"));
8
7
  const xhs_mp_pack_1 = require("xhs-mp-pack");
9
8
  const serviceChunkPlugin_1 = __importDefault(require("./serviceChunkPlugin"));
10
9
  const InjectorPlugin_1 = require("../../../plugins/InjectorPlugin");
@@ -50,10 +49,10 @@ const presetService = (chain, options) => {
50
49
  libraryTarget: 'umd',
51
50
  uniqueName: 'MpService',
52
51
  },
53
- cache: {
54
- type: 'filesystem',
55
- cacheDirectory: path_1.default.join(cacheDirectory, 'service'),
56
- },
52
+ // cache: {
53
+ // type: 'filesystem',
54
+ // cacheDirectory: path.join(cacheDirectory!, 'service'),
55
+ // },
57
56
  });
58
57
  chain.plugin('InjectorPlugin').use(InjectorPlugin_1.InjectorPlugin, [options]);
59
58
  chain.plugin('ServiceChunkPlugin').use(serviceChunkPlugin_1.default, [options]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xhs-mp-compiler-cli",
3
- "version": "1.1.6-beta.0",
3
+ "version": "1.2.0-beta.0",
4
4
  "description": "xhs mp command tool.",
5
5
  "preferGlobal": true,
6
6
  "category": "esm",
@@ -82,11 +82,11 @@
82
82
  "webpack-bundle-analyzer": "^4.4.0",
83
83
  "webpack-chain": "^6.5.1",
84
84
  "webpack-sources": "^3.2.2",
85
- "xhs-mp-compiler-ml-loader": "1.1.4",
86
- "xhs-mp-compiler-utils": "1.1.2",
87
- "xhs-mp-pack": "^1.1.4-beta.0",
85
+ "xhs-mp-compiler-ml-loader": "1.2.0-beta.0",
86
+ "xhs-mp-compiler-utils": "1.2.0-beta.0",
87
+ "xhs-mp-pack": "^1.2.0-beta.0",
88
88
  "xhs-mp-project": "^1.2.0-beta.0",
89
- "xhs-mp-utils": "^1.1.2"
89
+ "xhs-mp-utils": "^1.2.0-beta.0"
90
90
  },
91
91
  "devDependencies": {
92
92
  "@types/babel__generator": "7.6.3",