forked from jimmylorunning/FormBuilder-2-Craft-CMS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
executable file
·84 lines (77 loc) · 3.14 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
module.exports = (grunt) ->
grunt.initConfig
# =============================================
# VARIABLES
# =============================================
ScssDirectory: 'dev/scss'
CoffeeDirectory: 'dev/coffee'
ResourcesDirectory: 'formbuilder2/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/entrydetails.js': ['<%= CoffeeDirectory %>/entrydetails.coffee']
'<%= ResourcesDirectory %>/js/ajaxsubmit.js': ['<%= CoffeeDirectory %>/ajaxsubmit.coffee']
'<%= ResourcesDirectory %>/js/layouts.js': ['<%= CoffeeDirectory %>/layouts.coffee']
'<%= ResourcesDirectory %>/js/templates.js': ['<%= CoffeeDirectory %>/templates.coffee']
'<%= ResourcesDirectory %>/js/emaillogoasset.js': ['<%= CoffeeDirectory %>/emaillogoasset.coffee']
'<%= ResourcesDirectory %>/js/customtemplates.js': ['<%= CoffeeDirectory %>/customtemplates.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']