2024-04-25 08:40:55 +02:00
|
|
|
#!/usr/bin/env ruby
|
2024-04-25 09:16:57 +02:00
|
|
|
# frozen_string_literal: true
|
2024-04-25 08:40:55 +02:00
|
|
|
|
2024-04-25 10:37:45 +02:00
|
|
|
{
|
|
|
|
"Task" => ["tasks/new", "tasks/edit"],
|
|
|
|
"Tasks" => ["/", "tasks"],
|
|
|
|
"Projects" => ["projects"]
|
|
|
|
}.each do |component, paths|
|
|
|
|
compile "/html/react.html.erb", rep: component do
|
2024-04-25 10:58:26 +02:00
|
|
|
filter(:erb, locals: {component: "react-#{component.downcase}", src: "/js/main.js"})
|
2024-04-25 09:05:02 +02:00
|
|
|
paths.each do |path|
|
2024-04-25 09:16:57 +02:00
|
|
|
(path == "/") ? write("/index.html") : write("/#{path}/index.html")
|
2024-04-25 09:05:02 +02:00
|
|
|
end
|
2024-04-25 08:40:55 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
compile "/js/main/main.tsx" do
|
2024-04-25 17:51:19 +02:00
|
|
|
buildenv = ENV["buildenv"] || "development"
|
|
|
|
filter(:webpack,
|
|
|
|
argv: ["--mode", buildenv, "--config", "webpack.#{buildenv}.js"],
|
|
|
|
depend_on: %w[/js/components/ /js/hooks/ /js/types/ /js/lib/])
|
2024-04-25 08:40:55 +02:00
|
|
|
write("/js/main.js")
|
|
|
|
end
|