File tree Expand file tree Collapse file tree 1 file changed +19
-15
lines changed
packages/vite/src/Installer Expand file tree Collapse file tree 1 file changed +19
-15
lines changed Original file line number Diff line number Diff line change @@ -77,21 +77,25 @@ public function install(): void
7777 });
7878
7979 // Updates the .gitignore
80- $ this ->update (root_path ('.gitignore ' ), function (ImmutableString $ gitignore ) {
81- if (! $ gitignore ->contains ($ this ->viteConfig ->bridgeFileName )) {
82- $ gitignore = $ gitignore ->append (PHP_EOL , $ this ->viteConfig ->bridgeFileName );
83- }
84-
85- if (! $ gitignore ->contains ('node_modules ' )) {
86- $ gitignore = $ gitignore ->append (PHP_EOL , 'node_modules/ ' );
87- }
88-
89- if (! $ gitignore ->contains ('public/build ' )) {
90- return $ gitignore ->append (PHP_EOL , 'public/build/ ' );
91- }
92-
93- return $ gitignore ;
94- });
80+ $ this ->update (
81+ path: root_path ('.gitignore ' ),
82+ callback: function (ImmutableString $ gitignore ) {
83+ if (! $ gitignore ->contains ($ this ->viteConfig ->bridgeFileName )) {
84+ $ gitignore = $ gitignore ->append (PHP_EOL , $ this ->viteConfig ->bridgeFileName );
85+ }
86+
87+ if (! $ gitignore ->contains ('node_modules ' )) {
88+ $ gitignore = $ gitignore ->append (PHP_EOL , 'node_modules/ ' );
89+ }
90+
91+ if (! $ gitignore ->contains ('public/build ' )) {
92+ return $ gitignore ->append (PHP_EOL , 'public/build/ ' );
93+ }
94+
95+ return $ gitignore ;
96+ },
97+ ignoreNonExisting: true ,
98+ );
9599
96100 $ packageManager = PackageManager::detect (root_path ());
97101
You can’t perform that action at this time.
0 commit comments