-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2b97c6a
Showing
8 changed files
with
160 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,22 @@ | ||
gulp = require 'gulp' | ||
rename = require 'gulp-rename' | ||
bower = require 'bower' | ||
runSequence = require 'run-sequence' | ||
merge = require 'merge-stream' | ||
meta = require './package.json' | ||
|
||
$ = meta.gulpvar | ||
|
||
gulp.task 'bower', (cb) -> runSequence 'bower-update', 'bower-copy', cb | ||
|
||
gulp.task 'bower-install', -> bower.commands.install() | ||
|
||
gulp.task 'bower-update', -> bower.commands.update() | ||
|
||
gulp.task 'bower-copy', -> | ||
bowerSrc = | ||
for key, val of $.bowerMap | ||
gulp.src "./bower_components/#{val}" | ||
.pipe rename basename: key | ||
merge bowerSrc | ||
.pipe gulp.dest "#{$.bowerDist}/" |
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,17 @@ | ||
gulp = require 'gulp' | ||
browserify = require 'browserify' | ||
source = require 'vinyl-source-stream' | ||
streamify = require 'gulp-streamify' | ||
uglify = require 'gulp-uglify' | ||
meta = require './package.json' | ||
|
||
$ = meta.gulpvar | ||
|
||
gulp.task 'coffee', -> | ||
browserify | ||
entries: ["#{$.coffeeSrc}/index.coffee"] | ||
extensions: ['.coffee'] | ||
.bundle() | ||
.pipe source 'index.js' | ||
.pipe streamify uglify mangle: false# without mangling for AngularJS | ||
.pipe gulp.dest "#{$.coffeeDist}/" |
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,22 @@ | ||
gulp = require 'gulp' | ||
cssimport = require 'gulp-cssimport' | ||
autoprefixer = require 'gulp-autoprefixer' | ||
minifyCss = require 'gulp-minify-css' | ||
csslint = require 'gulp-csslint' | ||
notify = require 'gulp-notify' | ||
meta = require './package.json' | ||
|
||
$ = meta.gulpvar | ||
|
||
gulp.task 'css', -> | ||
gulp.src ["#{$.cssSrc}/style.css"] | ||
.pipe cssimport() | ||
.pipe autoprefixer 'last 2 versions' | ||
.pipe minifyCss keepSpecialComments: 0 | ||
.pipe gulp.dest "#{$.cssDist}/" | ||
|
||
gulp.task 'css-lint', -> | ||
gulp.src ["#{$.cssSrc}/**/*.css"] | ||
.pipe csslint() | ||
.pipe csslint.reporter() | ||
.pipe notify (file) -> "#{file.relative} (#{file.csslint.results.length} errors)" unless file.csslint.success |
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,23 @@ | ||
gulp = require 'gulp' | ||
runSequence = require 'run-sequence' | ||
requireDir = require 'require-dir' | ||
dir = requireDir './task' | ||
del = require 'del' | ||
browserSync = require 'browser-sync' | ||
reload = browserSync.reload | ||
meta = require './package.json' | ||
|
||
$ = meta.gulpvar | ||
|
||
gulp.task 'default', (cb) -> runSequence 'clean', ['coffee'], cb | ||
|
||
gulp.task 'clean', (cb) -> del [$.dist], -> cb() | ||
|
||
gulp.task 'watch', -> | ||
browserSync.init | ||
notify: false | ||
server: baseDir: "#{$.dist}/" | ||
o = debounceDelay: 3000 | ||
gulp.watch ["#{$.coffeeDist}/**/*.coffee"], o, ['coffee'] | ||
gulp.watch ["#{$.cssDist}/**/*.css"], o, ['css'] | ||
gulp.watch ["#{$.dist}/**/*.css", "#{$.dist}/**/*.html"], o, reload |
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,12 @@ | ||
gulp = require 'gulp' | ||
changed = require 'gulp-changed' | ||
replace = require 'gulp-replace' | ||
meta = require './package.json' | ||
|
||
$ = meta.gulpvar | ||
|
||
gulp.task 'html', -> | ||
gulp.src ["#{$.htmlSrc}/*.html"] | ||
.pipe changed "#{$.htmlDist}/" | ||
.pipe replace ".#{$.htmlDist}/js/", 'js/' | ||
.pipe gulp.dest "#{$.htmlDist}/" |
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,24 @@ | ||
gulp = require 'gulp' | ||
rename = require 'gulp-rename' | ||
sketch = require 'gulp-sketch' | ||
iconfont = require 'gulp-iconfont' | ||
consolidate = require 'gulp-consolidate' | ||
meta = require './package.json' | ||
|
||
$ = meta.gulpvar | ||
|
||
gulp.task 'icon', -> | ||
gulp.src "#{$.iconSrc}/#{$.iconName}.sketch}" | ||
.pipe sketch | ||
export: 'artboards' | ||
formats: 'svg' | ||
.pipe iconfont fontName: $.iconName | ||
.on 'codepoints', (codepoints) -> | ||
gulp.src "#{$.iconSrc}/#{$.iconTemplate}.*" | ||
.pipe consolidate 'lodash', | ||
glyphs: codepoints | ||
fontName: $.iconName | ||
className: $.iconClass | ||
.pipe rename basename: $.iconName | ||
.pipe gulp.dest "#{$.iconDist}/" | ||
.pipe gulp.dest "#{$.iconDist}/" |
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,28 @@ | ||
{ | ||
"name": "gulpfile", | ||
"description": "gulpfile for gulp.js", | ||
"author": "Tsutomu Kawamura <[email protected]>", | ||
"license": "MIT", | ||
"private": true, | ||
"gulpvar": { | ||
"src": "./src", | ||
"dist": "./dist", | ||
"bowerDist": "./dist/js", | ||
"bowerMap": { | ||
"parse": "parse/index.js", | ||
"angular": "angular/angular.min.js" | ||
}, | ||
"coffeeDist": "./dist/coffee", | ||
"coffeeSrc": "./src/coffee", | ||
"cssDist": "./dist/css", | ||
"cssSrc": "./src/css", | ||
"htmlDist": "./dist", | ||
"htmlSrc": "./src", | ||
"iconClass": "mi", | ||
"iconDist": "./dist/font", | ||
"iconSrc": "./src/icon", | ||
"iconTemplate": "fontawesome-style", | ||
"parseDist": "./cloud", | ||
"parseSrc": "./src/parse" | ||
} | ||
} |
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,12 @@ | ||
gulp = require 'gulp' | ||
coffee = require 'gulp-coffee' | ||
changed = require 'gulp-changed' | ||
meta = require './package.json' | ||
|
||
$ = meta.gulpvar | ||
|
||
gulp.task 'parse', -> | ||
gulp.src ["#{$.parseSrc}/**/*.coffee"] | ||
.pipe changed "#{$.parseDist}/" | ||
.pipe coffee bare: true | ||
.pipe gulp.dest "#{$.parseDist}/" |