Skip to content

Commit 7460e62

Browse files
committed
add gulpfile to compress production version , fixed #2
1 parent 8fddd39 commit 7460e62

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

dist/qin.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
var gulp = require('gulp'),
2+
uglify = require('gulp-uglify');
3+
4+
var paths = {
5+
js: ['qin.js']
6+
}
7+
8+
gulp.task('compress', function() {
9+
gulp.src('qin.js')
10+
.pipe(uglify())
11+
.pipe(gulp.dest('dist'))
12+
});
13+
14+
gulp.task('default', function() {
15+
gulp.watch(paths.js, ['compress'])
16+
})
17+

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"devDependencies": {
2626
"chai": "^1.9.2",
2727
"gulp": "*",
28+
"gulp-uglify": "^1.0.1",
2829
"mocha": "^1.21.4",
2930
"mocha-phantomjs": "^3.5.0",
3031
"phantomjs": "^1.9.10"

qin.js

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
;
77
(function(document, window) {
88

9-
109
var node = Node.prototype,
1110
trigger = 'trigger',
1211
// 兼容firefox, firefox下创建元素需要一个字符串作为参数

0 commit comments

Comments
 (0)