未验证 提交 129f8ac6 编写于 作者: B bogdanvlviv

Remove node_modules path from assets load paths since we use webpack by default

Related to #33079
上级 2e37fb65
......@@ -5,10 +5,6 @@ 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
......
......@@ -339,16 +339,12 @@ def test_generator_for_yarn
skip "#34009 disabled JS by default for plugins" if generator_class.name == "Rails::Generators::PluginGenerator"
run_generator
assert_file "#{application_path}/package.json", /dependencies/
assert_file "#{application_path}/config/initializers/assets.rb", /node_modules/
assert_file "#{application_path}/bin/yarn"
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册