@tmsfe/tmskit 0.0.42 → 0.0.43

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.cjs.js CHANGED
@@ -505,6 +505,8 @@ var defaultTmsConfig = {
505
505
  dependencies: {},
506
506
  /** 编译输出文件夹位置 */
507
507
  outputDir: 'dist',
508
+ /** 是否在编译前清空输出目录 */
509
+ cleanOutputDirBeforeCompile: true,
508
510
  /** 源码监听路径 */
509
511
  sourceDir: './',
510
512
  /** 静态资源目录 */
@@ -3289,7 +3291,9 @@ async function dev$3(tmsConfig, targetModules) {
3289
3291
  noCache
3290
3292
  } = global$4.getData('cmdOptions');
3291
3293
  if (noCache) {
3292
- shelljs$1.rm('-rf', resolve$9(tmsConfig.outputDir));
3294
+ if (tmsConfig.cleanOutputDirBeforeCompile !== false) {
3295
+ shelljs$1.rm('-rf', resolve$9(tmsConfig.outputDir));
3296
+ }
3293
3297
  shelljs$1.rm('-rf', MODULE_CODE_DIR);
3294
3298
  shelljs$1.rm('-rf', NODE_MODULES_DIR);
3295
3299
  }
@@ -3342,7 +3346,9 @@ const {
3342
3346
  async function build$1(tmsConfig, targetModules) {
3343
3347
  var _tmsConfig$hooks;
3344
3348
  // 开始构建前,清理输出目录
3345
- await shelljs.rm('-rf', resolve$8(tmsConfig.outputDir));
3349
+ if (tmsConfig.cleanOutputDirBeforeCompile !== false) {
3350
+ await shelljs.rm('-rf', resolve$8(tmsConfig.outputDir));
3351
+ }
3346
3352
  const {
3347
3353
  modules: newModules
3348
3354
  } = await init$1(tmsConfig, targetModules);
@@ -4179,7 +4185,7 @@ var entry = [{
4179
4185
 
4180
4186
  var require$$12 = {
4181
4187
  name: "@tmsfe/tmskit",
4182
- version: "0.0.42",
4188
+ version: "0.0.43",
4183
4189
  description: "tmskit",
4184
4190
  main: "dist/index.cjs",
4185
4191
  bin: {
@@ -4238,7 +4244,7 @@ var require$$12 = {
4238
4244
  lodash: "^4.17.21",
4239
4245
  metalsmith: "^2.3.0",
4240
4246
  minimatch: "^5.1.0",
4241
- "miniprogram-ci": "1.8.25",
4247
+ "miniprogram-ci": "2.1.14",
4242
4248
  moment: "^2.29.2",
4243
4249
  "object-assign": "^4.0.1",
4244
4250
  ora: "^5.4.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmsfe/tmskit",
3
- "version": "0.0.42",
3
+ "version": "0.0.43",
4
4
  "description": "tmskit",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {
@@ -59,7 +59,7 @@
59
59
  "lodash": "^4.17.21",
60
60
  "metalsmith": "^2.3.0",
61
61
  "minimatch": "^5.1.0",
62
- "miniprogram-ci": "1.8.25",
62
+ "miniprogram-ci": "2.1.14",
63
63
  "moment": "^2.29.2",
64
64
  "object-assign": "^4.0.1",
65
65
  "ora": "^5.4.1",
@@ -9,6 +9,8 @@ module.exports = {
9
9
  dependencies: {},
10
10
  /** 编译输出文件夹位置 */
11
11
  outputDir: 'dist',
12
+ /** 是否在编译前清空输出目录 */
13
+ cleanOutputDirBeforeCompile: true,
12
14
  /** 源码监听路径 */
13
15
  sourceDir: './',
14
16
  /** 静态资源目录 */
@@ -8,7 +8,9 @@ const { global } = require('../../../utils/global');
8
8
 
9
9
  async function build(tmsConfig, targetModules) {
10
10
  // 开始构建前,清理输出目录
11
- await shelljs.rm('-rf', resolve(tmsConfig.outputDir));
11
+ if (tmsConfig.cleanOutputDirBeforeCompile !== false) {
12
+ await shelljs.rm('-rf', resolve(tmsConfig.outputDir));
13
+ }
12
14
 
13
15
  const { modules: newModules } = await init(tmsConfig, targetModules);
14
16
  info('当前build有效模块', newModules.map(item => item.moduleName).sort());
@@ -31,7 +31,9 @@ function delOtherPackages(tmsConfig, targetSubPackages) {
31
31
  async function dev(tmsConfig, targetModules) {
32
32
  const { noCache } = global.getData('cmdOptions');
33
33
  if (noCache) {
34
- shelljs.rm('-rf', resolve(tmsConfig.outputDir));
34
+ if (tmsConfig.cleanOutputDirBeforeCompile !== false) {
35
+ shelljs.rm('-rf', resolve(tmsConfig.outputDir));
36
+ }
35
37
  shelljs.rm('-rf', MODULE_CODE_DIR);
36
38
  shelljs.rm('-rf', NODE_MODULES_DIR);
37
39
  }