-
Notifications
You must be signed in to change notification settings - Fork 9
/
Gruntfile.coffee
49 lines (47 loc) · 1.54 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
module.exports = (grunt) ->
grunt.initConfig
bowerDirectory: require('bower').config.directory
less:
compile:
options:
compress: false
paths: ['less', 'tmp', '<%= bowerDirectory %>/bootstrap/less']
files:
'dist/css/bootstrap.css': ['less/theme.less']
watch:
less:
files: ['less/*.less']
tasks: ['copy', 'less:compile', 'clean']
options:
livereload: true
cssmin:
files: ['dist/css/bootstrap.css']
tasks: ['cssmin:minify']
cssmin:
minify:
expand: true
cwd: 'dist/css'
src: ['*.css', '!*.min.css']
dest: 'dist/css'
ext: '.min.css'
connect:
serve:
options:
port: grunt.option('port') || '8000'
hostname: grunt.option('host') || 'localhost'
copy:
bootstrap:
files: [
{ expand: true, cwd: '<%= bowerDirectory %>/bootstrap/less', src: ['bootstrap.less'], dest: 'tmp/' },
{ expand: true, cwd: '<%= bowerDirectory %>/bootstrap/fonts', src: ['*'], dest: 'dist/fonts' }
]
clean: ['tmp']
grunt.loadNpmTasks('grunt-contrib-less')
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-contrib-cssmin')
grunt.loadNpmTasks('grunt-contrib-copy')
grunt.loadNpmTasks('grunt-text-replace')
grunt.loadNpmTasks('grunt-contrib-clean')
grunt.loadNpmTasks('grunt-contrib-connect')
grunt.registerTask('default', ['copy', 'less', 'cssmin', 'clean'])
grunt.registerTask('serve', ['connect', 'watch'])