diff --git a/src/Commands/InstallCommand.php b/src/Commands/InstallCommand.php index dcc9031..4ffc98c 100644 --- a/src/Commands/InstallCommand.php +++ b/src/Commands/InstallCommand.php @@ -26,7 +26,7 @@ public function handle(): int File::ensureDirectoryExists(resource_path('js')); $this->convertLocalImportsFromUsingDots(); - $this->publishImportmapFile(); + $this->publishImportmapFiles(); $this->importDependenciesFromNpm(); $this->updateAppLayouts(); $this->deleteNpmRelatedFiles(); @@ -60,10 +60,11 @@ private function deleteNpmRelatedFiles(): void }); } - private function publishImportmapFile(): void + private function publishImportmapFiles(): void { $this->displayTask('publishing the `routes/importmap.php` file', function () { File::copy(dirname(__DIR__, 2).implode(DIRECTORY_SEPARATOR, ['', 'stubs', 'routes', 'importmap.php']), base_path(implode(DIRECTORY_SEPARATOR, ['routes', 'importmap.php']))); + File::copy(dirname(__DIR__, 2).implode(DIRECTORY_SEPARATOR, ['', 'stubs', 'jsconfig.json']), base_path('jsconfig.json')); return self::SUCCESS; }); diff --git a/stubs/jsconfig.json b/stubs/jsconfig.json new file mode 100644 index 0000000..7db2179 --- /dev/null +++ b/stubs/jsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "paths": { + "*": ["./resources/js/*/index.js", "./resources/js/*.js"] + } + } +} +