-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
79 lines (72 loc) · 2.63 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
module.exports = (grunt) ->
grunt.initConfig
# =============================================
# VARIABLES
# =============================================
ScssDirectory: 'resources/scss'
CoffeeDirectory: 'resources/coffee'
ResourcesDirectory: 'resources'
# =============================================
# WATCH FOR CHANGE
# =============================================
watch:
css:
files: ['<%= ScssDirectory %>/**/*']
tasks: ['sass']
scripts:
files: ['<%= CoffeeDirectory %>/*']
tasks: ['coffee']
options:
livereload: false
# =============================================
# SASS COMPILE
# =============================================
# https://github.com/gruntjs/grunt-contrib-sass
# =============================================
sass:
compile:
options:
compress: false
sourcemap: 'none' # none, file, inline, none
style: 'nested' # nested, compact, compressed, expanded
files:
'<%= ResourcesDirectory %>/css/formbuilder2.css': '<%= ScssDirectory %>/formbuilder2.scss',
# =============================================
# COFFEE COMPILING
# =============================================
# https://github.com/gruntjs/grunt-contrib-coffee
# =============================================
coffee:
options:
join: true
bare: true
compile:
files:
'<%= ResourcesDirectory %>/js/formbuilder2.js': ['<%= CoffeeDirectory %>/formbuilder2.coffee']
'<%= ResourcesDirectory %>/js/ajaxsubmit.js': ['<%= CoffeeDirectory %>/ajaxsubmit.coffee']
# =============================================
# UGLIFY JAVASCRIPT
# =============================================
# https://github.com/gruntjs/grunt-contrib-uglify
# =============================================
uglify:
options:
sourceMap: true
mangle: false
beautify: false
compress: true
dist:
files:
'<%= ResourcesDirectory %>/js/formbuilder2.min.js': ['<%= ResourcesDirectory %>/js/formbuilder2.js']
# =============================================
# LOAD PLUGINS
# =============================================
grunt.loadNpmTasks 'grunt-contrib-sass'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-uglify'
# =============================================
# TASKS
# =============================================
grunt.registerTask 'default', ['watch']
grunt.registerTask 'minify', ['uglify']