mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-18 21:45:12 +00:00
and again...
This commit is contained in:
@@ -57,7 +57,7 @@ export default function create_assets({ src, dest, dev, client_info, server_info
|
|||||||
function generate_service_worker({ chunk_files, src }) {
|
function generate_service_worker({ chunk_files, src }) {
|
||||||
const assets = glob.sync('**', { cwd: 'assets', nodir: true });
|
const assets = glob.sync('**', { cwd: 'assets', nodir: true });
|
||||||
|
|
||||||
const routes = create_routes({ src }); // TODO refactor
|
const routes = create_routes({ src });
|
||||||
|
|
||||||
const route_code = `[${
|
const route_code = `[${
|
||||||
routes
|
routes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import chalk from 'chalk';
|
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';
|
import { dest } from '../config.js';
|
||||||
|
|
||||||
function deferred() {
|
function deferred() {
|
||||||
@@ -70,11 +70,6 @@ export default function create_watcher({ compilers, dev, entry, src, onroutes })
|
|||||||
watcher.on('add', callback);
|
watcher.on('add', callback);
|
||||||
watcher.on('change', callback);
|
watcher.on('change', callback);
|
||||||
watcher.on('unlink', callback);
|
watcher.on('unlink', callback);
|
||||||
|
|
||||||
// watch('templates/**.html', () => {
|
|
||||||
// create_templates();
|
|
||||||
// // TODO reload current page?
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
watch_files('routes/**/*.+(html|js|mjs)', () => {
|
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 });
|
create_app({ dev, entry, src });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch_files('templates/**.html', () => {
|
||||||
|
create_templates();
|
||||||
|
// TODO reload current page?
|
||||||
|
});
|
||||||
|
|
||||||
const watcher = {
|
const watcher = {
|
||||||
ready: invalidate(),
|
ready: invalidate(),
|
||||||
client: watch_compiler('client'),
|
client: watch_compiler('client'),
|
||||||
|
|||||||
Reference in New Issue
Block a user