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
18
18
19
19
# Make an empty `components/` directory in the right place:
20
20
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' )
22
27
if !options [ :skip_git ]
23
- create_file File . join ( javascript_dir , 'components/.gitkeep' )
28
+ create_file File . join ( components_dir , 'components/.gitkeep' )
24
29
end
25
30
end
26
31
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ def copy_directory(dir)
26
26
test "adds requires to `application.js`" do
27
27
run_generator
28
28
assert_file "app/javascript/packs/application.js" , EXPECTED_SETUP
29
+ assert_file "app/javascript/components"
29
30
end
30
31
31
32
test "creates server_rendering.js with default requires" do
You can’t perform that action at this time.
0 commit comments