-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
54 lines (42 loc) · 958 Bytes
/
Rakefile
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
require "bundler"
Bundler.require
def opal_build
Opal.use_gem 'pitch'
Opal.append_path "app"
Opal.append_path "lib"
Opal::Builder.build("index").to_s
end
namespace :opal do
desc "Remove built files"
task :clean do
FileUtils.rm_f "www/js/index.js"
end
desc "Opal build to www/js/index.js"
task :build => [ :clean ] do
FileUtils.mkdir_p 'www/js'
File.binwrite "www/js/index.js", opal_build
end
desc "Opal build to stdout - for use by webpack loader"
task :webpack_build do
$stdout.sync = true
$stdout.write opal_build
end
end
namespace :webpack do
desc "Remove built files"
task :clean do
FileUtils.rm_f "www/js/index.js"
end
desc "build"
task :build do
exec(
"./node_modules/.bin/webpack --progress --mode=development"
)
end
desc "server"
task :server do
exec(
"./node_modules/.bin/webpack-dev-server --progress --mode=development --watch "
)
end
end