Skip to content

Commit

Permalink
Added build process for Javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
ava-cassiopeia committed Jan 18, 2017
1 parent 6d49de6 commit 395591a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />

<script src="../src/ToastController.js"></script>
<script src="../dist/js/ToastController.min.js"></script>

<style>
body{
Expand Down
11 changes: 10 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
var gulp = require("gulp");
var sass = require("gulp-sass");
var rename = require("gulp-rename");
var uglify = require("gulp-uglify");

gulp.task("default", ["build-css"], function() {});
gulp.task("default", ["build-css", "build-js"], function() {});

gulp.task("build-css", function() {
return gulp.src(["sass/*.scss"])
Expand All @@ -13,6 +14,14 @@ gulp.task("build-css", function() {
.pipe(gulp.dest("dist/css/"));
});

gulp.task("build-js", function() {
return gulp.src(["src/*.js"])
.pipe(uglify())
.pipe(rename("ToastController.min.js"))
.pipe(gulp.dest("dist/js/"));
});

gulp.task("watch", function() {
gulp.watch(["sass/*.scss"], ["build-css"]);
gulp.watch(["src/*.js"], ["build-js"]);
});
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"devDependencies": {
"gulp": "^3.9.1",
"gulp-rename": "^1.2.2",
"gulp-sass": "^3.0.0"
"gulp-sass": "^3.0.0",
"gulp-uglify": "^2.0.0"
}
}

0 comments on commit 395591a

Please sign in to comment.