From 608fdb75336a3d7f3c28b8d079b5411dd0bd0d51 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Thu, 14 Dec 2017 07:15:07 -0500 Subject: [PATCH] -> v0.0.12 --- package.json | 2 +- templates/main.js | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index c01498e..cc29582 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sapper", - "version": "0.0.11", + "version": "0.0.12", "description": "Combat-ready apps, engineered by Svelte", "main": "connect.js", "directories": { diff --git a/templates/main.js b/templates/main.js index da7a7e2..8eaa116 100644 --- a/templates/main.js +++ b/templates/main.js @@ -1,9 +1,12 @@ import app from '__app__'; -import { detachNode } from 'svelte/shared.js'; const target = document.querySelector('__selector__'); let component; +const detach = node => { + node.parentNode.removeChild(node); +}; + app.init(url => { if (url.origin !== window.location.origin) return; @@ -25,9 +28,9 @@ app.init(url => { let end = document.querySelector('#sapper-head-end'); if (start && end) { - while (start.nextSibling !== end) detachNode(start.nextSibling); - detachNode(start); - detachNode(end); + while (start.nextSibling !== end) detach(start.nextSibling); + detach(start); + detach(end); } target.innerHTML = '';