diff options
author | Matthew Draper <matthew@trebex.net> | 2019-02-11 21:19:16 +1030 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-11 21:19:16 +1030 |
commit | 4e6737f18ab8f0d0e9fbe6f73a92e5d29f1c68f1 (patch) | |
tree | 1c3f111edd45a69c195876fa1e08c2dfed2aa537 /railties/test/isolation/abstract_unit.rb | |
parent | 713cee01a5391b1ca56e25883c6c172ae59d7020 (diff) | |
parent | cd34f00627c35bec1cde9b154c7aeb453ea0789e (diff) | |
download | rails-4e6737f18ab8f0d0e9fbe6f73a92e5d29f1c68f1.tar.gz rails-4e6737f18ab8f0d0e9fbe6f73a92e5d29f1c68f1.tar.bz2 rails-4e6737f18ab8f0d0e9fbe6f73a92e5d29f1c68f1.zip |
Merge pull request #35184 from y-yagi/avoid_extra_package_install
Avoid extra package install
Diffstat (limited to 'railties/test/isolation/abstract_unit.rb')
-rw-r--r-- | railties/test/isolation/abstract_unit.rb | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/railties/test/isolation/abstract_unit.rb b/railties/test/isolation/abstract_unit.rb index ca7601f6fe..0e8e0e86ee 100644 --- a/railties/test/isolation/abstract_unit.rb +++ b/railties/test/isolation/abstract_unit.rb @@ -472,21 +472,17 @@ Module.new do FileUtils.rm_rf(app_template_path) FileUtils.mkdir_p(app_template_path) - Dir.chdir "#{RAILS_FRAMEWORK_ROOT}/actionview" do - `yarn build` - end - - `#{Gem.ruby} #{RAILS_FRAMEWORK_ROOT}/railties/exe/rails new #{app_template_path} --skip-bundle --skip-listen --no-rc` + `#{Gem.ruby} #{RAILS_FRAMEWORK_ROOT}/railties/exe/rails new #{app_template_path} --skip-bundle --skip-listen --no-rc --skip-webpack-install` File.open("#{app_template_path}/config/boot.rb", "w") do |f| f.puts "require 'rails/all'" end - Dir.chdir(app_template_path) { `yarn add https://github.com/rails/webpacker.git` } # Use the latest version. - - # Manually install `webpack` as bin symlinks are not created for sub dependencies - # in workspaces. See https://github.com/yarnpkg/yarn/issues/4964 - Dir.chdir(app_template_path) { `yarn add webpack@4.17.1 --tilde` } - Dir.chdir(app_template_path) { `yarn add webpack-cli` } + assets_path = "#{RAILS_FRAMEWORK_ROOT}/railties/test/isolation/assets" + 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") + FileUtils.ln_s("#{assets_path}/node_modules", "#{app_template_path}/node_modules") + FileUtils.chdir(app_template_path) { `bin/rails webpacker:binstubs` } # Fake 'Bundler.require' -- we run using the repo's Gemfile, not an # app-specific one: we don't want to require every gem that lists. |