forked from opencloset/opencloset
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.coffee
More file actions
105 lines (92 loc) · 2.65 KB
/
Gruntfile.coffee
File metadata and controls
105 lines (92 loc) · 2.65 KB
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
module.exports = (grunt) ->
'use strict'
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
# Task configuration
clean:
dist: ['coffee/js', 'public/js', 'public/css']
coffee:
dist:
expand: true
cwd: 'coffee'
src: ['*.coffee']
dest: 'coffee/js'
ext: '.js'
dump_dir:
options:
pre: 'window.pdfMake = window.pdfMake || {}; window.pdfMake.vfs = '
rootPath: 'pdfmake/'
dist:
files:
'public/components/pdfmake/build/vfs_fonts_custom.js': [ 'pdfmake/*' ]
uglify:
options:
mangle: true
preserveComments: 'some'
dist:
expand: true
cwd: 'coffee/js'
src: ['**/*.js', '!**/*.min.js']
dest: 'public/js'
# ext: '.min.js'
jst:
expand: true
cwd: 'public/js'
src: ['templates.js']
dest: 'public/js'
csscomb:
options:
config: 'less/.csscomb.json'
dist:
expand: true
cwd: 'public/css'
src: ['*.css', '!*.min.css']
dest: 'public/css'
cssmin:
options:
compatibility: 'ie8'
keepSpecialComments: '*'
advanced: false
dist:
expand: true
cwd: 'public/css'
src: ['*.css', '!*.min.css']
dest: 'public/css'
ext: '.min.css'
less:
dist:
options:
strictMath: true
sourceMap: true
outputSourceFiles: true
expand: true
cwd: 'less'
src: ['*.less']
dest: 'public/css'
ext: '.css'
handlebars:
options:
namespace: 'JST'
processName: (path) ->
path.replace(/^public\/jst\//, '').replace(/\.hbs$/, '').replace(/\.html$/, '').replace(/\.jst$/, '')
compile:
files:
'public/js/templates.js': ['public/jst/**/*.hbs', 'public/jst/**/*.html', 'public/jst/**/*.jst']
watch:
coffee:
files: 'coffee/*.coffee'
tasks: ['dist-js']
less:
files: 'less/*.less'
tasks: ['dist-css']
jst:
files: ['public/jst/**/*.hbs', 'public/jst/**/*.html', 'public/jst/**/*.jst']
tasks: ['dist-template']
require('load-grunt-tasks')(grunt, { scope: 'devDependencies' })
require('time-grunt')(grunt)
grunt.registerTask('dist-js', ['coffee:dist', 'dump_dir:dist', 'uglify:dist'])
grunt.registerTask('dist-css', ['less:dist', 'csscomb:dist', 'cssmin:dist'])
grunt.registerTask('dist-template', ['handlebars:compile', 'uglify:jst'])
grunt.registerTask('dist', ['clean', 'dist-template', 'dist-js', 'dist-css'])
# Default task
grunt.registerTask('default', ['dist'])