c9d9ff6a8b
* 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
13 lines
323 B
TypeScript
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
|