-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
127 lines (116 loc) · 3.16 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
module.exports = (grunt) ->
grunt.initConfig
sass:
all:
expand: true
flatten: true
src: ['src/*.sass']
dest: 'dist/assets'
ext: '.css'
options:
sourcemap: 'none'
autoprefixer:
all:
expand: true
flatten: true
src: ['dist/assets/*.css']
dest: 'dist/assets'
ext: '.css'
cssmin:
options:
report: 'gzip'
dist:
files:
'dist/assets/main.css': 'dist/assets/main.css'
browserify:
dev:
files:
'dist/assets/bundle.js': 'src/main.jsx'
options:
browserifyOptions:
debug: true
extensions: ['.jsx', '.coffee']
dist:
files:
'dist/assets/bundle.js': 'src/main.jsx'
options:
browserifyOptions:
debug: false
extensions: ['.jsx', '.coffee']
fullPaths: false
options:
watch: true
transform: [
'coffeeify'
['reactify', {'es6': true}]
'browserify-shim'
]
uglify:
'dist/assets/bundle.js': 'dist/assets/bundle.js'
options:
report: 'gzip'
copy:
assets:
expand: true
cwd: 'dist'
src: 'assets/**'
dest: 'public'
theme:
expand: true
cwd: 'dist/theme/'
src: '**'
dest: 'public/wp/wp-content/themes/whatever.co/'
bottheme:
expand: true
cwd: 'dist/bot-theme/'
src: '**'
dest: 'public/wp/wp-content/themes/twentyfifteen-bot/'
watch:
sass:
files: ['src/**/*.sass']
tasks: ['sass', 'autoprefixer']
dist:
files: ['dist/**/*']
tasks: ['copy']
options:
livereload: true
rsync:
options:
ssh: true
args: ['--stats']
exclude: ['.*']
recursive: true
delete: true
# dryRun: true
assets:
options:
src: './dist/assets/'
dest: 'we:/home/kusanagi/whtevr.co/DocumentRoot/assets/'
theme:
options:
src: './dist/theme/'
dest: 'we:/home/kusanagi/whtevr.co/DocumentRoot/wp-content/themes/whatever.co/'
bottheme:
options:
src: './dist/bot-theme/'
dest: 'we:/home/kusanagi/whtevr.co/DocumentRoot/wp-content/themes/twentyfifteen-bot/'
express:
server:
options:
server: 'server.coffee'
bases: 'dist'
hostname: '*'
port: 8000
# serverreload: true
grunt.loadNpmTasks('grunt-contrib-sass')
grunt.loadNpmTasks('grunt-autoprefixer')
grunt.loadNpmTasks('grunt-contrib-cssmin')
grunt.loadNpmTasks('grunt-browserify')
grunt.loadNpmTasks('grunt-contrib-uglify')
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-contrib-copy')
grunt.loadNpmTasks('grunt-rsync')
grunt.loadNpmTasks('grunt-express')
grunt.registerTask('default', ['express', 'sass', 'autoprefixer', 'browserify:dev', 'copy', 'watch'])
grunt.registerTask('build', ['sass', 'autoprefixer', 'cssmin', 'browserify:dist', 'uglify', 'copy'])
grunt.registerTask('deploy', ['build', 'rsync'])