willb335 / chessboardjsx

:black_square_button: Chessboard built for React
https://chessboardjsx.com
MIT License
267 stars 79 forks source link

add globalObject to webpack prod build for ability to build in node #52

Closed jantznick closed 9 months ago

jantznick commented 4 years ago

I was trying to use chessboardjsx in a project with server side rendering. Since some of it accesses the window object it was breaking my webpack server build since there is no window object on the server.

I came across this info that shows how to resolve this: https://webpack.js.org/configuration/output/#outputglobalobject

When testing on my local build this seems to resolve the issue.

ottomated commented 4 years ago

+1