【发布时间】:2022-08-19 21:33:23
【问题描述】:
我正在尝试将 webpack-encore-bundle 添加到我的 Drupal 站点,我在 services.yml 文件中有这个:
services:
webpack_encore.twig_entry_files_extension:
class: Symfony\\WebpackEncoreBundle\\Twig\\EntryFilesTwigExtension
arguments:
[\'@service_container\']
tags:
- { name: twig.extension }
webpack_encore.tag_renderer:
class: Symfony\\WebpackEncoreBundle\\Asset\\TagRenderer
tags:
- { name: kernel.reset}
arguments:
[\'@webpack_encore.entrypoint_lookup_collection\', \'@assets.packages\']
assets.packages:
class: Symfony\\Component\\Asset\\Packages
webpack_encore.default_entrypoint:
class: Symfony\\WebpackEncoreBundle\\Asset\\EntrypointLookup
arguments:
- \'web/themes/custom/mytheme_base/public/build/entrypoints.json\'
webpack_encore.entrypoint_lookup_collection:
class: Symfony\\WebpackEncoreBundle\\Asset\\EntrypointLookupCollection
arguments:
- !service_locator
_default: \'@webpack_encore.default_entrypoint\'
但我收到此错误:
In YamlSymfony.php line 40:
Tags support is not enabled. You must use the flag \"Yaml::PARSE_CUSTOM_TAGS\" to use \"!service_locator\" at line 27 (near \"!service_locator\").
In Parser.php line 1157:
Tags support is not enabled. You must use the flag \"Yaml::PARSE_CUSTOM_TAGS\" to use \"!service_locator\" at line 27 (near \"!service_locator\").
你知道如何解决吗?
标签: symfony