1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #34882 from bogdanvlviv/revert-129f8ac6ff

Revert "Remove node_modules path from assets load paths since we use webpack by default"
This commit is contained in:
Guillermo Iguaran 2019-01-05 18:29:55 -05:00 committed by GitHub
commit 1e09019088
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -5,6 +5,10 @@ Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path
<%- unless options[:skip_javascript] -%>
# Add Yarn node_modules folder to the asset load path.
Rails.application.config.assets.paths << Rails.root.join('node_modules')
<%- end -%>
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in the app/assets

View file

@ -346,11 +346,16 @@ module SharedGeneratorTests
run_generator
assert_file "#{application_path}/package.json", /dependencies/
assert_file "#{application_path}/bin/yarn"
assert_file "#{application_path}/config/initializers/assets.rb", /node_modules/
end
def test_generator_for_yarn_skipped
run_generator([destination_root, "--skip-javascript"])
assert_no_file "#{application_path}/package.json"
assert_no_file "#{application_path}/bin/yarn"
assert_file "#{application_path}/config/initializers/assets.rb" do |content|
assert_no_match(/node_modules/, content)
end
end
end