rsnext/packages/next/build/webpack/loaders/error-loader.ts
Joe Haddad c9d9ff6a8b
Informative Error for Invalid Global CSS (#8958)
* Informative Error for Invalid Global CSS
This adds a helpful error message with a (basic) err.sh link for invalid Global CSS usage.

We'll want to expand on this topic more and offer alternatives when CSS Modules support lands.

* Update expected error message
2019-10-04 11:55:18 -04:00

13 lines
323 B
TypeScript

import loaderUtils from 'loader-utils'
import { loader } from 'webpack'
const ErrorLoader: loader.Loader = function() {
const options = loaderUtils.getOptions(this) || {}
const { reason = 'An unknown error has occurred' } = options
const err = new Error(reason)
this.emitError(err)
}
export default ErrorLoader