lib/tasks/assets.rake in react_on_rails-8.0.1 vs lib/tasks/assets.rake in react_on_rails-8.0.2
- old
+ new
@@ -1,6 +1,9 @@
+# frozen_string_literal: true
+
require "react_on_rails/assets_precompile"
+require "active_support"
if defined?(Sprockets)
namespace :react_on_rails do
namespace :assets do
desc "Creates non-digested symlinks for the assets in the public asset dir"
@@ -12,15 +15,15 @@
task delete_broken_symlinks: :"assets:environment" do
ReactOnRails::AssetsPrecompile.new.delete_broken_symlinks
end
# In this task, set prerequisites for the assets:precompile task
- desc <<-DESC
-Create webpack assets before calling assets:environment
-The webpack task must run before assets:environment task.
-Otherwise Sprockets cannot find the files that webpack produces.
-This is the secret sauce for how a Heroku deployment knows to create the webpack generated JavaScript files.
+ desc <<-DESC.strip_heredoc
+ Create webpack assets before calling assets:environment
+ The webpack task must run before assets:environment task.
+ Otherwise Sprockets cannot find the files that webpack produces.
+ This is the secret sauce for how a Heroku deployment knows to create the webpack generated JavaScript files.
DESC
task compile_environment: :webpack do
Rake::Task["assets:environment"].invoke
end
@@ -43,13 +46,13 @@
end
# Sprockets independent tasks
namespace :react_on_rails do
namespace :assets do
- desc <<-DESC
-Compile assets with webpack
-Uses command defined with ReactOnRails.configuration.npm_build_production_command
-sh "cd client && `ReactOnRails.configuration.npm_build_production_command`"
+ desc <<-DESC.strip_heredoc
+ Compile assets with webpack
+ Uses command defined with ReactOnRails.configuration.npm_build_production_command
+ sh "cd client && `ReactOnRails.configuration.npm_build_production_command`"
DESC
task webpack: :locale do
if ReactOnRails.configuration.npm_build_production_command.present?
sh "cd client && #{ReactOnRails.configuration.npm_build_production_command}"
end