Skip to content

Commit a7a9606

Browse files
authored
Merge pull request #274 from aliyun/fix/cleanfile
chore: remove useless file
2 parents dda4b2f + 150cf82 commit a7a9606

File tree

3 files changed

+34
-9
lines changed

3 files changed

+34
-9
lines changed

gulpfile.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var plugins = require("gulp-load-plugins")({lazy: false});
33
var fs = require('fs');
44
var path = require('path');
55
var os =require('os');
6+
var del = require('del');
67
var minimist = require('minimist')
78
//var NwBuilder = require('nw-builder');
89
//var pkg = require('./package');
@@ -178,17 +179,19 @@ gulp.task('copy-static', function () {
178179
// });
179180

180181
gulp.task('copy-index', function () {
181-
gulp.src(['./app/index.html',
182+
return gulp.src(['./app/index.html',
182183
'./main.js',
183184
'./server.js',
184185
'./vendor/*.js',
185-
'./release-notes.md'])
186+
'./release-notes.md',
187+
'./tools/.yarnclean'
188+
])
186189
.pipe(gulp.dest(DIST));
187190
});
188191

189-
gulp.task('gen-package', function () {
190-
gulp.src(['./package.json'])
191-
.on('end', function(){
192+
gulp.task('gen-package', ['copy-index'], function () {
193+
return gulp.src(['./package.json'])
194+
.on('end', function(cb){
192195
var info = require('./package');
193196

194197
delete info.devDependencies;
@@ -206,10 +209,17 @@ gulp.task('gen-package', function () {
206209

207210
try{ fs.statSync(DIST); }catch(e){ fs.mkdirSync(DIST); }
208211
fs.writeFileSync(DIST+'/package.json', JSON.stringify(info,' ',2));
209-
exec('cd dist && cnpm i');
212+
exec('cd dist && yarn install --prod && yarn autoclean --force', cb);
210213
});
211214
});
212215

216+
gulp.task('remove-redundant', ['gen-package'], function (cb) {
217+
return del.sync([
218+
'dist/node_modules/protobufjs/dist',
219+
'dist/node_modules/aliyun-sdk/dist'
220+
]);
221+
})
222+
213223

214224

215225
gulp.task('watch', function () {
@@ -252,6 +262,6 @@ gulp.task('watch', function () {
252262
// livereload: true
253263
// }));
254264

255-
gulp.task('build', ['js', 'templates', 'css', 'copy-index', 'libJS', 'libCSS', 'copy-fonts','copy-node','copy-docs','copy-icons','copy-static','gen-package']);
265+
gulp.task('build', ['js', 'templates', 'css', 'copy-index', 'libJS', 'libCSS', 'copy-fonts','copy-node','copy-docs','copy-icons','copy-static','gen-package', 'remove-redundant']);
256266

257267
gulp.task('default', [ 'build', 'watch']);

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@
2727
"babel-preset-es2015": "^6.24.1",
2828
"bootstrap": "3.3.6",
2929
"bower": "~1.7.9",
30+
"clipboard": "^1.7.1",
3031
"codemirror": "^5.19.0",
3132
"commander": "~2.9.0",
3233
"cross-env": "^3.1.4",
34+
"del": "^4.1.1",
3335
"electron": "1.8.4",
3436
"electron-packager": "7.1.0",
3537
"font-awesome": "^4.7.0",
@@ -55,8 +57,7 @@
5557
"spectron": "^3.7.2"
5658
},
5759
"dependencies": {
58-
"aliyun-sdk": "^1.12.0",
59-
"clipboard": "^1.7.1",
60+
"aliyun-sdk": "^1.12.3",
6061
"electron-log": "1.3.0",
6162
"koa": "^2.3.0",
6263
"koa-convert": "^1.2.0",

tools/.yarnclean

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
*.yaml
2+
*.md
3+
*.ts
4+
*.bak
5+
*.png
6+
*.jpg
7+
*.svg
8+
*.coffee
9+
*.map
10+
tsconfig.json
11+
LICENSE
12+
AUTHORS
13+
Makefile
14+
package-lock.json

0 commit comments

Comments
 (0)