-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
91 lines (78 loc) · 2.12 KB
/
Gruntfile.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
module.exports = (g) ->
g.initConfig
clean: ['public']
stylus:
compile:
options:
compress: process.env['DEBUG'] || false
paths: ['src/css']
urlfunc: { name: 'url', limit: 1000000 }
"include css": true
files:
'build/css/style.css': 'src/css/style.styl'
preprocess:
js:
src: 'public/js/app.js'
options:
inline: true
context:
DEBUG: process.env['DEBUG'] || false
html:
src: 'public/**/*.html'
options:
inline: true
context:
DEBUG: process.env['DEBUG'] || false
inline:
dist:
options:
cssmin: true
uglify: true
src: ['build/index.html']
dest: 'tumblr_build/'
uglify:
js:
files:
'build/js/app.min.js': ['build/js/app.js']
assemble:
site:
options:
partials: 'src/partials/**/*.hbs'
flatten: true
src: ['src/*.hbs']
dest: './build/'
browserify:
dist:
files:
'build/js/app.js': ['./src/js/**/*.js']
browserSync:
bsFiles:
src : './src/css/*.css'
options:
server:
baseDir: "./build/"
watch:
hbs:
files: ['src/**/*.hbs']
tasks: ['html']
css:
files: ['src/css/**/**.styl']
tasks: 'css'
js:
files: ['src/js/**/*.js']
tasks: 'browserify'
g.registerTask 'default', ['build', 'watch']
g.registerTask 'html', ['assemble','preprocess:html']
g.registerTask 'build', ['clean', 'html', 'css', 'js']
g.registerTask 'tumblr', ['build','inline']
g.registerTask 'css', 'stylus'
g.registerTask 'js', ['browserify','preprocess:js','uglify']
g.registerTask 'watch', ['browserSync']
g.loadNpmTasks 'grunt-contrib-clean'
g.loadNpmTasks 'grunt-contrib-stylus'
g.loadNpmTasks 'grunt-contrib-uglify'
g.loadNpmTasks 'grunt-browserify'
g.loadNpmTasks 'grunt-browser-sync'
g.loadNpmTasks 'grunt-preprocess'
g.loadNpmTasks 'grunt-inline'
g.loadNpmTasks 'assemble';