diff --git a/src/bundle/DependencyInjection/IbexaFieldTypeRichTextExtension.php b/src/bundle/DependencyInjection/IbexaFieldTypeRichTextExtension.php index 0243c827..18cfcfa8 100644 --- a/src/bundle/DependencyInjection/IbexaFieldTypeRichTextExtension.php +++ b/src/bundle/DependencyInjection/IbexaFieldTypeRichTextExtension.php @@ -8,6 +8,7 @@ namespace Ibexa\Bundle\FieldTypeRichText\DependencyInjection; +use Ibexa\Contracts\Core\Container\Encore\ConfigurationDumper as IbexaEncoreConfigurationDumper; use Ibexa\Contracts\FieldTypeRichText\Configuration\Provider; use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; use Symfony\Component\Config\FileLocator; @@ -32,6 +33,12 @@ class IbexaFieldTypeRichTextExtension extends Extension implements PrependExtens private const RICHTEXT_TEXT_TOOLBAR_NAME = 'text'; + private const WEBPACK_CONFIG_NAMES = [ + 'ibexa.richtext.config.manager.js' => [ + 'ibexa.richtext.config.manager.js' => [], + ], + ]; + public function getAlias() { return self::EXTENSION_NAME; @@ -77,6 +84,10 @@ public function load(array $configs, ContainerBuilder $container) $configuration = $this->getConfiguration($configs, $container); $config = $this->processConfiguration($configuration, $configs); $this->registerRichTextConfiguration($config, $container); + + (new IbexaEncoreConfigurationDumper($container))->dumpCustomConfiguration( + self::WEBPACK_CONFIG_NAMES + ); } /** diff --git a/src/bundle/Resources/encore/ez.webpack.custom.config.js b/src/bundle/Resources/encore/ez.webpack.custom.config.js index 12c37610..adc15741 100644 --- a/src/bundle/Resources/encore/ez.webpack.custom.config.js +++ b/src/bundle/Resources/encore/ez.webpack.custom.config.js @@ -1,6 +1,8 @@ const Encore = require('@symfony/webpack-encore'); const path = require('path'); const { styles } = require(path.resolve('./public/bundles/ibexaadminuiassets/vendors/@ckeditor/ckeditor5-dev-utils')); +const ibexaConfigManager = require(path.resolve('./ibexa.webpack.config.manager.js')); +const configManagers = require(path.resolve('./var/encore/ibexa.richtext.config.manager.js')); Encore.reset(); Encore.setOutputPath('public/assets/richtext/build').setPublicPath('/assets/richtext/build').enableSassLoader().disableSingleRuntimeChunk(); @@ -53,4 +55,10 @@ customConfig.module.rules.push({ customConfig.module.rules[1] = {}; customConfig.module.rules[2] = {}; +configManagers.forEach((configManagerPath) => { + const configManager = require(path.resolve(configManagerPath)); + + configManager(customConfig, ibexaConfigManager); +}); + module.exports = customConfig;