mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-13 03:25:24 +00:00
-> v0.21.1
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import * as fs from 'fs';
|
||||
import { locations } from '../config';
|
||||
|
||||
export default function read_template() {
|
||||
export default function read_template(dir = locations.src()) {
|
||||
try {
|
||||
return fs.readFileSync(`${locations.src()}/template.html`, 'utf-8');
|
||||
return fs.readFileSync(`${dir}/template.html`, 'utf-8');
|
||||
} catch (err) {
|
||||
if (fs.existsSync(`app/template.html`)) {
|
||||
throw new Error(`As of Sapper 0.21, the default folder structure has been changed:
|
||||
|
||||
@@ -290,7 +290,7 @@ function get_page_handler(
|
||||
|
||||
const template = dev()
|
||||
? () => read_template()
|
||||
: (str => () => str)(read_template());
|
||||
: (str => () => str)(read_template(output));
|
||||
|
||||
const { server_routes, pages } = manifest;
|
||||
const error_route = manifest.error;
|
||||
|
||||
Reference in New Issue
Block a user