kn-cli 1.0.125 → 1.0.126

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/src/build.js +19 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kn-cli",
3
- "version": "1.0.125",
3
+ "version": "1.0.126",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/build.js CHANGED
@@ -134,6 +134,7 @@ module.exports= async (options={})=> {
134
134
  return false;
135
135
  }
136
136
  });
137
+
137
138
  if(logCount){
138
139
  // task.output=`清除文件:${logCount}`;
139
140
  }
@@ -153,6 +154,24 @@ module.exports= async (options={})=> {
153
154
  // })
154
155
  }
155
156
  },
157
+ {
158
+ title:"清理node_modules链接",
159
+ task:async (ctx,task)=>{
160
+ if(answer?.install=='需要'){
161
+ if(type=='dev'){
162
+ let link_node_modules= path.resolve(projectPath,'node_modules');
163
+ try{
164
+ const fileStat = fs.statSync(link_node_modules);
165
+ if(fileStat.isDirectory()){
166
+ fs.rmdirSync(link_node_modules,{recursive:true,force:true});
167
+ }
168
+ }catch(ex){
169
+
170
+ }
171
+ }
172
+ }
173
+ }
174
+ },
156
175
  {
157
176
  title:"创建构建临时缓存",
158
177
  task:async (ctx,task)=>{