diff --git a/assets/admin/entry.js b/assets/admin/entry.js deleted file mode 100644 index 8acf2c2aa0..0000000000 --- a/assets/admin/entry.js +++ /dev/null @@ -1 +0,0 @@ -// In this file you can import assets like images or stylesheets diff --git a/assets/admin/entrypoint.js b/assets/admin/entrypoint.js new file mode 100644 index 0000000000..81eac18531 --- /dev/null +++ b/assets/admin/entrypoint.js @@ -0,0 +1,2 @@ +// In this file you can import assets like images or stylesheets +console.log('Hello Webpack Encore! Edit me in assets/admin/entrypoint.js'); diff --git a/assets/shop/entry.js b/assets/shop/entry.js deleted file mode 100644 index 8acf2c2aa0..0000000000 --- a/assets/shop/entry.js +++ /dev/null @@ -1 +0,0 @@ -// In this file you can import assets like images or stylesheets diff --git a/assets/shop/entrypoint.js b/assets/shop/entrypoint.js new file mode 100644 index 0000000000..6379be9ceb --- /dev/null +++ b/assets/shop/entrypoint.js @@ -0,0 +1,2 @@ +// In this file you can import assets like images or stylesheets +console.log('Hello Webpack Encore! Edit me in assets/shop/entrypoint.js'); diff --git a/config/packages/_sylius.yaml b/config/packages/_sylius.yaml index d188419cb8..4770040f9c 100644 --- a/config/packages/_sylius.yaml +++ b/config/packages/_sylius.yaml @@ -46,6 +46,7 @@ sylius_channel: channel: classes: model: App\Entity\Channel\Channel + sylius_core: resources: avatar_image: @@ -138,6 +139,7 @@ sylius_payum: payment_security_token: classes: model: App\Entity\Payment\PaymentSecurityToken + sylius_product: resources: product: @@ -246,6 +248,7 @@ sylius_taxonomy: translation: classes: model: App\Entity\Taxonomy\TaxonTranslation + sylius_user: resources: admin: @@ -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' diff --git a/templates/admin/javascripts.html.twig b/templates/admin/javascripts.html.twig new file mode 100644 index 0000000000..0c21379ab3 --- /dev/null +++ b/templates/admin/javascripts.html.twig @@ -0,0 +1,2 @@ + +{{ encore_entry_script_tags('app-admin-entry', null, 'app.admin') }} diff --git a/templates/admin/stylesheets.html.twig b/templates/admin/stylesheets.html.twig new file mode 100644 index 0000000000..dc98d75101 --- /dev/null +++ b/templates/admin/stylesheets.html.twig @@ -0,0 +1 @@ +{{ encore_entry_link_tags('app-admin-entry', null, 'app.admin') }} diff --git a/templates/shop/javascripts.html.twig b/templates/shop/javascripts.html.twig new file mode 100644 index 0000000000..a659c2c1d0 --- /dev/null +++ b/templates/shop/javascripts.html.twig @@ -0,0 +1 @@ +{{ encore_entry_script_tags('app-shop-entry', null, 'app.shop') }} diff --git a/templates/shop/stylesheets.html.twig b/templates/shop/stylesheets.html.twig new file mode 100644 index 0000000000..b439fca170 --- /dev/null +++ b/templates/shop/stylesheets.html.twig @@ -0,0 +1 @@ +{{ encore_entry_link_tags('app-shop-entry', null, 'app.shop') }} diff --git a/webpack.config.js b/webpack.config.js index 1e7f94c799..5bbadcb09c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -14,7 +14,7 @@ const shopConfig = SyliusShop.getWebpackConfig(path.resolve(__dirname)); Encore .setOutputPath('public/build/app/shop') .setPublicPath('/build/app/shop') - .addEntry('app-shop-entry', './assets/shop/entry.js') + .addEntry('app-shop-entry', './assets/shop/entrypoint.js') .disableSingleRuntimeChunk() .cleanupOutputBeforeBuild() .enableSourceMaps(!Encore.isProduction()) @@ -32,7 +32,7 @@ Encore.reset(); Encore .setOutputPath('public/build/app/admin') .setPublicPath('/build/app/admin') - .addEntry('app-admin-entry', './assets/admin/entry.js') + .addEntry('app-admin-entry', './assets/admin/entrypoint.js') .disableSingleRuntimeChunk() .cleanupOutputBeforeBuild() .enableSourceMaps(!Encore.isProduction())