Rebuild frontend on deploy / publish
This commit is contained in:
parent
6c997bfc43
commit
529d4d2799
2 changed files with 18 additions and 5 deletions
|
@ -1,4 +1,6 @@
|
|||
require_relative "rakelib/builders"
|
||||
load "twenty-frontend/tasks/nanoc.rake"
|
||||
|
||||
namespace :gem do
|
||||
task :gemspec, [:version] do |t, args|
|
||||
GemSpec.call(args[:version])
|
||||
|
@ -8,7 +10,7 @@ namespace :gem do
|
|||
Copy.call(args[:version])
|
||||
end
|
||||
|
||||
task :build, [:version] => [:copy] do |t, args|
|
||||
task :build, [:version] => ["nanoc:clean", "nanoc:build", :copy] do |t, args|
|
||||
Build.call(args[:version])
|
||||
end
|
||||
|
||||
|
|
|
@ -1,10 +1,21 @@
|
|||
namespace :nanoc do
|
||||
cwd = File.realpath File.join(__dir__, "..")
|
||||
|
||||
desc "Clean the build/ directory"
|
||||
task :clean do
|
||||
Dir.chdir(cwd) do
|
||||
sh "rm -rf build"
|
||||
end
|
||||
end
|
||||
|
||||
desc "Produce the build/ directory"
|
||||
task :build do
|
||||
Dir.chdir(cwd) do
|
||||
# FIXME: discover why rm -rf build/css/ is needed.
|
||||
ENV["NODE_ENV"] = "production"
|
||||
sh "rm -rf build/css/"
|
||||
sh "nanoc co"
|
||||
sh "bundle exec nanoc co"
|
||||
end
|
||||
end
|
||||
|
||||
desc "Produce the build/ directory on-demand"
|
||||
|
|
Loading…
Reference in a new issue