-
Notifications
You must be signed in to change notification settings - Fork 5
/
Gruntfile.coffee
75 lines (73 loc) · 2.31 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
module.exports = (grunt) ->
banner = '<%= grunt.file.read("assets/javascripts/comments.js").split("\\n").slice(0, 14).join("\\n") %>'
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
concat:
sass:
options:
banner: banner
src: [
'assets/stylesheets/<%= pkg.name %>.scss'
]
dest: 'assets/stylesheets/jquery.<%= pkg.name %>.scss'
coffee:
options:
banner: grunt.file.read 'src/comments.coffee'
src: [
'src/*extensions.coffee'
'src/jquery*.coffee'
'src/rambling*.coffee'
]
dest: 'assets/javascripts/jquery.<%= pkg.name %>.coffee'
coffee:
build:
files:
'assets/javascripts/jquery.<%= pkg.name %>.js': 'assets/javascripts/jquery.<%= pkg.name %>.coffee'
comments:
files:
'assets/javascripts/comments.js': 'src/comments.coffee'
jasmine_node:
extensions: 'coffee'
projectRoot: 'spec'
useHelpers: true
sass:
dev:
files:
'assets/stylesheets/jquery.<%= pkg.name %>.css': 'assets/stylesheets/jquery.<%= pkg.name %>.scss'
'assets/stylesheets/style.css': 'assets/stylesheets/style.scss'
dist:
options:
style: 'compressed'
files:
'assets/stylesheets/jquery.<%= pkg.name %>.min.css': 'assets/stylesheets/jquery.<%= pkg.name %>.scss'
'assets/stylesheets/style.min.css': 'assets/stylesheets/style.scss'
shell:
delete:
command: 'rm assets/javascripts/comments.js'
uglify:
dist:
files:
'assets/javascripts/jquery.<%= pkg.name %>.min.js': ['assets/javascripts/jquery.<%= pkg.name %>.js']
options:
banner: banner
watch:
spec:
files: ['src/**/*.coffee', 'spec/**/*.coffee']
tasks: ['spec']
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-concat'
grunt.loadNpmTasks 'grunt-contrib-sass'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-jasmine-node'
grunt.loadNpmTasks 'grunt-shell'
grunt.registerTask 'spec', ['jasmine_node']
grunt.registerTask 'default', [
'concat:coffee',
'coffee',
'uglify',
'concat:sass',
'sass',
'shell',
'jasmine_node'
]