#How to bundle pnpm workspace package into extension?

4 messages · Page 1 of 1 (latest)

nocturne quiver
#

I have a pnpm workspace setup like this:

  • packages
    • frontend
    • backend
    • utils
    • directus-extensions
      • example-extension
        • src
          • index.ts

I'm trying to use the utils package inside example-extension and added it to its package.json using: "utils": "workspace:*", in my devDependencies.
Everything seems fine while writing the code, no TS import errors or anything. However, when building the extension using pnpm directus-extension build, I get:

- Building Directus extension...
│ "utils" is imported by "src/index.ts", but could not be resolved – treating it as an external dependency.

Anyone ran into this before? If so, how did you fix it?

fallen furnaceBOT
#

Thanks for posting! This is a community powered server, so you may or may not get an answer based on available help and expertise. To increase your chances of somebody being able to help you, please help us help you making sure you:

  • Adding an explanation of exactly what you're trying to achieve.
  • Adding any and all related code or previous attempts.
  • Describing the exact issue or error you are facing.
  • Posting any screenshots if applicable.
  • Reading through https://stackoverflow.com/help/how-to-ask.

When you're done with this thread, please close it. Thanks! ✨

(If you have a support agreement and need help, please contact the core team via email.)

torpid jungle
#

Please don't bump your questions - it's against the server rules. I've deleted your other message

nocturne quiver
#

I'm sorry! I felt like the channel didn't really attract any attention and I was super puzzled over this problem, hence the bump. Won't do it again.