mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 11:15:14 +00:00
get tests passing again
This commit is contained in:
@@ -76,7 +76,7 @@ async function execute(emitter: EventEmitter, {
|
||||
if (serviceworker) {
|
||||
create_serviceworker_manifest({
|
||||
routes: route_objects,
|
||||
client_files: client_result.assets.map((chunk: { name: string }) => `client/${chunk.name}`)
|
||||
client_files: client_result.assets.map((file: string) => `client/${file}`)
|
||||
});
|
||||
|
||||
serviceworker_stats = await serviceworker.compile();
|
||||
|
||||
@@ -268,7 +268,7 @@ class Watcher extends EventEmitter {
|
||||
fs.writeFileSync(path.join(dest, 'client_assets.json'), JSON.stringify(result.assetsByChunkName, null, ' '));
|
||||
this.deferreds.client.fulfil();
|
||||
|
||||
const client_files = result.assets.map((chunk: { name: string }) => `client/${chunk.name}`);
|
||||
const client_files = result.assets.map((file: string) => `client/${file}`);
|
||||
|
||||
create_serviceworker_manifest({
|
||||
routes: create_routes(),
|
||||
|
||||
@@ -17,7 +17,7 @@ export class CompileResult {
|
||||
duration: number;
|
||||
errors: CompileError[];
|
||||
warnings: CompileError[];
|
||||
assets: Array<{ name: string }>;
|
||||
assets: string[];
|
||||
assetsByChunkName: Record<string, string>;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ class WebpackResult extends CompileResult {
|
||||
|
||||
this.duration = info.time;
|
||||
|
||||
this.assets = info.assets.map((chunk: { name: string }) => `client/${chunk.name}`);
|
||||
this.assets = info.assets.map((chunk: { name: string }) => chunk.name);
|
||||
this.assetsByChunkName = info.assetsByChunkName;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,8 +56,6 @@ function generate_client(
|
||||
const server_routes_to_ignore = routes.server_routes.filter(route =>
|
||||
!page_ids.has(route.pattern.toString()));
|
||||
|
||||
const len = Math.max(...routes.components.map(c => c.name.length));
|
||||
|
||||
let code = `
|
||||
// This file is generated by Sapper — do not edit it!
|
||||
import root from '${get_file(path_to_routes, routes.root)}';
|
||||
|
||||
@@ -484,7 +484,7 @@ function get_page_handler(
|
||||
let scripts = []
|
||||
.concat(chunks.main) // chunks main might be an array. it might not! thanks, webpack
|
||||
.filter(file => !file.match(/\.map$/))
|
||||
.map(file => `<script type="module" src='${req.baseUrl}/client/${file}'></script>`)
|
||||
.map(file => `<script src='${req.baseUrl}/client/${file}'></script>`)
|
||||
.join('');
|
||||
|
||||
let inline_script = `__SAPPER__={${[
|
||||
|
||||
Reference in New Issue
Block a user