Skip to content
This repository was archived by the owner on Jul 15, 2021. It is now read-only.

Commit d31e03c

Browse files
committed
chore: add minify version
- setup gulp - setup necessary plugins to get the minified version - update the demo to user the minified version - update travis node version to work with gulp
1 parent 8d509e7 commit d31e03c

File tree

5 files changed

+26
-5
lines changed

5 files changed

+26
-5
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: node_js
22
node_js:
3-
- 0.8
3+
- 0.10
44
before_script:
55
- export DISPLAY=:99.0
6-
- sh -e /etc/init.d/xvfb start
6+
- sh -e /etc/init.d/xvfb start

demo.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h1>cn.offCanvas</h1>
2828
</div>
2929

3030
<script src="bower_components/angular/angular.js"></script>
31-
<script src="off-canvas.js"></script>
31+
<script src="off-canvas.min.js"></script>
3232
<script>
3333
angular.module('demoApp', ['cn.offCanvas'])
3434
.factory('demoOffCanvas', function(cnOffCanvas) {
@@ -41,4 +41,4 @@ <h1>cn.offCanvas</h1>
4141
})
4242
</script>
4343
</body>
44-
</html>
44+
</html>

gulpfile.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
var gulp = require('gulp');
2+
var ngmin = require('gulp-ngmin');
3+
var rename = require('gulp-rename');
4+
var uglify = require('gulp-uglify');
5+
6+
var paths = {
7+
scripts: ['off-canvas.js']
8+
}
9+
10+
gulp.task('default', function() {
11+
return gulp.src(paths.scripts)
12+
.pipe(ngmin())
13+
.pipe(rename({suffix: '.min'}))
14+
.pipe(uglify({mangle: false}))
15+
.pipe(gulp.dest('.'));
16+
});

off-canvas.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
"karma-chrome-launcher": "~0.1.2",
3030
"karma-ie-launcher": "~0.1.1",
3131
"karma-firefox-launcher": "~0.1.3",
32-
"karma-junit-reporter": "~0.2.1"
32+
"karma-junit-reporter": "~0.2.1",
33+
"gulp": "~3.5.6",
34+
"gulp-ngmin": "~0.1.2",
35+
"gulp-rename": "~1.2.0",
36+
"gulp-uglify": "~0.2.1"
3337
}
3438
}

0 commit comments

Comments
 (0)