rsnext/packages/next/build/webpack/plugins/wellknown-errors-plugin/simpleWebpackError.ts
JJ Kasper 6fd2a7fa31
Remove webpack4 types (#39631)
These types are no longer needed as we are only leveraging webpack 5 so this finishes migrating our types away from webpack 4's types.
2022-08-16 09:55:37 +00:00

13 lines
487 B
TypeScript

import type { webpack } from 'next/dist/compiled/webpack/webpack'
// 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
export class SimpleWebpackError extends (Error as unknown as typeof webpack.WebpackError) {
file: string
constructor(file: string, message: string) {
super(message)
this.file = file
}
}