From 5a59383cdde1ab4a683d84e28455118bc2332138 Mon Sep 17 00:00:00 2001 From: vcarroy Date: Tue, 22 Oct 2024 14:57:45 +0200 Subject: [PATCH] Correctif theme --- .dockerignore | 2 ++ config/packages/framework.yaml | 5 ++++- webpack.config.js | 11 ++++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.dockerignore b/.dockerignore index 52d5a1a..315914d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -13,3 +13,5 @@ !/package.json !/symfony.lock !/webpack.config.js + +/public/build \ No newline at end of file diff --git a/config/packages/framework.yaml b/config/packages/framework.yaml index 68da994..8be880e 100644 --- a/config/packages/framework.yaml +++ b/config/packages/framework.yaml @@ -2,6 +2,9 @@ parameters: base_url: '%env(BASE_URL)%' env(BASE_URL): '//' + base_path: '%env(BASE_PATH)%' + env(BASE_PATH): '/' + cookie_path: '%env(COOKIE_PATH)%' env(COOKIE_PATH): '/' framework: @@ -18,7 +21,7 @@ framework: storage_factory_id: session.storage.factory.native cookie_path: "%cookie_path%" assets: - base_urls: '%base_url%' + base_path: '%base_path%' router: default_uri: '%base_url%' #esi: true diff --git a/webpack.config.js b/webpack.config.js index de05cd1..812fbb4 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -6,14 +6,16 @@ if (!Encore.isRuntimeEnvironmentConfigured()) { Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev'); } +const basePath = process.env.BASE_PATH || '' + // Definition de AppConfig Encore // directory where compiled assets will be stored .setOutputPath('public/build/app/') // public path used by the web server to access the output path - .setPublicPath('/build/app') + .setPublicPath(basePath + '/build/app') // only needed for CDN's or sub-directory deploy - //.setManifestKeyPrefix('build/') + .setManifestKeyPrefix('build/app') /* * ENTRY CONFIG @@ -74,7 +76,10 @@ Encore // directory where compiled assets will be stored .setOutputPath('public/build/theme/') // public path used by the web server to access the output path - .setPublicPath('/build/theme') + .setPublicPath(basePath + '/build/theme') + // only needed for CDN's or sub-directory deploy + .setManifestKeyPrefix('build/theme') + .addEntry('theme','./public/theme-entrypoint.js') .splitEntryChunks()