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

add option to show hmr error overlay, update docs #1239

Merged
merged 1 commit into from
Oct 7, 2020

Conversation

briantjacobs
Copy link
Contributor

Changes

Adds a devOptions.hmrErrorOverlay option for disabling the new error overlay. From discussion: #1229

Testing

Ran snowpack dev --reload with this in package.json

"snowpack": {
    "devOptions": {
        "hmr": true,
        "hmrErrorOverlay": false,
    }
}

Docs

Added an entry into the reference section

@briantjacobs briantjacobs requested a review from a team as a code owner October 7, 2020 15:30
@vercel
Copy link

vercel bot commented Oct 7, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pikapkg/snowpack/17a1thcjk
✅ Preview: https://snowpack-git-412786db104063aa8c99444bd783ced8d59d0c7e.pikapkg.vercel.app

@melissamcewen
Copy link
Contributor

Looks great on the docs side of things 👍

@@ -50,6 +50,7 @@ const DEFAULT_CONFIG: Partial<SnowpackConfig> = {
fallback: 'index.html',
hmrDelay: 0,
hmrPort: 12321,
hmrErrorOverlay: true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@@ -75,7 +75,10 @@ export function wrapHtmlResponse({
});

if (hmr) {
const hmrScript = `<script type="module" src="${getMetaUrlPath('hmr-client.js', config)}"></script><script type="module" src="${getMetaUrlPath('hmr-error-overlay.js', config)}"></script>`;
let hmrScript = `<script type="module" src="${getMetaUrlPath('hmr-client.js', config)}"></script>`;
if (config.devOptions.hmrErrorOverlay) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻 Simple! Yet effective.

Copy link
Collaborator

@drwpow drwpow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@drwpow drwpow merged commit 5da777b into FredKSchott:master Oct 7, 2020
@briantjacobs
Copy link
Contributor Author

Nice! Thanks all

@FredKSchott
Copy link
Owner

Thanks @briantjacobs !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants