I'm trying to use opensearch in one of my hooks, and the library does not run in the browser. So I configured webpack to ignore it, following the docs here -
Although this works fine in dev (only if I stop using ts-node, albeit with a warning), it doesn't work in production. I get all the errors as if I haven't modified the webpack config at all.
I've tried clearing webpack cache, still doesn't work. What am I doing wrong?
Solved: need to ignore the file with both
.js
and
.ts
extensions. The tutorial mentions
.js
only. Happy to send a PR for the docs if this is actually the recommended solution
That is a good idea for a docs improvement. Aliasing webpack modules is a pain point so anything we can do to make this better is welcomed!
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.