I get the following error when I add the get-pixels
library:
node_modules/get-pixels/dom-pixels.js:3:28:
3 │ var path = require(‘path’)
╵ ~~~~~~The package “path” wasn’t found on the file system but is built into node. Are you trying to bundle for node? You can use “–platform=node” to do that, which will remove this error.
but when I add --platform=node
to esbuild arguments I get this error (in the browser console):
Uncaught ReferenceError: require is not defined
What is the work around this issue?