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