mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 19:25:10 +00:00
Merge branch 'master' into spread_routes
This commit is contained in:
@@ -44,7 +44,7 @@ export function create_serviceworker_manifest({ manifest_data, output, client_fi
|
||||
client_files: string[];
|
||||
static_files: string;
|
||||
}) {
|
||||
let files: string[] = ['/service-worker-index.html'];
|
||||
let files: string[] = ['service-worker-index.html'];
|
||||
|
||||
if (fs.existsSync(static_files)) {
|
||||
files = files.concat(walk(static_files));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import format_messages from 'webpack-format-messages';
|
||||
import { CompileResult, BuildInfo, CompileError, Chunk, CssFile } from './interfaces';
|
||||
import { ManifestData, Dirs } from '../../interfaces';
|
||||
import { ManifestData, Dirs, PageComponent } from '../../interfaces';
|
||||
|
||||
const locPattern = /\((\d+):(\d+)\)$/;
|
||||
|
||||
@@ -66,12 +66,15 @@ export default class WebpackResult implements CompileResult {
|
||||
assets: this.assets,
|
||||
css: {
|
||||
main: extract_css(this.assets.main),
|
||||
chunks: Object
|
||||
.keys(this.assets)
|
||||
.filter(chunkName => chunkName !== 'main')
|
||||
.reduce((chunks: { [key: string]: string }, chukName) => {
|
||||
const assets = this.assets[chukName];
|
||||
chunks[chukName] = extract_css(assets);
|
||||
chunks: manifest_data.components
|
||||
.reduce((chunks: Record<string, string[]>, component: PageComponent) => {
|
||||
const css_dependencies = [];
|
||||
const css = extract_css(this.assets[component.name]);
|
||||
|
||||
if (css) css_dependencies.push(css);
|
||||
|
||||
chunks[component.file] = css_dependencies;
|
||||
|
||||
return chunks;
|
||||
}, {})
|
||||
}
|
||||
@@ -81,4 +84,4 @@ export default class WebpackResult implements CompileResult {
|
||||
print() {
|
||||
return this.stats.toString({ colors: true });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user