mirror of https://github.com/sveltejs/svelte
feat: attach Svelte major version info to window global (#8761)
Can be opt out by setting discloseVersion to false --------- Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com> Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>pull/8772/head
parent
03942162f8
commit
5702142d9e
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
feat: add version info to `window`. You can opt out by setting `discloseVersion` to `false` in the compiler options
|
@ -1,3 +1,7 @@
|
||||
<script>
|
||||
import Counter from "./lib/Counter.svelte";
|
||||
</script>
|
||||
|
||||
<div>
|
||||
Hello world!
|
||||
</div>
|
@ -0,0 +1,5 @@
|
||||
import { PUBLIC_VERSION } from '../../../shared/version.js';
|
||||
|
||||
if (typeof window !== 'undefined')
|
||||
// @ts-ignore
|
||||
(window.__svelte || (window.__svelte = { v: new Set() })).v.add(PUBLIC_VERSION);
|
Loading…
Reference in new issue