This repository has been archived by the owner on Nov 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 94
/
Gruntfile.coffee
95 lines (84 loc) · 2.83 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
path = require("path")
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
build:
src: 'assets',
dest: 'build'
bump:
options:
files: ['package.json']
updateConfigs: []
commit: true
commitMessage: 'Release v%VERSION%'
commitFiles: ['-a']
createTag: false
push: false
less:
development:
files:
'<%=build.dest%>/css/embed.css': ['<%=build.src%>/css/apps/embed.less']
options:
strictImports: true
syncImports: true
production:
options:
compress: true
strictImports: true
syncImports: true
files:
'<%=build.dest%>/css/embed-min.css': ['<%=build.src%>/css/apps/embed.less']
watch:
scripts:
files: ['<%=build.src%>/**/*.coffee', '<%=build.src%>/**/*.js']
tasks: ['browserify:development']
styles:
files: ["<%=build.src%>/**/*.less", "<%=build.src%>/**/*.css"]
tasks: ['less:development']
options:
nospawn: true
browserify:
development:
files:
'<%=build.dest%>/js/embed.js': ['<%=build.src%>/js/apps/embed.coffee']
options:
debug: true
transform: ['caching-coffeeify', 'brfs']
noParse: [
'<%=build.src%>/vendor/angular-1.2.3.js'
'<%=build.src%>/vendor/ui-router/ui-router.js'
'<%=build.src%>/vendor/marked.js'
'<%=build.src%>/vendor/angularytics/dist/angularytics.js'
]
production:
files:
'<%=build.dest%>/js/embed.js': ['<%=build.src%>/js/apps/embed.coffee']
options:
debug: false
transform: ['caching-coffeeify', 'brfs']
noParse: [
'<%=build.src%>/vendor/angular-1.2.3.js'
'<%=build.src%>/vendor/ui-router/ui-router.js'
'<%=build.src%>/vendor/marked.js'
'<%=build.src%>/vendor/angularytics/dist/angularytics.js'
]
uglify:
build:
files:
'<%=build.dest%>/js/embed-min.js': ['<%=build.dest%>/js/embed.js']
exec:
editor: 'NODE_ENV=production node build.js'
# load plugins
grunt.loadNpmTasks 'grunt-contrib-less'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-browserify'
grunt.loadNpmTasks 'grunt-bump'
grunt.loadNpmTasks 'grunt-exec'
# tasks
grunt.task.registerTask 'clean', 'clears out temporary build files', ->
grunt.file.delete grunt.config.get('build').tmp
grunt.registerTask 'default', ['compile', 'watch']
grunt.registerTask 'compile', ['browserify:development', 'less:development']
grunt.registerTask 'build', ['exec:editor', 'less:production']
grunt.registerTask 'release', ['bump', 'build']