Error: Cannot find module 'uxp'

I decided to bundle my uxp plugin with esbuild, but I am unable to get past this error,

Error: Cannot find module 'uxp'

The code errors at this line:
const g_entrypoints_o = require("uxp").entrypoints;

I tried RequireJS but it did not solve my issue. What else can I try?

In webpack you have to set configuration to not touch “uxp”. Similar goes for ESBuild: alchemist/esbuild.config.js at ec428f8113a95a6d855a5dd14fbeca5c5e38e7fc · jardicc/alchemist · GitHub

2 Likes

That makes sense. Thank you!