Skip to content

Add support for loading Webpack Encore entries#4223

Merged
javiereguiluz merged 1 commit into
EasyCorp:masterfrom
javiereguiluz:fix_4213
Feb 23, 2021
Merged

Add support for loading Webpack Encore entries#4223
javiereguiluz merged 1 commit into
EasyCorp:masterfrom
javiereguiluz:fix_4213

Conversation

@javiereguiluz
Copy link
Copy Markdown
Collaborator

Fixes #4213.

The method name is a bit long (addWebpackEncoreEntry()) but I prefer it because it's completely explicit about its intent.

@javiereguiluz javiereguiluz added this to the 3.x milestone Feb 20, 2021
{% endfor %}

{% for webpack_encore_entry in ea.assets.webpackEncoreEntries ?? [] %}
{{ ea_call_function_if_exists('encore_entry_script_tags', webpack_encore_entry) }}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there a twig possibility to check if a method is defined, instead of wrapping it again in a php method? Maybe this can be provided as native twig function?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None that I'm aware of ... that's why we defined a similar ea_apply_filter_if_exists filter in the past:

new TwigFilter('ea_apply_filter_if_exists', [$this, 'applyFilterIfExists'], ['needs_environment' => true]),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabpot any thoughts on having this on twig instead project level?

@javiereguiluz javiereguiluz merged commit bcc20b3 into EasyCorp:master Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Js doesn't run on configureAssets method

2 participants