Added this direct hotfix for window not being available server-sided. It's been 9 months since the PR for this has been proposed, so I think that 'temporary' fix in the readme should be implemented directly for the time being.
Functionally, this does the same as the proposed readme fix:
Puts the Hammer.js import in a try/catch block
If an error occurs (-> window is not defined), it assigns an empty stub to Hammer instead
It's not the most beautiful fix, but better than workarounds with webpack that don't work on certain setups.
Added this direct hotfix for
window
not being available server-sided. It's been 9 months since the PR for this has been proposed, so I think that 'temporary' fix in the readme should be implemented directly for the time being.Functionally, this does the same as the proposed readme fix:
window is not defined
), it assigns an empty stub toHammer
insteadIt's not the most beautiful fix, but better than workarounds with webpack that don't work on certain setups.