-> v0.21.1

This commit is contained in:
Rich Harris
2018-09-23 23:21:37 -04:00
parent 9cf90ce01d
commit ff24877d8f
4 changed files with 8 additions and 4 deletions

View File

@@ -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))

View File

@@ -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": {

View File

@@ -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:

View File

@@ -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;