Skip to content

Commit ebe61d9

Browse files
committed
Allow to define a list of entrypoints to be used in the project.
1 parent 2d2ce93 commit ebe61d9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/DependencyInjection/Configuration.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
1313
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
1414
use Symfony\Component\Config\Definition\ConfigurationInterface;
15+
use Symfony\Component\Config\Definition\Exception\InvalidDefinitionException;
1516

1617
final class Configuration implements ConfigurationInterface
1718
{
@@ -27,6 +28,19 @@ public function getConfigTreeBuilder()
2728
->isRequired()
2829
->info('The path where Encore is building the assets - i.e. Encore.setOutputPath()')
2930
->end()
31+
->arrayNode('builds')
32+
->useAttributeAsKey('name')
33+
->scalarPrototype()
34+
->validate()
35+
->always(function ($values) {
36+
if (isset($values['_default'])) {
37+
throw new InvalidDefinitionException("Key '_default' can't be used as build name.");
38+
}
39+
40+
return $values;
41+
})
42+
->end()
43+
->end()
3044
->end()
3145
;
3246

0 commit comments

Comments
 (0)