kn-cli 1.0.32 → 1.0.33

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/build/build.sh CHANGED
@@ -3,8 +3,12 @@ then
3
3
  echo "没有发现build_env,默认设置为prod"
4
4
  build_env="prod"
5
5
  fi
6
- echo "cli build模式强制设定 noSkipNpmInstall=1"
7
- export noSkipNpmInstall=1
6
+
7
+ if [ $build_env = "prod" ]
8
+ then
9
+ echo "cli build模式强制设定 noSkipNpmInstall=1"
10
+ export noSkipNpmInstall=1
11
+ fi
8
12
  export mock=0
9
13
  export build_type=build
10
14
  sh start.sh
@@ -27,6 +27,8 @@ module.exports = {
27
27
  // sass:true,//true=开启sass支持,默认仅支持less
28
28
  // indexHtml:false,//false=关闭index.html的注入
29
29
  // indexHtml:{
30
+ // injext:true,//是否自动注入
31
+ // minify:true,//是否压缩html
30
32
  // template:'index_template.html',
31
33
  // output:'../index.html',//将index.html输出到 dist目录外的index.html
32
34
  // },
@@ -385,6 +385,8 @@ if(indexHtml){
385
385
  }
386
386
  let index_template = path.join(dirname, 'index.html');
387
387
  let index_template_output= 'index.html';
388
+ let index_auto_inject=true;
389
+ let index_minify=false;
388
390
  if(typeof indexHtml ==='object'){
389
391
  if(indexHtml.template){
390
392
  index_template = path.join(dirname, indexHtml.template);
@@ -392,13 +394,16 @@ if(indexHtml){
392
394
  if(indexHtml.output){
393
395
  index_template_output = indexHtml.output;
394
396
  }
397
+ index_auto_inject = indexHtml.inject??index_auto_inject;
398
+ index_minify= indexHtml.minify??index_minify;
395
399
  }
396
400
  plugins.push(
397
401
  new HtmlWebpackPlugin({
402
+ minify:index_minify,
398
403
  chunks: ['index',...shareJs],
399
404
  template: index_template,
400
405
  filename: index_template_output,
401
- inject: true,
406
+ inject: index_auto_inject,
402
407
  isProd: process.env.build_env == 'prod',
403
408
  }),
404
409
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kn-cli",
3
- "version": "1.0.32",
3
+ "version": "1.0.33",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -48,6 +48,8 @@ module.exports = {
48
48
  sass:true,//默认:false,true=开启sass支持,默认仅支持less
49
49
  indexHtml:false,//默认:true,false=关闭index.html的注入
50
50
  // indexHtml:{
51
+ // injext:true,//是否自动注入
52
+ // minify:true,//是否压缩html
51
53
  // template:'index_template.html',
52
54
  // output:'../index.html',//将index.html输出到 dist目录外的index.html
53
55
  // },
@@ -63,6 +65,9 @@ module.exports = {
63
65
  ```
64
66
 
65
67
  # 更新日志
68
+ * 1.0.33
69
+ 增加indexHtml配置
70
+
66
71
  * 1.0.32
67
72
  减小包值
68
73