forked from idflood/ThreeNodes.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
119 lines (106 loc) · 3.06 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
#global module:false
module.exports = (grunt) ->
"use strict"
grunt.initConfig
compass:
clean:
options:
clean: true
dev:
options:
debugInfo: false
bundleExec: true
build:
options:
environment: "production"
outputStyle: "compressed"
noLineComments: true
imagesDir: "assets/images"
fontsDir: "assets/fonts"
bundleExec: true
# https://github.com/jrburke/r.js/blob/master/build/example.build.js
requirejs:
compile:
options:
baseUrl: 'src/scripts'
mainConfigFile: 'src/scripts/require-config.js'
name: "boot"
out: "assets/scripts/boot.js"
#optimize: "uglify2"
optimize: "none"
inlineText: true
preserveLicenseComments: false
include: "requireLib"
paths:
requireLib: "libs/require/require"
exclude: ['coffee-script']
stubModules: ['cs']
pragmasOnSave:
excludeCoffeeScript: true
watch:
sass:
files: ["src/styles/**"]
tasks: ["compass:dev"]
reloadcss:
options: {livereload: true}
files: ["assets/styles/*.css"]
reloadjs:
options: {livereload: true}
files: ["src/scripts/**", "!src/scripts/bower_components/**"]
reloadhtmlphp:
options: {livereload: true}
files: ["**.php", "**.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"}
# Load necessary plugins
grunt.loadNpmTasks "grunt-contrib-watch"
grunt.loadNpmTasks "grunt-contrib-compass"
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-contrib-imagemin"
grunt.loadNpmTasks "grunt-contrib-copy"
grunt.loadNpmTasks "grunt-contrib-clean"
grunt.loadNpmTasks "grunt-contrib-requirejs"
grunt.loadNpmTasks "grunt-notify"
grunt.registerTask "init", ["compass:clean", "compass:dev"]
grunt.registerTask "default", ["compass:clean", "compass:dev", "watch"]
grunt.registerTask "build", ["clean", "compass:clean", "copy", "imagemin", "compass:build", "requirejs", "notify:build"]