-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.coffee
94 lines (81 loc) · 2.21 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
module.exports = (grunt) ->
# Project configuration.
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
config:
src: 'assets/coffee'
dest: 'assets/js'
clean:
build:
src: ['<%= config.dest %>/*', '!<%= config.dest %>/vendor']
notify:
watch:
options:
title: "Watch",
message: "Watch compile completed"
compass:
app:
options:
sassDir: 'assets/css'
cssDir: 'assets/css'
imagesDir: 'assets/img'
fontsDir: 'assets/fonts'
httpPath: "/"
relativeAssets: true
boring: true
debugInfo: true
outputStyle: 'compressed'
# enable_sourcemaps: true
raw: '{:preferred_syntax => :sass, :sourcemap => true}\n'
require: []
'jsmin-sourcemap':
all:
src: ['<%= config.dest %>/main.js']
dest: '<%= config.dest %>/main.min.js'
destMap: '<%= config.dest %>/main.js.map'
srcRoot: '../..'
coffee:
app:
options:
sourceMap: true
bare: false
join: true
files:
'<%= config.dest %>/main.js': ['<%= config.src %>/**/*.coffee']
# jshint:
# app:
# options:
# boss: true
# expr: true
# eqnull: true
# files:
# src: '<%= config.dest %>/main.js'
imagemin:
dist:
options:
optimizationLevel: 3
files: [
expand: true,
cwd: "assets/img/",
src: "**/*.{png,jpg,jpeg}"
dest: "assets/img/"
]
watch:
options:
spawn: false
interrupt: true
atBegin: true
interval: 500
app:
files: ['<%= config.src %>/**/*.coffee']
tasks: ['any-newer:coffee']
sass:
files: ['assets/css/*.sass']
tasks: ['compass']
concurrent:
compile: ['compass', 'coffee', 'jsmin-sourcemap']
optimize: ['imagemin']
require('matchdep').filterDev('grunt-*').forEach grunt.loadNpmTasks
# Tasks
grunt.registerTask 'default', ['concurrent:compile']
grunt.registerTask 'production', ['clean', 'concurrent:compile', 'concurrent:optimize']