forked from andrevenancio/coffee-sass-grunt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.coffee
More file actions
42 lines (35 loc) · 1.06 KB
/
Gruntfile.coffee
File metadata and controls
42 lines (35 loc) · 1.06 KB
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
module.exports = (grunt) ->
grunt.initConfig
pkg: '<json:package.json>'
#watch for changes in files
watch:
files: ['Gruntfile.coffee', 'src/coffee/*.coffee', 'src/sass/*.sass']
tasks: 'onwatch'
#compile coffee files
coffee:
lib:
files:
'deploy/js/all.js': 'src/**/*.coffee'
#compile sass files
sass:
dist:
options:
style: 'expanded'
files:
'deploy/css/main.css': 'src/sass/reset.sass'
#uglify javascript
uglify:
options:
mangle: false
my_target:
files:
'deploy/js/all.min.js': ['deploy/js/all.js']
#add event to listen for file changes
grunt.event.on "watch", (action, filepath, target) ->
grunt.log.writeln "#{filepath} has #{action}"
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-sass'
grunt.registerTask 'default', ['watch']
grunt.registerTask 'onwatch', ['coffee', 'sass', 'uglify']