parameters:
    oro_requirejs.twig.class:             Oro\Bundle\RequireJSBundle\Twig\OroRequireJSExtension
    oro_requirejs.provider.config.class:  Oro\Bundle\RequireJSBundle\Provider\Config

services:
    oro_requirejs.twig.requirejs_extension:
        class: Oro\Bundle\RequireJSBundle\Twig\OroRequireJSExtension
        arguments:
            - '@oro_requirejs.config_provider.manager'
            - '%oro_require_js.web_root%'
        tags:
            - { name: twig.extension }

    oro_requirejs.cache:
        parent: doctrine_cache.abstract.file_system
        public: false
        arguments:
            - '%kernel.cache_dir%/oro_data'
        calls:
            - [ setNamespace, [ 'oro_requirejs' ] ]

    oro_requirejs_config_provider:
        class: %oro_requirejs.provider.config.class%
        arguments:
            - '@service_container'
            - '@templating'
            - OroRequireJSBundle::require_config.js.twig
        calls:
            - [ setCache, [ '@oro_requirejs.cache' ] ]
        lazy: true

    oro_requirejs.config_provider.manager:
        class: Oro\Bundle\RequireJSBundle\Manager\ConfigProviderManager

    oro_requirejs.provider.requirejs_config:
        class: Oro\Bundle\RequireJSBundle\Provider\ConfigProvider
        arguments:
            - '@templating'
            - '@oro_requirejs.cache'
            - '%oro_require_js%'
            - '%kernel.bundles%'
            - '%oro_require_js.web_root%'
        tags:
            - { name: requirejs.config_provider, alias: oro_requirejs_config_provider }
        lazy: true
