Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support environment variable to skip Yarn install #125

Merged
merged 1 commit into from
Jun 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions lib/tasks/cssbundling/build.rake
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
namespace :css do
desc "Install JavaScript dependencies"
task :install do
unless system "yarn install"
raise "cssbundling-rails: Command install failed, ensure yarn is installed"
end
end

desc "Build your CSS bundle"
task :build do
unless system "yarn install && yarn build:css"
build_task = task :build do
unless system "yarn build:css"
raise "cssbundling-rails: Command css:build failed, ensure yarn is installed and `yarn build:css` runs without errors or use SKIP_CSS_BUILD env variable"
end
end
build_task.prereqs << :install unless ENV["SKIP_YARN_INSTALL"]
end

unless ENV["SKIP_CSS_BUILD"]
Expand Down