and again...

This commit is contained in:
Rich Harris
2018-01-21 16:14:16 -05:00
parent 4940644ae3
commit fd0dd4fe58
2 changed files with 7 additions and 7 deletions

View File

@@ -57,7 +57,7 @@ export default function create_assets({ src, dest, dev, client_info, server_info
function generate_service_worker({ chunk_files, src }) {
const assets = glob.sync('**', { cwd: 'assets', nodir: true });
const routes = create_routes({ src }); // TODO refactor
const routes = create_routes({ src });
const route_code = `[${
routes

View File

@@ -1,7 +1,7 @@
import * as fs from 'fs';
import * as path from 'path';
import chalk from 'chalk';
import { create_assets, create_routes, create_app } from 'sapper/core.js';
import { create_app, create_assets, create_routes, create_templates } from 'sapper/core.js';
import { dest } from '../config.js';
function deferred() {
@@ -70,11 +70,6 @@ export default function create_watcher({ compilers, dev, entry, src, onroutes })
watcher.on('add', callback);
watcher.on('change', callback);
watcher.on('unlink', callback);
// watch('templates/**.html', () => {
// create_templates();
// // TODO reload current page?
// });
}
watch_files('routes/**/*.+(html|js|mjs)', () => {
@@ -88,6 +83,11 @@ export default function create_watcher({ compilers, dev, entry, src, onroutes })
create_app({ dev, entry, src });
});
watch_files('templates/**.html', () => {
create_templates();
// TODO reload current page?
});
const watcher = {
ready: invalidate(),
client: watch_compiler('client'),