mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 03:05:12 +00:00
22 lines
538 B
TypeScript
22 lines
538 B
TypeScript
import * as fs from 'fs';
|
|
import * as path from 'path';
|
|
import { mkdirp } from './fs_utils';
|
|
|
|
const runtime = [
|
|
'app.mjs',
|
|
'server.mjs',
|
|
'internal/shared.mjs',
|
|
'internal/Sapper.svelte',
|
|
'internal/layout.svelte',
|
|
'internal/error.svelte'
|
|
].map(file => ({
|
|
file,
|
|
source: fs.readFileSync(path.join(__dirname, `../runtime/${file}`), 'utf-8')
|
|
}));
|
|
|
|
export function copy_runtime(output: string) {
|
|
runtime.forEach(({ file, source }) => {
|
|
mkdirp(path.dirname(`${output}/${file}`));
|
|
fs.writeFileSync(`${output}/${file}`, source);
|
|
});
|
|
} |