Fixed watch mode aborting on CSS error

This commit is contained in:
squidfunk 2021-02-27 18:21:02 +01:00
parent 36f13cb0af
commit c13012da3d

View File

@ -25,6 +25,7 @@ import { build as esbuild } from "esbuild"
import * as path from "path" import * as path from "path"
import postcss from "postcss" import postcss from "postcss"
import { import {
NEVER,
Observable, Observable,
concat, concat,
defer, defer,
@ -32,6 +33,7 @@ import {
of of
} from "rxjs" } from "rxjs"
import { import {
catchError,
endWith, endWith,
ignoreElements, ignoreElements,
switchMap switchMap
@ -130,6 +132,10 @@ export function transformStyle(
} }
}) })
), ),
catchError(err => {
console.log(err.formatted || err.message)
return NEVER
}),
switchMap(({ css, map }) => { switchMap(({ css, map }) => {
const file = digest(options.to, css) const file = digest(options.to, css)
return concat( return concat(