-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.coffee
75 lines (72 loc) · 2.57 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
module.exports = ( grunt ) ->
'use strict'
shim = require('browserify-shim')
coffeeify = require('coffeeify')
# Load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks)
grunt.initConfig
pkg: grunt.file.readJSON("package.json")
sass:
options:
compass: true
loadPath: ["node_modules/foundation-sites/scss"]
build:
files:
"build/style.css": "app/assets/stylesheets/style.sass"
cssmin:
options:
keepSpecialComments: 1
compress:
files:
'build/style.css': ['build/style.css']
browserify:
site:
files:
"build/javascripts/theme.js": ["app/assets/javascripts/theme.coffee"]
options:
transform: ["coffeeify"]
uglify:
options:
banner: '/*! <%= pkg.name %> v<%= pkg.version %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
report: 'gzip'
dist:
files:
'build/javascripts/theme.js': 'build/javascripts/theme.js'
copy:
build:
files: [
{expand: true, flatten: true, src: ['app/templates/**'], dest: 'build/', filter: 'isFile'}
{expand: true, flatten: true, src: ['app/functions/**'], dest: 'build/', filter: 'isFile'}
{expand: true, flatten: true, cwd: "app/assets/", src: ['images/**'], dest: 'build/images', filter: "isFile"}
{expand: true, flatten: true, cwd: "app/assets/", src: ['images/screenshot.png'], dest: 'build/'}
]
watch:
options:
livereload: true
sass:
files: ["app/assets/stylesheets/**/*.sass", "app/assets/stylesheets/**/*.scss"]
tasks: ["sass"]
browserify:
files: ["app/assets/javascripts/**/*.coffee"]
tasks: ["browserify"]
php:
files: ["app/templates/**/*.php", "app/functions/**/*.php"]
tasks: ["copy"]
clean: ['build', "package"]
zip:
'package/package.zip': ['build/**/*']
bower:
build:
dest: "build/javascripts"
rsync:
production:
options:
src: "build/"
dest: "/home/montaasi/www-data/wp-content/themes/montage"
host: "[email protected]"
recursive: true
delete: true
grunt.registerTask "default", ["clean", "bower", "browserify", "copy", "sass", "watch"]
grunt.registerTask "package", ["clean", "bower", "browserify", "copy", "sass", "cssmin", "uglify", "zip"]
grunt.registerTask "build", ["clean", "bower", "browserify", "copy", "sass", "cssmin", "uglify"]
grunt.registerTask "deploy", ["build", "rsync:production"]