-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGruntfile.coffee
96 lines (94 loc) · 2.7 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
module.exports = (grunt) ->
grunt.initConfig
coffee:
compile:
files: [
{
expand: true
cwd: 'src'
src: '**/*.coffee'
dest: 'dest'
ext: '.js'
}
{
expand: true
cwd: 'test'
src: '**/*.coffee'
dest: 'test/tmp'
ext: '.js'
}
]
coffeelint:
app: ['src/**/*.coffee', 'test/**/*.coffee', "Gruntfile.coffee"]
options:
configFile: 'coffeelint.json'
copy:
templates:
cwd: 'src'
src: '**/*.html'
dest: 'dest'
expand: true
scripts:
cwd: 'src/core/frontend/vendor'
src: [ '**/*.js']
dest: 'dest/public/vendor'
expand: true
styles:
cwd: 'src/core/frontend/vendor'
src: '**/*.css'
dest: 'dest/public/vendor'
expand: true
fonts:
cwd: 'src/core/frontend/vendor'
src: [ '**/*.eot', '**/*.svg', '**/*.ttf', '**/*.woff', '**/*.woff2' ]
dest: 'dest/public/vendor'
expand: true
clean:
build:
src: [ 'dest' ]
styles:
src: [ 'dest/**/*.css', '!dest/public/assets/styles/application.css' ]
scripts:
src: [ 'dest/**/*.js', '!dest/public/assets/scripts/application.js' ]
stylus:
build:
options:
linenos: false
compress: false
files: [
expand: true
cwd: 'src'
src: ['**/*.styl']
dest: 'dest'
ext: '.css'
]
cssmin:
build:
files:
'dest/public/assets/styles/application.min.css': [ 'dest/core/frontend/styles/main.css' ]
uglify:
build:
options:
mangle: false
files:
'dest/public/assets/scripts/application.min.js': [ 'dest/**/frontend/**/*.js' ]
connect:
server:
options:
port: 4000
base: 'dest'
hostname: '*'
watch:
files: ['Gruntfile.coffee', 'src/**/*.coffee', 'src/**/*.styl', 'src/**/*.html', 'src/**/*.js', 'test/**/*.coffee']
tasks: ['stylus', 'cssmin', 'coffeelint', 'coffee', 'uglify', 'copy']
grunt.loadNpmTasks 'grunt-coffeelint'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-stylus'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-contrib-stylus'
grunt.loadNpmTasks 'grunt-contrib-cssmin'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-connect'
grunt.registerTask 'default', ['clean:build', 'stylus', 'cssmin', 'coffeelint', 'coffee', 'uglify', 'copy']