Skip to content

Commit

Permalink
Use Gulp to do the minification
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuyifei1999 committed Oct 5, 2016
1 parent 5d102a5 commit 9fb6346
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*~
/config.py
*.pyc
/node_modules/
22 changes: 22 additions & 0 deletions Gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* eslint-env node */
var gulp = require( 'gulp' );
var uglify = require( 'gulp-uglify' );
var rename = require( 'gulp-rename' );

gulp.task( 'scripts', function() {
return gulp
.src( [ './video2commons/frontend/static/*.js', '!./video2commons/frontend/static/*.min.js' ] )
.pipe( rename( { suffix: '.min' } ) )
.pipe( uglify() )
.pipe( gulp.dest( './video2commons/frontend/static/' ) );
} );

gulp.task( 'watch', function() {
var changeevent = function( event ) {
console.log( 'File ' + event.path + ' was ' + event.type + ', running tasks...' );
};
gulp.watch( [ './video2commons/frontend/static/*.js', '!./video2commons/frontend/static/*.min.js' ], [ 'scripts' ] )
.on( 'change', changeevent );
} );

gulp.task( 'default', [ 'scripts', 'watch' ] );
24 changes: 24 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "video2commons",
"version": "1.0.0",
"description": "Transfer video and audio from external sites to Commons. Video2commons is available for everyone (uses OAuth) via Wikimedia Commons.",
"main": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Toollabs/video2commons.git"
},
"author": "",
"license": "GPL-3.0",
"bugs": {
"url": "https://github.com/Toollabs/video2commons/issues"
},
"homepage": "https://github.com/Toollabs/video2commons#readme",
"devDependencies": {
"gulp": "^3.9.1",
"gulp-rename": "^1.2.2",
"gulp-uglify": "^2.0.0"
}
}
Loading

0 comments on commit 9fb6346

Please sign in to comment.