mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-19 13:55:21 +00:00
various lost changes and fixes from 0.26.0-alpha.10
This commit is contained in:
@@ -199,9 +199,10 @@ class Watcher extends EventEmitter {
|
|||||||
});
|
});
|
||||||
|
|
||||||
manifest_data = new_manifest_data;
|
manifest_data = new_manifest_data;
|
||||||
} catch (err) {
|
} catch (error) {
|
||||||
this.emit('error', <ErrorEvent>{
|
this.emit('error', <ErrorEvent>{
|
||||||
message: err.message
|
type: 'manifest',
|
||||||
|
error
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -408,11 +409,11 @@ class Watcher extends EventEmitter {
|
|||||||
}) {
|
}) {
|
||||||
compiler.oninvalid(invalid);
|
compiler.oninvalid(invalid);
|
||||||
|
|
||||||
compiler.watch((err?: Error, result?: CompileResult) => {
|
compiler.watch((error?: Error, result?: CompileResult) => {
|
||||||
if (err) {
|
if (error) {
|
||||||
this.emit('error', <ErrorEvent>{
|
this.emit('error', <ErrorEvent>{
|
||||||
type: name,
|
type: name,
|
||||||
message: err.message
|
error
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.emit('build', {
|
this.emit('build', {
|
||||||
|
|||||||
12
src/cli.ts
12
src/cli.ts
@@ -89,8 +89,16 @@ prog.command('dev')
|
|||||||
});
|
});
|
||||||
|
|
||||||
watcher.on('error', (event: ErrorEvent) => {
|
watcher.on('error', (event: ErrorEvent) => {
|
||||||
console.log(colors.red(`✗ ${event.type}`));
|
const { type, error } = event;
|
||||||
console.log(colors.red(event.message));
|
|
||||||
|
console.log(colors.bold().red(`✗ ${type}`));
|
||||||
|
|
||||||
|
if (error.loc && error.loc.file) {
|
||||||
|
console.log(colors.bold(`${path.relative(process.cwd(), error.loc.file)} (${error.loc.line}:${error.loc.column})`));
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(colors.red(event.error.message));
|
||||||
|
if (error.frame) console.log(error.frame);
|
||||||
});
|
});
|
||||||
|
|
||||||
watcher.on('fatal', (event: FatalEvent) => {
|
watcher.on('fatal', (event: FatalEvent) => {
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ export default function extract_css(client_result: CompileResult, components: Pa
|
|||||||
chunks_with_css.add(chunk);
|
chunks_with_css.add(chunk);
|
||||||
});
|
});
|
||||||
|
|
||||||
const entry = path.resolve(dirs.src, 'app.mjs');
|
const entry = path.resolve(dirs.src, 'client.js');
|
||||||
const entry_chunk = client_result.chunks.find(chunk => chunk.modules.indexOf(entry) !== -1);
|
const entry_chunk = client_result.chunks.find(chunk => chunk.modules.indexOf(entry) !== -1);
|
||||||
|
|
||||||
const entry_chunk_dependencies: Set<Chunk> = new Set([entry_chunk]);
|
const entry_chunk_dependencies: Set<Chunk> = new Set([entry_chunk]);
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ export type ReadyEvent = {
|
|||||||
|
|
||||||
export type ErrorEvent = {
|
export type ErrorEvent = {
|
||||||
type: string;
|
type: string;
|
||||||
message: string;
|
error: Error;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type FatalEvent = {
|
export type FatalEvent = {
|
||||||
|
|||||||
Reference in New Issue
Block a user