-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathGruntfile.coffee
96 lines (94 loc) · 2.84 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
95
96
module.exports = (grunt) ->
# load plugins
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-contrib-clean')
#grunt.loadNpmTasks('grunt-contrib-coffee')
grunt.loadNpmTasks('grunt-browserify')
grunt.loadNpmTasks('grunt-contrib-compress')
grunt.loadNpmTasks('grunt-contrib-less')
grunt.loadNpmTasks('grunt-contrib-uglify')
grunt.loadNpmTasks('grunt-coffeelint')
grunt.loadNpmTasks('grunt-bump')
grunt.initConfig {
pkg: grunt.file.readJSON('package.json'),
watch:
options:
livereload: true
coffee:
files: [
'Gruntfile.coffee',
'src/*.coffee',
'src/*/*.coffee'
],
tasks: [
'browserify',
#'uglify',
'less:development'
],
less:
files: 'src/*.less',
tasks: 'less:development'
browserify:
dist:
files:
'build/d3.timeslider.js': 'src/main.coffee'
options:
transform: [['coffeeify', {
sourceMap: true
}]]
# coffee:
# compile:
# options:
# join: true,
# sourceMap: true
# files:
# 'build/d3.timeslider.js': 'src/*.coffee'
# 'build/d3.timeslider.plugins.js': 'src/plugins/*.coffee'
coffeelint:
options:
indentation:
value: 4
max_line_length:
value: 120
no_backticks:
level: "ignore"
app: 'src/*.coffee'
uglify:
options:
banner: '/* <%= pkg.name %> - version <%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n * See <%= pkg.homepage %> for more information! */\n',
mangle:
except: ['d3', 'filter', 'map']
preserveComment: false
compile:
files:
'build/d3.timeslider.min.js': ['build/d3.timeslider.js']
# 'build/d3.timeslider.plugins.min.js': ['build/d3.timeslider.plugins.js']
less:
development:
files:
'build/d3.timeslider.css': 'src/*.less'
production:
options:
yuicompress: true
files:
'build/d3.timeslider.min.css': 'src/*.less'
bump:
options:
files: ['package.json'],
updateConfigs: ['pkg'],
push: false,
clean:
build: [ 'build/*' ]
release: [ 'release/*' ]
compress:
release:
options:
archive: 'release/d3.TimeSlider.zip'
files: [
{ expand: true, cwd: 'build', src: ['*.min.js', '*.min.css'], dest: 'd3.timeslider' },
{ expand: true, src: ['License', 'Readme.md', 'Changelog'], dest: 'd3.timeslider' }
]
}
grunt.registerTask('lint', ['coffeelint'])
grunt.registerTask('default', ['clean:build', 'browserify', 'less:development'])
grunt.registerTask('release', ['clean:release', 'browserify', 'uglify', 'less:production', 'compress:release'])