-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
142 lines (121 loc) · 3.5 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#global module:false
module.exports = (grunt) ->
"use strict"
require('time-grunt')(grunt)
grunt.initConfig
compass:
clean:
options:
bundleExec: true
clean: true
dev:
options:
bundleExec: true
debugInfo: false
build:
options:
bundleExec: true
environment: "production"
outputStyle: "compressed"
noLineComments: true
imagesDir: "assets/images"
fontsDir: "assets/fonts"
concat:
dist:
src: [
'src/scripts/bower_components/jquery/dist/jquery.js',
'src/scripts/bower_components/three.js/three.js',
'src/scripts/bower_components/js-signals/dist/signals.js',
'src/scripts/bower_components/lodash/dist/lodash.js',
'src/scripts/bower_components/gsap/src/uncompressed/TweenMax.js',
'src/scripts/vendors/TweenTime/dist/scripts/TweenTime.Core.js'
],
dest: 'assets/scripts/vendors.min.js'
htmlmin:
dist:
options:
removeComments: true,
collapseWhitespace: true,
minifyJS: true
files:
'index.html': 'src/index.html'
uglify:
dist:
files:
'assets/scripts/vendors.min.js': ['assets/scripts/vendors.min.js']
webpack:
main: require('./webpack.config.js')
watch:
html:
files: ["src/index.html"]
tasks: ["htmlmin"]
sass:
files: ["src/styles/**"]
tasks: ["compass:dev"]
reloadcss:
options: {livereload: true}
files: ["assets/styles/*.css"]
compilejs:
files: ["src/scripts/**", "!src/scripts/bower_components/**", "!src/scripts/vendors/**"]
tasks: ["webpack"]
reloadjs:
options: {livereload: true}
files: ["assets/scripts/**"]
reloadhtml:
options: {livereload: true}
files: ["**.html"]
clean:
build: ["assets/images/"]
copy:
main:
files: [
expand: true
src: ["**"]
cwd: "src/images/"
dest: "assets/images/"
,
expand: true
src: ["**"]
cwd: "src/fonts/"
dest: "assets/fonts/"
,
expand: true
src: ["src/scripts/vendors/modernizr.js"]
dest: "assets/scripts/vendors/"
,
expand: true
src: ["src/scripts/app.js"]
dest: "assets/scripts/"
]
imagemin:
build:
options:
optimizationLevel: 7
progressive: true
files: [
expand: true
cwd: "assets/images/"
src: ["**.png", "*/**.png"]
dest: "assets/images/"
,
expand: true
cwd: "assets/images/"
src: ["**.jpg", "*/**.jpg"]
dest: "assets/images/"
]
notify:
build:
options: {message: "Build complete"}
browserSync:
bsFiles:
src : ['assets/scripts/*.js', 'assets/styles/*.css']
options:
watchTask: true
server:
baseDir: "./"
# Load necessary plugins
require('jit-grunt')(grunt)
grunt.registerTask "init", ["compass:clean", "compass:dev"]
grunt.registerTask "default", ['browserSync', 'htmlmin', "compass:clean", "compass:dev", "webpack", "watch"]
grunt.registerTask "buildVendors", ['concat', 'uglify']
grunt.registerTask "build", ["clean", 'htmlmin', "compass:clean", "copy", "imagemin", "compass:build", "webpack", 'buildVendors', "notify:build"]