Fix build
All checks were successful
Check & deploy / build (push) Successful in 35s

This commit is contained in:
Andras Schmelczer 2026-06-03 20:13:20 +01:00
parent 790b1352fe
commit e6b7eecf66

View file

@ -27,6 +27,11 @@ module.exports = {
target: 'web', target: 'web',
output: { output: {
path: PATHS.bundles, path: PATHS.bundles,
// The bundle is inlined into index.html (no <script src>), so webpack 5's
// default publicPath:'auto' cannot derive a path from document.currentScript
// and throws "Automatic publicPath is not supported". A static value (assets
// sit next to index.html at the dist root) avoids the runtime auto-detection.
publicPath: '',
clean: true, clean: true,
}, },
//devtool: 'source-map', //devtool: 'source-map',
@ -43,6 +48,10 @@ module.exports = {
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
xhtml: true, xhtml: true,
template: `!!html-loader?${htmlLoaderOptions}!${PATHS.entryHtml}`, template: `!!html-loader?${htmlLoaderOptions}!${PATHS.entryHtml}`,
// The bundle gets inlined, and `defer` is ignored on inline <script>s, so
// it must sit at the end of <body> (not head) to run after the DOM exists.
inject: 'body',
scriptLoading: 'blocking',
minify: { minify: {
collapseWhitespace: true, collapseWhitespace: true,
removeComments: true, removeComments: true,