2023-04-28 00:20:37 +08:00
|
|
|
import './core/trustedTypePolicies';
|
2021-02-01 17:13:09 +08:00
|
|
|
declare let __webpack_public_path__: string;
|
2021-04-26 17:38:24 +08:00
|
|
|
declare let __webpack_nonce__: string;
|
2021-02-01 17:13:09 +08:00
|
|
|
|
2021-11-08 23:13:37 +08:00
|
|
|
// Check if we are hosting files on cdn and set webpack public path
|
2021-04-28 00:34:56 +08:00
|
|
|
if (window.public_cdn_path) {
|
|
|
|
|
__webpack_public_path__ = window.public_cdn_path;
|
2021-02-01 17:13:09 +08:00
|
|
|
}
|
2019-12-05 15:30:39 +08:00
|
|
|
|
2021-04-26 02:17:35 +08:00
|
|
|
// This is a path to the public folder without '/build'
|
2021-04-28 00:34:56 +08:00
|
|
|
window.__grafana_public_path__ =
|
2021-04-26 02:17:35 +08:00
|
|
|
__webpack_public_path__.substring(0, __webpack_public_path__.lastIndexOf('build/')) || __webpack_public_path__;
|
|
|
|
|
|
2022-06-22 16:28:05 +08:00
|
|
|
if (window.nonce) {
|
|
|
|
|
__webpack_nonce__ = window.nonce;
|
2021-04-26 17:38:24 +08:00
|
|
|
}
|
|
|
|
|
|
2021-11-08 23:13:37 +08:00
|
|
|
// This is an indication to the window.onLoad failure check that the app bundle has loaded.
|
|
|
|
|
window.__grafana_app_bundle_loaded = true;
|
|
|
|
|
|
2021-02-01 17:13:09 +08:00
|
|
|
import app from './app';
|
2024-09-04 17:22:03 +08:00
|
|
|
|
|
|
|
|
const prepareInit = async () => {
|
|
|
|
|
if (process.env.frontend_dev_mock_api) {
|
|
|
|
|
return import('test/mock-api/worker').then((workerModule) => {
|
|
|
|
|
workerModule.default.start({ onUnhandledRequest: 'bypass' });
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
return Promise.resolve();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
prepareInit().then(() => {
|
|
|
|
|
app.init();
|
|
|
|
|
});
|