diff --git a/public/app/index.ts b/public/app/index.ts index 88335b03ba3..5b68d3e94fa 100644 --- a/public/app/index.ts +++ b/public/app/index.ts @@ -10,8 +10,8 @@ if (window.public_cdn_path) { window.__grafana_public_path__ = __webpack_public_path__.substring(0, __webpack_public_path__.lastIndexOf('build/')) || __webpack_public_path__; -if ((window as any).nonce) { - __webpack_nonce__ = (window as any).nonce; +if (window.nonce) { + __webpack_nonce__ = window.nonce; } // This is an indication to the window.onLoad failure check that the app bundle has loaded. diff --git a/public/app/types/window.d.ts b/public/app/types/window.d.ts index 94bf02f0026..08ab5dc9105 100644 --- a/public/app/types/window.d.ts +++ b/public/app/types/window.d.ts @@ -4,5 +4,6 @@ export declare global { __grafana_public_path__: string; __grafana_load_failed: () => void; public_cdn_path: string; + nonce: string | undefined; } }