mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-11 19:04:30 +00:00
-> v0.21.1
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# sapper changelog
|
||||
|
||||
## 0.21.1
|
||||
|
||||
* Read template from build directory in production
|
||||
|
||||
## 0.21.0
|
||||
|
||||
* Change project folder structure ([#432](https://github.com/sveltejs/sapper/issues/432))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sapper",
|
||||
"version": "0.21.0",
|
||||
"version": "0.21.1",
|
||||
"description": "Military-grade apps, engineered by Svelte",
|
||||
"main": "dist/middleware.js",
|
||||
"bin": {
|
||||
|
||||
@@ -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