2021-10-24 23:04:26 +02:00
|
|
|
import type { webpack5 as webpack } from 'next/dist/compiled/webpack/webpack'
|
2021-10-22 21:32:25 +02:00
|
|
|
|
2020-05-13 17:43:41 +02:00
|
|
|
// This class creates a simplified webpack error that formats nicely based on
|
|
|
|
// webpack's build in serializer.
|
|
|
|
// https://github.com/webpack/webpack/blob/c9d4ff7b054fc581c96ce0e53432d44f9dd8ca72/lib/Stats.js#L294-L356
|
2021-10-24 23:04:26 +02:00
|
|
|
export class SimpleWebpackError extends (Error as unknown as typeof webpack.WebpackError) {
|
2020-05-13 17:43:41 +02:00
|
|
|
file: string
|
|
|
|
|
|
|
|
constructor(file: string, message: string) {
|
|
|
|
super(message)
|
|
|
|
this.file = file
|
|
|
|
}
|
|
|
|
}
|