revert previous unpleasantness

This commit is contained in:
Richard Harris
2019-06-09 20:10:56 -04:00
parent b6c693934d
commit 8baf694e6d
3 changed files with 2 additions and 11 deletions

View File

@@ -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 {

View File

@@ -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';

View File

@@ -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);
}); });
} }