diff options
-rw-r--r-- | railties/lib/rails/tasks/yarn.rake | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/railties/lib/rails/tasks/yarn.rake b/railties/lib/rails/tasks/yarn.rake new file mode 100644 index 0000000000..a7d37c9bdf --- /dev/null +++ b/railties/lib/rails/tasks/yarn.rake @@ -0,0 +1,9 @@ +namespace :yarn do + desc "Install all JavaScript dependencies as specified via Yarn" + task :install do + system('./bin/yarn') + end +end + +# Run Yarn prior to Sprockets assets precompilation, so dependencies are available for use. +Rake::Task['assets:precompile'].enhance [ 'yarn:install' ] |