silverwolf-x/project / packages /next /src /build /webpack /loaders /next-invalid-import-error-loader.ts
silverwolf-x's picture
download
raw
655 Bytes
import type webpack from 'webpack'
export type InvalidImportLoaderOpts = { message: string }
const nextInvalidImportErrorLoader: webpack.LoaderDefinitionFunction<InvalidImportLoaderOpts> =
function () {
const { message } = this.getOptions()
const error = new Error(message)
if (process.env.NEXT_RSPACK) {
// Rspack uses miette for error formatting, which automatically includes stack
// traces in the error message. To avoid showing redundant stack information
// in the final error output, we clear the stack property.
error.stack = undefined
}
throw error
}
export default nextInvalidImportErrorLoader

Xet Storage Details

Size:
655 Bytes
·
Xet hash:
402a72587bcec05dd9e68c6bc659e1fbb1dad99d3ede66cb87224df1c574a14a

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.