Skip to content

Commit

Permalink
Merge pull request #274 from aliyun/fix/cleanfile
Browse files Browse the repository at this point in the history
chore: remove useless file
  • Loading branch information
luozhang002 authored Nov 19, 2019
2 parents dda4b2f + 150cf82 commit a7a9606
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
24 changes: 17 additions & 7 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var plugins = require("gulp-load-plugins")({lazy: false});
var fs = require('fs');
var path = require('path');
var os =require('os');
var del = require('del');
var minimist = require('minimist')
//var NwBuilder = require('nw-builder');
//var pkg = require('./package');
Expand Down Expand Up @@ -178,17 +179,19 @@ gulp.task('copy-static', function () {
// });

gulp.task('copy-index', function () {
gulp.src(['./app/index.html',
return gulp.src(['./app/index.html',
'./main.js',
'./server.js',
'./vendor/*.js',
'./release-notes.md'])
'./release-notes.md',
'./tools/.yarnclean'
])
.pipe(gulp.dest(DIST));
});

gulp.task('gen-package', function () {
gulp.src(['./package.json'])
.on('end', function(){
gulp.task('gen-package', ['copy-index'], function () {
return gulp.src(['./package.json'])
.on('end', function(cb){
var info = require('./package');

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

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

gulp.task('remove-redundant', ['gen-package'], function (cb) {
return del.sync([
'dist/node_modules/protobufjs/dist',
'dist/node_modules/aliyun-sdk/dist'
]);
})



gulp.task('watch', function () {
Expand Down Expand Up @@ -252,6 +262,6 @@ gulp.task('watch', function () {
// livereload: true
// }));

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

gulp.task('default', [ 'build', 'watch']);
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
"babel-preset-es2015": "^6.24.1",
"bootstrap": "3.3.6",
"bower": "~1.7.9",
"clipboard": "^1.7.1",
"codemirror": "^5.19.0",
"commander": "~2.9.0",
"cross-env": "^3.1.4",
"del": "^4.1.1",
"electron": "1.8.4",
"electron-packager": "7.1.0",
"font-awesome": "^4.7.0",
Expand All @@ -55,8 +57,7 @@
"spectron": "^3.7.2"
},
"dependencies": {
"aliyun-sdk": "^1.12.0",
"clipboard": "^1.7.1",
"aliyun-sdk": "^1.12.3",
"electron-log": "1.3.0",
"koa": "^2.3.0",
"koa-convert": "^1.2.0",
Expand Down
14 changes: 14 additions & 0 deletions tools/.yarnclean
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*.yaml
*.md
*.ts
*.bak
*.png
*.jpg
*.svg
*.coffee
*.map
tsconfig.json
LICENSE
AUTHORS
Makefile
package-lock.json

0 comments on commit a7a9606

Please sign in to comment.