From ab09d319e944954b1485e0e4c88d94fdaa55d8d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sat, 6 Jan 2024 01:06:56 +0100 Subject: [PATCH] Fixed wrong path for assets managed by webpack and loaded via twig asset() function. This had also the effect that 2FA via webauthn were not working, as the request the invalid path resetted the webauthn request saved in session. --- webpack.config.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 1eab3652..d5243897 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -41,6 +41,12 @@ Encore // only needed for CDN's or subdirectory deploy (this should not be needeed, as we use auto public path) //.setManifestKeyPrefix('build/') + //Use build/ as public path inisde the manifest.json (instead of "auto") + //Without this all webpack managed stuff which is loaded via the assets() twig function will not work + .configureManifestPlugin(options => { + options.publicPath = 'build/'; + }) + /* * ENTRY CONFIG * @@ -185,4 +191,4 @@ module.exports = Encore.getWebpackConfig(); //Enable webpack auto public path (this only works in combination with WebpackAutoPathSubscriber!!) //We do it here to supress a warning caused by webpack Encore -module.exports.output.publicPath = 'auto'; \ No newline at end of file +module.exports.output.publicPath = 'auto';