aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/tasks/yarn.rake
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/tasks/yarn.rake')
-rw-r--r--railties/lib/rails/tasks/yarn.rake9
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..7c5e266e3e
--- /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 install")
+ end
+end
+
+# Run Yarn prior to Sprockets assets precompilation, so dependencies are available for use.
+Rake::Task["assets:precompile"].enhance [ "yarn:install" ]