提交 e6730c7f 编写于 作者: L Liceth Ovalles 提交者: Guillermo Iguaran

Add node_modules path to assets load paths when --yarn option is used

上级 89822e86
......@@ -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
<%- if options[:yarn] -%>
# 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
......
......@@ -497,6 +497,7 @@ def test_coffeescript_is_skipped_if_required
def test_generator_if_yarn_option_is_given
run_generator([destination_root, "--yarn"])
assert_file "package.json", /dependencies/
assert_file "config/initializers/assets.rb", /node_modules/
end
def test_inclusion_of_jbuilder
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册