Skip to content

Commit

Permalink
Install with default jsconfig.json
Browse files Browse the repository at this point in the history
  • Loading branch information
tonysm committed Jan 7, 2024
1 parent ce9f7f2 commit 715c00b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
});
Expand Down
9 changes: 9 additions & 0 deletions stubs/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"*": ["./resources/js/*/index.js", "./resources/js/*.js"]
}
}
}

0 comments on commit 715c00b

Please sign in to comment.