File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,14 @@ class InstallGenerator < ::Rails::Generators::Base
1818
1919 # Make an empty `components/` directory in the right place:
2020 def create_directory
21- empty_directory File . join ( javascript_dir , 'components' )
21+ components_dir = if webpacker?
22+ Pathname . new ( javascript_dir ) . parent . to_s
23+ else
24+ javascript_dir
25+ end
26+ empty_directory File . join ( components_dir , 'components' )
2227 if !options [ :skip_git ]
23- create_file File . join ( javascript_dir , 'components/.gitkeep' )
28+ create_file File . join ( components_dir , 'components/.gitkeep' )
2429 end
2530 end
2631
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ def copy_directory(dir)
2626 test "adds requires to `application.js`" do
2727 run_generator
2828 assert_file "app/javascript/packs/application.js" , EXPECTED_SETUP
29+ assert_file "app/javascript/components"
2930 end
3031
3132 test "creates server_rendering.js with default requires" do
You can’t perform that action at this time.
0 commit comments