-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added gulp for es6 transpiling * ♻️ Added minify css and html tasks
- Loading branch information
1 parent
1566ae3
commit aa16a39
Showing
4 changed files
with
5,190 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
const gulp = require("gulp"); | ||
const uglify = require("gulp-uglify"); | ||
const babel = require("gulp-babel"); | ||
let cleanCSS = require("gulp-clean-css"); | ||
const htmlmin = require("gulp-htmlmin"); | ||
const del = require("del"); | ||
|
||
gulp.task("clean", done => { | ||
del.sync("build/**/*"); | ||
done(); | ||
}); | ||
|
||
gulp.task("minify-scripts", done => { | ||
gulp | ||
.src(["*.js", "!gulpfile.js"]) | ||
.pipe( | ||
babel({ | ||
presets: ["@babel/preset-env"] | ||
}) | ||
) | ||
.pipe(uglify()) | ||
.pipe(gulp.dest("build")); | ||
done(); | ||
}); | ||
|
||
gulp.task("minify-css", done => { | ||
gulp | ||
.src("*.css") | ||
.pipe(cleanCSS()) | ||
.pipe(gulp.dest("build")); | ||
done(); | ||
}); | ||
|
||
gulp.task("minify-html", done => { | ||
gulp | ||
.src("*.html") | ||
.pipe(htmlmin({ collapseWhitespace: true })) | ||
.pipe(gulp.dest("build")); | ||
done(); | ||
}); | ||
|
||
gulp.task("copy", done => { | ||
gulp | ||
.src(["manifest.json", "images/**/*", "Roboto/**/*", "utils/**/*"], { | ||
base: "." | ||
}) | ||
.pipe(gulp.dest("build")); | ||
done(); | ||
}); | ||
|
||
gulp.task( | ||
"default", | ||
gulp.series( | ||
"clean", | ||
"minify-scripts", | ||
"minify-css", | ||
"minify-html", | ||
"copy", | ||
done => done() | ||
) | ||
); |
Oops, something went wrong.