From 225b4c9e6585b6786c904a65dcb05e2f5b0e610a Mon Sep 17 00:00:00 2001 From: ahmetkuslular Date: Tue, 2 Aug 2022 17:08:08 +0300 Subject: [PATCH] webpack budnle analyze static file added - conflict fix --- src/middleware.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/middleware.js b/src/middleware.js index f6e687f..bda1ced 100644 --- a/src/middleware.js +++ b/src/middleware.js @@ -24,6 +24,8 @@ import { HTTP_STATUS_CODES } from './universal/utils/constants'; import voltranConfig from '../voltran.config'; +const { bundleAnalyzerStaticEnabled } = require('__APP_CONFIG__'); + const enablePrometheus = voltranConfig.monitoring.prometheus; let Prometheus; @@ -165,6 +167,11 @@ export const prepareMiddlewares = () => { hiddie.use(helmet()); hiddie.use(cors); hiddie.use('/', serveStatic(`${voltranConfig.distFolder}/public`)); + bundleAnalyzerStaticEnabled && + hiddie.use( + '/bundleAnalyze', + serveStatic(`${voltranConfig.distFolder}/public/project/assets/report.html`) + ); hiddie.use(cookieParser()); hiddie.use(utils); hiddie.use(handleUrls);