-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathGruntfile.coffee
71 lines (60 loc) · 2.36 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
module.exports = (grunt) ->
version = ->
grunt.file.readJSON("package.json").version
version_tag = ->
"v#{version()}"
grunt.initConfig
pkg: grunt.file.readJSON("package.json")
comments: """
// Chosen Order #{version_tag()}
// This plugin allows you to handle the order of the selection for Chosen multiple <select> dropdowns
// Full source at https://github.com/tristanjahier/chosen-order
// Copyright (c) 2013 - Tristan Jahier, http://tristan-jahier.fr
// DISCLAIMER
// Chosen Order is not associated with Harvest in any way.
// Chosen is an original software by Patrick Filler for Harvest, http://getharvest.com
// Full source at https://github.com/harvesthq/chosen
// Copyright (c) 2011 Harvest http://getharvest.com
// This file is generated by `grunt build`, do not edit it by hand.\n
"""
minified_comments: "/* Chosen Order #{version_tag()} | (c) 2013 by Tristan Jahier, http://tristan-jahier.fr */\n"
concat:
options:
banner: "<%= comments %>"
jquery:
src: ["dist/chosen.order.jquery.js"]
dest: "dist/chosen.order.jquery.js"
proto:
src: ["dist/chosen.order.proto.js"]
dest: "dist/chosen.order.proto.js"
coffee:
options:
join: true
compile:
files:
'dist/chosen.order.jquery.js': ['coffee/chosen.order.coffee', 'coffee/chosen.order.jquery.coffee']
'dist/chosen.order.proto.js': ['coffee/chosen.order.coffee', 'coffee/chosen.order.proto.coffee']
uglify:
options:
mangle:
except: ['jQuery', 'AbstractChosen', 'Chosen', 'SelectParser']
banner: "<%= minified_comments %>"
minified_chosen_order_js:
files:
'dist/chosen.order.jquery.min.js': ['dist/chosen.order.jquery.js']
'dist/chosen.order.proto.min.js': ['dist/chosen.order.proto.js']
copy:
files:
{expand: true, cwd: 'dist/', src: ['*.js'], dest: 'public/'}
watch:
scripts:
files: ['coffee/**/*.coffee']
tasks: ['build']
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-concat'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.registerTask 'default', ['build']
grunt.registerTask 'build', ['coffee', 'concat', 'uglify', 'copy']
grunt.registerTask 'copy_compiled_js', ['copy']