prismic-dom icon indicating copy to clipboard operation
prismic-dom copied to clipboard

Improve isomorphism

Open controversial opened this issue 4 years ago • 0 comments

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 avatar Mar 21 '20 18:03 controversial