-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGuardfile
72 lines (56 loc) · 1.86 KB
/
Guardfile
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
## Uncomment to clear the screen before every task
# clearing :on
source_dir = 'app'
target_dir = 'public'
build_at_start = true
group :shared do
coffeescript_options = {
input: "#{source_dir}/coffee",
output: "#{source_dir}/js",
all_on_start: true,
shallow: false,
patterns: [%r{^app/.+\.(coffee|coffee\.md|litcoffee)$}]
}
guard 'coffeescript', coffeescript_options do
coffeescript_options[:patterns].each { |pattern| watch(pattern) }
end
guard :sass, input: "#{source_dir}/sass",
output: "#{source_dir}/css",
all_on_start: build_at_start
guard :copy, from: source_dir,
to: target_dir,
mkpath: true,
run_at_start: build_at_start do
watch(%r{.+\.(html|csv|json|png|jpg|ico)$})
end
end
group :development do
guard :copy, from: 'bower_components',
to: "#{target_dir}/lib",
mkpath: true,
run_at_start: build_at_start do
watch(%r{.+\.(min\.css|min\.js|min\.js\.map)$})
end
guard :jammit, output_folder: "#{target_dir}/assets",
config_path: 'config/assets_dev.yml',
package_on_start: build_at_start do
watch(%r{^#{Regexp.quote(source_dir)}/css/.+\.css})
watch(%r{^#{Regexp.quote(source_dir)}/js/.+\.js})
end
guard :livereload do
watch(%r{#{Regexp.quote(target_dir)}/.+\.(css|js|html|png|jpg|csv|json)})
end
end
group :production do
guard :copy, from: 'bower_components',
to: "#{target_dir}/lib",
mkpath: true,
run_at_start: build_at_start do
watch(%r{.+\.(min\.css|min\.js)$})
end
guard :jammit, output_folder: "#{target_dir}/assets",
package_on_start: build_at_start do
watch(%r{^#{Regexp.quote(source_dir)}/css/.+\.css})
watch(%r{^#{Regexp.quote(source_dir)}/js/.+\.js})
end
end