mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-13 11:35:28 +00:00
17 lines
434 B
TypeScript
17 lines
434 B
TypeScript
import * as fs from 'fs';
|
|
import { locations } from '../config';
|
|
|
|
export default function read_template(dir = locations.src()) {
|
|
try {
|
|
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:
|
|
app/ --> src/
|
|
routes/ --> src/routes/
|
|
assets/ --> static/`);
|
|
}
|
|
|
|
throw err;
|
|
}
|
|
} |