mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 11:15:14 +00:00
and again...
This commit is contained in:
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user