mirror of
https://github.com/kevin-DL/sapper-template.git
synced 2026-01-14 19:24:40 +00:00
update for 0.22
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import { init } from 'sapper/runtime.js';
|
||||
import { manifest } from './manifest/client.js';
|
||||
import * as sapper from '../__sapper__/client.js';
|
||||
|
||||
init({
|
||||
target: document.querySelector('#sapper'),
|
||||
manifest
|
||||
sapper.start({
|
||||
target: document.querySelector('#sapper')
|
||||
});
|
||||
@@ -1,8 +1,7 @@
|
||||
import sirv from 'sirv';
|
||||
import polka from 'polka';
|
||||
import sapper from 'sapper';
|
||||
import compression from 'compression';
|
||||
import { manifest } from './manifest/server.js';
|
||||
import * as sapper from '../__sapper__/server.js';
|
||||
|
||||
const { PORT, NODE_ENV } = process.env;
|
||||
const dev = NODE_ENV === 'development';
|
||||
@@ -11,7 +10,7 @@ polka() // You can also use Express
|
||||
.use(
|
||||
compression({ threshold: 0 }),
|
||||
sirv('static', { dev }),
|
||||
sapper({ manifest })
|
||||
sapper.middleware()
|
||||
)
|
||||
.listen(PORT, err => {
|
||||
if (err) console.log('error', err);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { timestamp, assets, shell, routes } from './manifest/service-worker.js';
|
||||
import { timestamp, files, shell, routes } from '../__sapper__/service-worker.js';
|
||||
|
||||
const ASSETS = `cache${timestamp}`;
|
||||
|
||||
// `shell` is an array of all the files generated by webpack,
|
||||
// `assets` is an array of everything in the `assets` directory
|
||||
// `files` is an array of everything in the `static` directory
|
||||
const to_cache = shell.concat(assets);
|
||||
const cached = new Set(to_cache);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user