diff --git a/webpack.mix.js b/webpack.mix.js index 414cc85..4ceee26 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -14,6 +14,15 @@ const mix = require('laravel-mix'); /* required for Leaflet layer control icon */ mix.setResourceRoot(process.env.ASSET_URL ?? ''); +/* set reverse proxy sub-path required for generated links to resources */ +if (['production', 'testing'].includes(process.env.APP_ENV)) { + mix.webpackConfig({ + output: { + publicPath: process.env.MIX_PROXY_PATH + '/', + }, + }); +} + mix.js('resources/js/app.js', 'public/js') .vue() .postCss('resources/css/app.css', 'public/css', [