Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(overlay): allow full customization of the error overlay integration #44

Merged
merged 7 commits into from
Mar 27, 2020
Prev Previous commit
Next Next commit
feat(overlay): fix typos in options validator to correctly inject def…
…aults
  • Loading branch information
pmmmwh committed Mar 2, 2020
commit dc4c6609ff06ae3733ce76f83156840cf3f99ae9
7 changes: 5 additions & 2 deletions src/helpers/validateOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const defaultOptions = {
/** @type {import('../types').ErrorOverlayOptions} */
const defaultOverlayOptions = {
entry: require.resolve('../runtime/ErrorOverlayEntry'),
overlay: require.resolve('../overlay'),
module: require.resolve('../overlay'),
};

/**
Expand All @@ -19,7 +19,10 @@ const defaultOverlayOptions = {
module.exports = function validateOptions(options) {
const validatedOptions = Object.assign(defaultOptions, options);

if (typeof validatedOptions.overlay !== 'boolean') {
if (
typeof validatedOptions.overlay !== 'undefined' &&
typeof validatedOptions.overlay !== 'boolean'
) {
if (typeof validatedOptions.overlay.module !== 'string') {
throw new Error(
`To use the "overlay" option, a string must be provided in the "module" property. Instead, the provided value has type: "${typeof options
Expand Down