crabatool 1.0.290 → 1.0.291

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/tool/bizAndInit.js +22 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crabatool",
3
- "version": "1.0.290",
3
+ "version": "1.0.291",
4
4
  "description": "crabatool",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -16,12 +16,24 @@ function mergeBiz(childPath) {
16
16
  var watchAction = function() {
17
17
  utils.debug('打包中');
18
18
  var bizJs = utils.join(bizPath, '../', 'biz.js');
19
+ var bizJsSource = utils.join(bizPath, '../', 'biz_source.js');
20
+
21
+ // 根据配置是否压缩文件
19
22
  mergeTool.run({
20
23
  inPath: bizPath,
21
24
  outPath: bizJs,
22
25
  ext: '.js',
23
26
  ignoreCompress: config.ignorecompress
24
27
  });
28
+
29
+ // 源文件,只合并,不压缩,业务按需取用
30
+ mergeTool.run({
31
+ inPath: bizPath,
32
+ outPath: bizJsSource,
33
+ ext: '.js',
34
+ ignoreCompress: true // 不压缩
35
+ });
36
+
25
37
  /*
26
38
  var p = fork(mergeJs, [`${[bizPath]}`, `${[bizJs]}`, compressArgs])
27
39
  p.on('exit', code => {
@@ -60,6 +72,8 @@ function mergeInit() {
60
72
  var watchAction = function() {
61
73
  utils.debug('打包中');
62
74
  var initJs = utils.join(config.webPath, '/js/init.js');
75
+ var initJsSource = utils.join(config.webPath, '/js/init_source.js');
76
+
63
77
  utils.debug(inits);
64
78
  mergeTool.run({
65
79
  inPath: inits,
@@ -67,6 +81,14 @@ function mergeInit() {
67
81
  ext: '.js',
68
82
  ignoreCompress: config.ignorecompress
69
83
  });
84
+
85
+ mergeTool.run({
86
+ inPath: inits,
87
+ outPath: initJsSource,
88
+ ext: '.js',
89
+ ignoreCompress: true
90
+ });
91
+
70
92
  /*
71
93
  // 这里进行文件更改后的操作
72
94
  var p = fork(mergeJs, [`${[inits]}`, `${[initJs]}`, compressArgs])