Skip to content

Commit

Permalink
clean parcel build files upon assets:clean
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielburnworth committed Dec 11, 2024
1 parent 56cbaf1 commit 27673ff
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/tasks/api.rake
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ namespace :api do
].join(" ") unless ENV["NO_CLEAN"]
end

def clean_build_files
# clear out build files, keeping public assets
sh [
"rm -rf",
".parcel-cache",
"node_modules",
].join(" ")
end

def add_monaco
src = "node_modules/monaco-editor/min/vs"
dst = "public/assets/monaco"
Expand All @@ -100,6 +109,11 @@ namespace :api do
parcel "build"
end

desc "Don't call this directly. Use `rake assets:clean`."
task parcel_clean: :environment do
clean_build_files
end

desc "Clean out old demo accounts"
task clean_demo_accounts: :environment do
users = User
Expand Down Expand Up @@ -176,3 +190,4 @@ namespace :api do
end
end
Rake::Task["assets:precompile"].enhance ["api:parcel_compile"]
Rake::Task["assets:clean"].enhance ["api:parcel_clean"]

0 comments on commit 27673ff

Please sign in to comment.