From 4c2ca3247dcf4c854b7eccff27a1d8ed02ee92aa Mon Sep 17 00:00:00 2001 From: Jack Westbrook Date: Tue, 16 Jan 2024 17:49:52 +0100 Subject: [PATCH] chore(frontend): wip: comment out __webpack_public_path vars for build to succeed --- public/app/index.ts | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/public/app/index.ts b/public/app/index.ts index cfbaee2e5cd..d50ecb988a1 100644 --- a/public/app/index.ts +++ b/public/app/index.ts @@ -1,22 +1,25 @@ +import 'vite/modulepreload-polyfill'; import './core/trustedTypePolicies'; -declare let __webpack_public_path__: string; -declare let __webpack_nonce__: string; -// Check if we are hosting files on cdn and set webpack public path -if (window.public_cdn_path) { - __webpack_public_path__ = window.public_cdn_path; -} +// TODO: Vite should have __wepack_public_path support. Not looked into it yet. +// declare let __webpack_public_path__: string; +// declare let __webpack_nonce__: string; -// This is a path to the public folder without '/build' -window.__grafana_public_path__ = - __webpack_public_path__.substring(0, __webpack_public_path__.lastIndexOf('build/')) || __webpack_public_path__; +// // Check if we are hosting files on cdn and set webpack public path +// if (window.public_cdn_path) { +// __webpack_public_path__ = window.public_cdn_path; +// } -if (window.nonce) { - __webpack_nonce__ = window.nonce; -} +// // This is a path to the public folder without '/build' +// window.__grafana_public_path__ = +// __webpack_public_path__.substring(0, __webpack_public_path__.lastIndexOf('build/')) || __webpack_public_path__; -// This is an indication to the window.onLoad failure check that the app bundle has loaded. -window.__grafana_app_bundle_loaded = true; +// if (window.nonce) { +// __webpack_nonce__ = window.nonce; +// } + +// // This is an indication to the window.onLoad failure check that the app bundle has loaded. +// window.__grafana_app_bundle_loaded = true; import app from './app';