Skip to content

Commit d54c11a

Browse files
committed
bug #899 [AssetMapper] Various minor tweaks (weaverryan)
This PR was squashed before being merged into the 2.x branch. Discussion ---------- [AssetMapper] Various minor tweaks | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | Tickets | None | License | MIT A few more tweaks as I'm testing things with the new recipe. Commits ------- f4e42e1 [AssetMapper] Various minor tweaks
2 parents ead1c01 + f4e42e1 commit d54c11a

File tree

5 files changed

+19
-1
lines changed

5 files changed

+19
-1
lines changed

src/React/src/AssetMapper/ReactControllerLoaderAssetCompiler.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ private function findControllerAssets(AssetMapperInterface $assetMapper): array
7272
throw new \LogicException('The "symfony/finder" package is required to use ux-react with AssetMapper. Try running "composer require symfony/finder".');
7373
}
7474

75+
if (!file_exists($this->controllerPath)) {
76+
return [];
77+
}
78+
7579
$finder = new Finder();
7680
$finder->in($this->controllerPath)
7781
->files()

src/StimulusBundle/src/Twig/UxControllersTwigRuntime.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ public function __construct(
2626
) {
2727
}
2828

29+
/**
30+
* Returns the CSS <link> tags for all "autoimport" entries in controllers.json.
31+
*/
2932
public function renderLinkTags(): string
3033
{
3134
$controllersFile = $this->controllersMapGenerator->getControllersJsonPath();

src/Svelte/src/AssetMapper/SvelteControllerLoaderAssetCompiler.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ private function findControllerAssets(AssetMapperInterface $assetMapper): array
7272
throw new \LogicException('The "symfony/finder" package is required to use ux-Svelte with AssetMapper. Try running "composer require symfony/finder".');
7373
}
7474

75+
if (!file_exists($this->controllerPath)) {
76+
return [];
77+
}
78+
7579
$finder = new Finder();
7680
$finder->in($this->controllerPath)
7781
->files()

src/Vue/assets/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
},
1717
"importmap": {
1818
"@hotwired/stimulus": "^3.0.0",
19-
"vue/dist/vue.esm-bundler.js": "^3.0",
19+
"vue": {
20+
"package": "vue/dist/vue.esm-bundler.js",
21+
"version": "^3.0"
22+
},
2023
"@symfony/ux-vue": "path:dist/loader.js"
2124
}
2225
},

src/Vue/src/AssetMapper/VueControllerLoaderAssetCompiler.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ private function findControllerAssets(AssetMapperInterface $assetMapper): array
7272
throw new \LogicException('The "symfony/finder" package is required to use ux-Vue with AssetMapper. Try running "composer require symfony/finder".');
7373
}
7474

75+
if (!file_exists($this->controllerPath)) {
76+
return [];
77+
}
78+
7579
$finder = new Finder();
7680
$finder->in($this->controllerPath)
7781
->files()

0 commit comments

Comments
 (0)