Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Improve isomorphism #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

controversial
Copy link
Contributor

Updates webpack config to use "this" over "window" in generated files. This allows the generated files in dist to be usable in both browsers and Node.js.

Previously, some server-side environments could generate "window is not defined" errors as a result of requiring the dist files bundled with prismic-dom, since the webpack-generated dist files referenced window specifically, which is usually only defined in browser environments.

controversial added a commit to controversial/luk.ke that referenced this pull request Mar 21, 2020
bundled prismic-dom files referenced "window," which broke server-side
rendering. I updated the webpack config to use "this" over "window." For
details, see:
- controversial/prismic-dom@c4e8556
- prismicio/prismic-dom#39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant