Skip to content

Commit

Permalink
[Maintenance] Add app webpack endpoint to twig hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Wojdylak committed Nov 20, 2024
1 parent 158104a commit d2ee911
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions assets/admin/entry.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// In this file you can import assets like images or stylesheets
console.log('Hello Webpack Encore! Edit me in assets/shop/entry.js');
1 change: 1 addition & 0 deletions assets/shop/entry.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// In this file you can import assets like images or stylesheets
console.log('Hello Webpack Encore! Edit me in assets/shop/entry.js');
19 changes: 19 additions & 0 deletions config/packages/_sylius.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ sylius_channel:
channel:
classes:
model: App\Entity\Channel\Channel

sylius_core:
resources:
avatar_image:
Expand Down Expand Up @@ -138,6 +139,7 @@ sylius_payum:
payment_security_token:
classes:
model: App\Entity\Payment\PaymentSecurityToken

sylius_product:
resources:
product:
Expand Down Expand Up @@ -246,6 +248,7 @@ sylius_taxonomy:
translation:
classes:
model: App\Entity\Taxonomy\TaxonTranslation

sylius_user:
resources:
admin:
Expand All @@ -260,3 +263,19 @@ sylius_user:
user:
classes:
model: App\Entity\User\UserOAuth

sylius_twig_hooks:
hooks:
'sylius_admin.base#stylesheets':
app_styles:
template: 'admin/stylesheets.html.twig'
'sylius_admin.base#javascripts':
app_javascripts:
template: 'admin/javascripts.html.twig'

'sylius_shop.base#stylesheets':
app_styles:
template: 'shop/stylesheets.html.twig'
'sylius_shop.base#javascripts':
app_javascripts:
template: 'shop/javascripts.html.twig'
2 changes: 2 additions & 0 deletions templates/admin/javascripts.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

{{ encore_entry_script_tags('app-admin-entry', null, 'app.admin') }}
1 change: 1 addition & 0 deletions templates/admin/stylesheets.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ encore_entry_link_tags('app-admin-entry', null, 'app.admin') }}
1 change: 1 addition & 0 deletions templates/shop/javascripts.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ encore_entry_script_tags('app-shop-entry', null, 'app.shop') }}
1 change: 1 addition & 0 deletions templates/shop/stylesheets.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ encore_entry_link_tags('app-shop-entry', null, 'app.shop') }}

0 comments on commit d2ee911

Please sign in to comment.