From 268b3e9a1e440d6bb0d7bf5aee6b54b9791cef00 Mon Sep 17 00:00:00 2001 From: Florent Cailhol Date: Thu, 14 Aug 2014 09:09:20 +0200 Subject: [PATCH] Add `bundle-collapser` --- CHANGELOG.md | 11 +++++++++++ gulpfile.js | 10 +++++++--- package.json | 11 ++++++----- 3 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..fdbacf4 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,11 @@ +# 1.0.0 + +- Updated dependencies +- Added [`bundle-collapser`](https://github.com/substack/bundle-collapser) to better compress `browserify`-d JavaScript +- Added `CHANGELOG.md` +- Fix watching on LESS files + + +# 0.1.0 + +- First release diff --git a/gulpfile.js b/gulpfile.js index 2b204d4..ecf86b0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -30,7 +30,7 @@ program.on('--help', function(){ program .usage(' [options]') - .option('-p, --prod', 'generate production assets') + .option('-P, --prod', 'generate production assets') .parse(process.argv); var prod = !!program.prod; @@ -42,8 +42,12 @@ gulp.task('default', function() { gulp.task('build', ['build_source', 'build_index', 'build_styles']); gulp.task('build_source', function() { - return browserify() - .add('./src/main.js') + var bundler = browserify('./src/main', {debug: !prod}); + if (prod) { + bundler.plugin(require('bundle-collapser/plugin')); + } + + return bundler .bundle() .on('error', browserifyError) .pipe(source('build.js')) diff --git a/package.json b/package.json index 935fdb7..67951fb 100644 --- a/package.json +++ b/package.json @@ -1,28 +1,29 @@ { "private": true, "name": "js13k-boilerplate", - "version": "0.1.0", + "version": "1.0.0", "description": "JS13KGames boilerplate", "author": "Florent Cailhol ", "license": "MIT", "repository": "ooflorent/js13k-boilerplate", "devDependencies": { - "browserify": "^5.9.1", + "browserify": "^5.10.0", + "bundle-collapser": "^1.1.0", "chalk": "^0.5.1", "commander": "^2.3.0", - "gulp": "^3.8.6", + "gulp": "^3.8.7", "gulp-buffer": "0.0.2", "gulp-concat": "^2.3.4", "gulp-cssmin": "^0.1.6", "gulp-eslint": "^0.1.8", "gulp-htmlmin": "^0.1.3", "gulp-if": "^1.2.4", - "gulp-less": "^1.3.2", + "gulp-less": "^1.3.3", "gulp-micro": "^1.0.0", "gulp-size": "^1.0.0", "gulp-uglify": "^0.3.1", "gulp-util": "^3.0.0", - "gulp-zip": "^0.4.0", + "gulp-zip": "^1.0.0", "rimraf": "^2.2.8", "vinyl-source-stream": "^0.1.1" }