-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
100 lines (97 loc) · 3.1 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
97
98
99
100
module.exports = (grunt) ->
# Project configuration.
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
connect:
server:
options:
port: 8080
base: './dist'
keepalive: true
watch:
scripts:
files: [
'scripts/**/*.coffee',
'node_modules/seasketch-reporting-api/scripts/**/*.coffee'
]
tasks: ['browserify']
templates:
files: [
'templates/**/*.mustache'
'node_modules/seasketch-reporting-api/templates/**/*.mustache'
]
tasks: ['hogan', 'browserify']
stylesheets:
files: [
'stylesheets/**/*.less'
'node_modules/backbone/less/*'
'node_modules/seasketch-reporting-api/stylesheets/**/*.less'
]
tasks: ['less']
livereload:
files: ['dist/**/*.css']
options:
livereload: true
hogan:
main:
dest: 'templates/templates.js'
src: 'templates/**/*.mustache'
lib:
dest: 'node_modules/seasketch-reporting-api/templates/templates.js'
src: 'node_modules/seasketch-reporting-api/templates/**/*.mustache'
options:
commonJsWrapper: true
defaultName: (filename) ->
filename
.replace('templates/', '')
.replace('node_modules/seasketch-reporting-api/templates/', '')
.replace('.mustache', '')
less:
fishSanctuary:
files:
'dist/fishSanctuary.css': 'stylesheets/fishSanctuary.less'
aquaculture:
files:
'dist/aquaculture.css': 'stylesheets/aquaculture.less'
fishingPriority:
files:
'dist/fishingPriority.css': 'stylesheets/fishingPriority.less'
mooring:
files:
'dist/mooring.css': 'stylesheets/mooring.less'
proposal:
files:
'dist/proposal.css': 'stylesheets/proposal.less'
browserify:
fishSanctuary:
src: 'scripts/fishSanctuary.coffee'
dest: 'dist/fishSanctuary.js'
aquaculture:
src: 'scripts/aquaculture.coffee'
dest: 'dist/aquaculture.js'
fishingPriority:
src: 'scripts/fishingPriority.coffee'
dest: 'dist/fishingPriority.js'
mooring:
src: 'scripts/mooring.coffee'
dest: 'dist/mooring.js'
proposal:
src: 'scripts/proposal.coffee'
dest: 'dist/proposal.js'
options:
transform: ['coffeeify']
debug: true
alias: [
'node_modules/seasketch-reporting-api/scripts/reportTab.coffee:reportTab'
'node_modules/seasketch-reporting-api/scripts/utils.coffee:api/utils'
'node_modules/seasketch-reporting-api/templates/templates.js:api/templates'
]
ignore: ['views/collectionView']
grunt.loadNpmTasks('grunt-contrib-connect')
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-browserify')
grunt.loadNpmTasks('grunt-contrib-hogan')
grunt.loadNpmTasks('grunt-contrib-less')
grunt.loadNpmTasks('grunt-notify')
# Default task(s).
grunt.registerTask('default', ['less', 'hogan', 'browserify'])