Skip to content

Commit 0defa52

Browse files
committed
Re-throw errors from PostCSS nodes
1 parent 98158fd commit 0defa52

File tree

1 file changed

+6
-1
lines changed
  • packages/@tailwindcss-postcss/src

1 file changed

+6
-1
lines changed

packages/@tailwindcss-postcss/src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,12 @@ function tailwindcss(opts: PluginOptions = {}): AcceptedPlugin {
335335
// We found that throwing the error will cause PostCSS to no longer watch for changes
336336
// in some situations so we instead log the error and continue with an empty stylesheet.
337337
console.error(error)
338-
root.removeAll()
338+
339+
if (error && typeof error === 'object' && 'message' in error) {
340+
throw root.error(`${error.message}`)
341+
}
342+
343+
throw root.error(`${error}`)
339344
}
340345
},
341346
},

0 commit comments

Comments
 (0)