mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-11 19:04:30 +00:00
revert previous unpleasantness
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { writable } from 'svelte/store.mjs';
|
import { writable } from 'svelte/store';
|
||||||
import App from '@sapper/internal/App.svelte';
|
import App from '@sapper/internal/App.svelte';
|
||||||
import { root_preload, ErrorComponent, ignore, components, routes } from '@sapper/internal/manifest-client';
|
import { root_preload, ErrorComponent, ignore, components, routes } from '@sapper/internal/manifest-client';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { writable } from 'svelte/store.mjs';
|
import { writable } from 'svelte/store';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import cookie from 'cookie';
|
import cookie from 'cookie';
|
||||||
|
|||||||
@@ -1,14 +1,7 @@
|
|||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import relative from 'require-relative';
|
|
||||||
import { mkdirp } from './fs_utils';
|
import { mkdirp } from './fs_utils';
|
||||||
|
|
||||||
const svelte_pkg = relative('svelte/package.json', process.cwd());
|
|
||||||
const match = /(\d+)\.(\d+)\.(\d+)/.exec(svelte_pkg.version);
|
|
||||||
const legacy = match
|
|
||||||
? ((+match[1] - 3) || (+match[2] - 4) || (+match[3] - 4)) <= 0
|
|
||||||
: false; // ???
|
|
||||||
|
|
||||||
const runtime = [
|
const runtime = [
|
||||||
'app.mjs',
|
'app.mjs',
|
||||||
'server.mjs',
|
'server.mjs',
|
||||||
@@ -23,8 +16,6 @@ const runtime = [
|
|||||||
export function copy_runtime(output: string) {
|
export function copy_runtime(output: string) {
|
||||||
runtime.forEach(({ file, source }) => {
|
runtime.forEach(({ file, source }) => {
|
||||||
mkdirp(path.dirname(`${output}/${file}`));
|
mkdirp(path.dirname(`${output}/${file}`));
|
||||||
|
|
||||||
if (!legacy) source = source.replace(/svelte\/(.+)\.mjs/g, `svelte/$1/index.mjs`);
|
|
||||||
fs.writeFileSync(`${output}/${file}`, source);
|
fs.writeFileSync(`${output}/${file}`, source);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user