diff --git a/Gulpfile.coffee b/Gulpfile.coffee index 4ad5430..5424b75 100644 --- a/Gulpfile.coffee +++ b/Gulpfile.coffee @@ -10,25 +10,23 @@ sass = require('gulp-sass') uglify = require('gulp-uglify') buffer = require('vinyl-buffer') zip = require('gulp-zip') -_ = require('lodash') concat = require('gulp-concat') reload = browserSync.reload html = (target) -> return () -> - return gulp.src(['html/index.html','html/en.html']) - .pipe(gulp.dest(target)); + return gulp.src(['html/index.html']).pipe(gulp.dest(target)) +# Images img = (target) -> return () -> - return gulp.src(['img/*.png', 'img/*.jpeg', 'img/*.jpg']) - .pipe(gulp.dest(target)); + return gulp.src(['img/*.png', 'img/*.jpeg', 'img/*.jpg']).pipe(gulp.dest(target)) +# Audio assets audio = (target) -> return () -> - return gulp.src(['audio/*.mp3']) - .pipe(gulp.dest(target)); + return gulp.src(['audio/*.mp3']).pipe(gulp.dest(target)) gulp.task('html', html('./build')) gulp.task('img', img('./build/img')) @@ -37,21 +35,14 @@ gulp.task('audio', audio('./build/audio')) gulp.task('sass', () -> gulp.src('sass/main.scss') .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError)) - .pipe(gulp.dest('./build/css')); + .pipe(gulp.dest('./build/css')) ) -sources = [ - './game/begin.coffee', - './game/story.coffee', - './game/init.coffee', -] - -opts = _.assign({}, watchify.args, { +bundler = watchify(browserify({ entries: ["./build/game/main.coffee"] debug: true transform: [coffeify] -}); -bundler = watchify(browserify(opts)) +})) bundle = () -> return bundler.bundle() @@ -60,15 +51,16 @@ bundle = () -> .pipe(gulp.dest('./build/game')) gulp.task('concatCoffee', () -> - return gulp.src(sources) - .pipe(concat('./main.coffee')) - .pipe(gulp.dest('./build/game')) + return gulp.src([ + './game/begin.coffee', + './game/story.coffee', + ]).pipe(concat('./main.coffee')).pipe(gulp.dest('./build/game')) ) gulp.task('coffee', ['concatCoffee'], bundle) -bundler.on('update', bundle); -bundler.on('log', gutil.log); +bundler.on('update', bundle) +bundler.on('log', gutil.log) gulp.task('build', ['html', 'img', 'sass', 'coffee', 'audio']) @@ -85,7 +77,6 @@ gulp.task('serve', ['build'], () -> gulp.watch(['./html/*.html'], ['html']) gulp.watch(['./sass/*.scss'], ['sass']) gulp.watch(['./img/*.png', './img/*.jpeg', './img/*.jpg'], ['img']) - gulp.watch(['./lib/*.coffee', './lib/*.js', './game/*.coffee'], ['coffee']) gulp.watch(['./build/css/main.css'], sassListener) gulp.watch( @@ -93,25 +84,25 @@ gulp.task('serve', ['build'], () -> browserSync.reload) ) -gulp.task('html-dist', html('./dist')); -gulp.task('img-dist', img('./dist/img')); -gulp.task('audio-dist', audio('./dist/audio')); +gulp.task('html-dist', html('./dist')) +gulp.task('img-dist', img('./dist/img')) +gulp.task('audio-dist', audio('./dist/audio')) gulp.task('legal-dist', () -> return gulp.src(['LICENSE.txt']) - .pipe(gulp.dest("./dist")); -); + .pipe(gulp.dest("./dist")) +) gulp.task('sass-dist', () -> return gulp.src('./sass/main.scss') .pipe(sass({outputStyle: 'compressed'})) - .pipe(gulp.dest('./dist/css')); -); + .pipe(gulp.dest('./dist/css')) +) distBundler = browserify({ debug: false, entries: ['./build/game/main.coffee'], transform: ['coffeeify'] -}); +}) gulp.task('coffee-dist', ['concatCoffee'], () -> return distBundler.bundle() @@ -119,13 +110,20 @@ gulp.task('coffee-dist', ['concatCoffee'], () -> .pipe(buffer()) .pipe(uglify()) .on('error', gutil.log) - .pipe(gulp.dest('./dist/game')); -); + .pipe(gulp.dest('./dist/game')) +) -gulp.task('dist', ['html-dist', 'img-dist', 'sass-dist', 'coffee-dist', 'audio-dist', 'legal-dist']); +gulp.task('dist', [ + 'html-dist', + 'img-dist', + 'sass-dist', + 'coffee-dist', + 'audio-dist', + 'legal-dist' +]) gulp.task('zip', ['dist'], () -> return gulp.src('dist/**') .pipe(zip('dist.zip')) - .pipe(gulp.dest('.')); -); + .pipe(gulp.dest('.')) +) diff --git a/package.json b/package.json index 01258b2..f1ee3df 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ "gulp-zip": "^3.0.2", "gulp-concat": "^2.6.0", "gulp-sass": "^2.1.1", - "lodash": "^3.6.0", "vinyl-buffer": "^1.0.0", "vinyl-source-stream": "^1.1.0", "watchify": "^3.1.0" diff --git a/sass/bootstrap b/sass/bootstrap index 643bd8e..6384789 160000 --- a/sass/bootstrap +++ b/sass/bootstrap @@ -1 +1 @@ -Subproject commit 643bd8eaeb7a2a692fec3add22a3b61eff0fb62c +Subproject commit 6384789f952c297356a94aded5900d199d09ae87