未验证 提交 4b68e6db 编写于 作者: Y Yuji Yaginuma 提交者: GitHub

Merge pull request #35523 from y-yagi/build_assets_automatically_when_need

Build assets automatically if necessary
......@@ -488,7 +488,14 @@ class ActiveSupport::TestCase
f.puts "require 'rails/all'"
end
unless File.exist?("#{RAILS_FRAMEWORK_ROOT}/actionview/lib/assets/compiled/rails-ujs.js")
Dir.chdir("#{RAILS_FRAMEWORK_ROOT}/actionview") { `yarn build` }
end
assets_path = "#{RAILS_FRAMEWORK_ROOT}/railties/test/isolation/assets"
unless Dir.exist?("#{assets_path}/node_modules")
Dir.chdir(assets_path) { `yarn install` }
end
FileUtils.cp("#{assets_path}/package.json", "#{app_template_path}/package.json")
FileUtils.cp("#{assets_path}/config/webpacker.yml", "#{app_template_path}/config/webpacker.yml")
FileUtils.cp_r("#{assets_path}/config/webpack", "#{app_template_path}/config/webpack")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册