Created
May 24, 2016 19:36
-
-
Save chrsgrffth/4492b545f108968fe97a5bf39a49cebd to your computer and use it in GitHub Desktop.
Gulpfile/package.json for Browserify (with Coffeescript)
This file contains hidden or 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
'use strict'; | |
var gulp = require('gulp'), | |
sass = require('gulp-sass'), | |
sassGlob = require('gulp-sass-glob'), | |
concat = require('gulp-concat'), | |
browserify = require('browserify'), | |
coffeeify = require('coffeeify'), | |
uglify = require('gulp-uglify'), | |
notify = require('gulp-notify'), | |
resolutions = require('browserify-resolutions'), | |
buff = require('vinyl-buffer'), // to transform the browserify results into a 'stream' | |
source = require('vinyl-source-stream'), | |
sourcemaps = require('gulp-sourcemaps'), | |
// Name of the theme (for Statamic). | |
theme = 'ink'; | |
gulp.task('scripts', function() { | |
browserify({ | |
entries: ['./coffee/ink.coffee'], | |
debug: true, | |
extensions: ['coffee'], | |
transform: ['coffeeify'] | |
}) | |
.bundle() | |
.pipe(source(theme + '.js')) | |
.pipe(buff()) | |
.pipe(sourcemaps.init({ | |
loadMaps: true, | |
debug: true | |
})) | |
.pipe(uglify()) | |
.pipe(sourcemaps.write('./')) | |
.pipe(gulp.dest('./js')) | |
.pipe(notify(theme + '.js compiled.')); | |
}) | |
gulp.task('default', ['scripts'], function() { | |
gulp.watch('coffee/**', ['scripts']); | |
}); |
This file contains hidden or 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
{ | |
"private": true, | |
"dependencies": { | |
}, | |
"devDependencies": { | |
"browserify": "^13.0.1", | |
"browserify-resolutions": "^1.1.0", | |
"coffeeify": "^2.0.1", | |
"gulp": "^3.9.1", | |
"gulp-browserify": "^0.5.1", | |
"gulp-coffeeify": "^0.1.8", | |
"gulp-concat": "^2.6.0", | |
"gulp-notify": "^2.2.0", | |
"gulp-sass": "^2.3.1", | |
"gulp-sass-glob": "^1.0.6", | |
"gulp-sourcemaps": "^1.6.0", | |
"gulp-uglify": "^1.5.3", | |
"vinyl-buffer": "^1.0.0", | |
"vinyl-source-stream": "^1.1.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment