Buckets:
| import { cyan } from '../../../lib/picocolors' | |
| import path from 'path' | |
| import type { webpack } from 'next/dist/compiled/webpack/webpack' | |
| const ErrorLoader: webpack.LoaderDefinitionFunction = function () { | |
| // @ts-ignore exists | |
| const options = this.getOptions() || ({} as any) | |
| const { reason = 'An unknown error has occurred' } = options | |
| // @ts-expect-error | |
| const resource = this._module?.issuer?.resource ?? null | |
| const context = this.rootContext ?? this._compiler?.context | |
| const issuer = resource | |
| ? context | |
| ? path.relative(context, resource) | |
| : resource | |
| : null | |
| const err = new Error(reason + (issuer ? `\nLocation: ${cyan(issuer)}` : '')) | |
| this.emitError(err) | |
| } | |
| export default ErrorLoader | |
Xet Storage Details
- Size:
- 730 Bytes
- Xet hash:
- 44761a861b40c523768fe9cba9978593e436cbea076e4f9d3283c6a228fa54d0
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.