mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-13 19:45:26 +00:00
16 lines
385 B
TypeScript
16 lines
385 B
TypeScript
import * as fs from 'fs';
|
|
|
|
export default function read_template(dir: string) {
|
|
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;
|
|
}
|
|
} |