Compare commits

...

3 Commits

Author SHA1 Message Date
Rich Harris
608fdb7533 -> v0.0.12 2017-12-14 07:15:07 -05:00
Rich Harris
80166b5a7d -> v0.0.11 2017-12-14 07:12:01 -05:00
Rich Harris
24b259f80b fix location, so that runtime can be found from /tmp 2017-12-14 07:11:52 -05:00
3 changed files with 10 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "sapper",
"version": "0.0.10",
"version": "0.0.12",
"description": "Combat-ready apps, engineered by Svelte",
"main": "connect.js",
"directories": {

View File

@@ -1,9 +1,12 @@
import app from 'sapper/runtime/app.js';
import { detachNode } from 'svelte/shared.js';
import app from '__app__';
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 = '';

View File

@@ -34,6 +34,7 @@ module.exports = function create_app(src, dest, routes, options) {
.join(' else ') + ' else return false;';
const main = template
.replace('__app__', path.resolve(__dirname, '../runtime/app.js'))
.replace('__selector__', options.selector || 'main')
.replace('// ROUTES', code);