From 646c3df3c670e4d31db218aa0927576e1575beac Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Mon, 23 Dec 2019 16:38:49 -0800 Subject: [PATCH] Pass compiler version in dev events --- rollup.config.js | 3 +++ src/runtime/internal/dev.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index ac171b85f1..6f3d893a33 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -60,6 +60,9 @@ export default [ ], external, plugins: [ + replace({ + __VERSION__: pkg.version + }), ts_plugin, { writeBundle(bundle) { diff --git a/src/runtime/internal/dev.ts b/src/runtime/internal/dev.ts index cb60131166..1829225ad9 100644 --- a/src/runtime/internal/dev.ts +++ b/src/runtime/internal/dev.ts @@ -2,7 +2,7 @@ import { custom_event, append, insert, detach, listen, attr } from './dom'; import { SvelteComponent } from './Component'; export function dispatch_dev(type: string, detail?: T) { - document.dispatchEvent(custom_event(type, detail)); + document.dispatchEvent(custom_event(type, { version: '__VERSION__', ...detail })); } export function append_dev(target: Node, node: Node) {