Skip to content

Instantly share code, notes, and snippets.

Last active February 24, 2020 00:42
What would you like to do?
npm install -D gulp browserify babelify @babel/core @babel/preset-env vinyl-source-stream vinyl-buffer gulp-uglify gulp-htmlmin cssnano gulp-postcss del
const gulp = require("gulp");
const browserify = require("browserify");
const source = require("vinyl-source-stream");
const buffer = require("vinyl-buffer");
const babelify = require("babelify");
const uglify = require("gulp-uglify");
const htmlmin = require("gulp-htmlmin");
const postcss = require("gulp-postcss");
const cssnano = require("cssnano");
const del = require("del");
const paths = {
source: "./src",
build: "./build"
function javascriptBuild() {
return browserify({
entries: [`${paths.source}/scripts/main.js`],
transform: [babelify.configure({ presets: ["@babel/preset-env"] })]
function htmlBuild() {
return gulp
function cssBuild() {
return gulp
function cleanup() {
return del([]);
// Run using gulp or gulp build
exports.default = = gulp.series(
gulp.parallel(javascriptBuild, htmlBuild, cssBuild)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment