lib/tasks/assets.rake in react_on_rails-12.0.0.pre.beta.3 vs lib/tasks/assets.rake in react_on_rails-12.0.0.pre.beta.4
- old
+ new
@@ -7,17 +7,22 @@
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
ENV["NODE_ENV"] ||= "development"
unless ReactOnRails::WebpackerUtils.webpacker_webpack_production_config_exists?
+ # Ensure that rails/webpacker does not call bin/webpack if we're providing
+ # the build command.
+ ENV["WEBPACKER_PRECOMPILE"] = "false"
+
if Rake::Task.task_defined?("assets:precompile")
Rake::Task["assets:precompile"].enhance do
Rake::Task["react_on_rails:assets:webpack"].invoke
- puts "Invoking task wepacker:clean from React on Rails"
+ puts "Invoking task webpacker:clean from React on Rails"
Rake::Task["webpacker:clean"].invoke
end
else
- Rake::Task.define_task("assets:precompile" => ["react_on_rails:assets:webpack"])
+ Rake::Task.define_task("assets:precompile" => ["react_on_rails:assets:webpack",
+ "webpacker:clean"])
end
end
# Sprockets independent tasks
namespace :react_on_rails do