Skip to content

Commit c304692

Browse files
committed
refine as per feedback
1 parent 2f83a66 commit c304692

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/DependencyInjection/Configuration.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ public function getConfigTreeBuilder()
3434
->isRequired()
3535
->info('The path where Encore is building the assets - i.e. Encore.setOutputPath()')
3636
->end()
37-
->scalarNode('crossorigin')
37+
->enumNode('crossorigin')
38+
->defaultValue('anonymous')
39+
->values(['anonymous', 'use-credentials'])
3840
->info('crossorigin value when Encore.enableIntegrityHashes is used, can be anonymous (default) or use-credentials')
3941
->end()
4042
->booleanNode('cache')

src/DependencyInjection/WebpackEncoreExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function load(array $configs, ContainerBuilder $container)
5353
$container->setAlias(EntrypointLookupInterface::class, new Alias($this->getEntrypointServiceId('_default')));
5454

5555
$container->getDefinition('webpack_encore.tag_renderer')
56-
->replaceArgument(2, $config['crossorigin']??'anonymous');
56+
->replaceArgument(2, $config['crossorigin']);
5757
}
5858

5959
private function entrypointFactory(ContainerBuilder $container, string $name, string $path, bool $cacheEnabled): Reference

src/Resources/config/services.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<service id="webpack_encore.tag_renderer" class="Symfony\WebpackEncoreBundle\Asset\TagRenderer">
1717
<argument type="service" id="webpack_encore.entrypoint_lookup_collection" />
1818
<argument type="service" id="assets.packages" />
19-
<argument type="string" id="webpack_encore.crossorigin" />
19+
<argument>anonymous</argument>
2020
</service>
2121

2222
<service id="webpack_encore.twig_entry_files_extension" class="Symfony\WebpackEncoreBundle\Twig\EntryFilesTwigExtension">

0 commit comments

Comments
 (0)