mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-12 03:05:12 +00:00
apply fix from 01c0097acb (#622)
This commit is contained in:
@@ -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+)\)$/;
|
||||
|
||||
@@ -9,7 +9,7 @@ function munge_warning_or_error(message: string) {
|
||||
const lines = message.split('\n');
|
||||
|
||||
const file = lines.shift()
|
||||
.replace('[7m', '') // careful — there is a special character at the beginning of this string
|
||||
.replace('[7m', '') // careful — there is a special character at the beginning of this string
|
||||
.replace('[27m', '')
|
||||
.replace('./', '');
|
||||
|
||||
@@ -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;
|
||||
}, {})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user