-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature request: allow extend builder externals #53
Comments
Nice idea to support option. BTW have you tried adding a |
No, because I didn't find any mentions about |
Yes, I added |
I had a very similar issue that I have been tackling for the past several days. +1 for this to be provided in a README. |
Would it be possible to share an example |
In my case the defu package was the issue and preventing me to release. Add build.config.ts to your root directory and fill it with export default defineBuildConfig({ You can also see the build.config.ts in the root of this project https://github.com/nuxt/module-builder/blob/main/build.config.ts |
The right solution in most cases is adding the packages concerned to your package.json as either dependencies or peerDependencies. If your module is going to use them or import them, they should be declared as dependencies. Specifying externals manually is an escape hatch and should be used with caution. |
Ah thanks for the info. I just added defu to "dependencies" (it was missing somehow) and the build warning was gone withouth any extra build config 💯 |
Here is an example of how to configure it in a build.config: https://github.com/nuxt/nuxt/blob/main/packages/schema/build.config.ts#L21 |
@danielroe Is there a way to tell the module-builder to transpile a dependency? We have a monorepo with a utils package written in Typescript. One of the functions is imported from a |
Let's imagine that I'm creating some helpers which I want to use in my modules definition. Some of them so specific and never will be included in @nuxt/kit, but I use some kit methods to create them.
Just an example:
This function relies on
@nuxt/kit
anddefu
and if I define it in module definition, module builds successfully, but after moving this snippet to another package (e.g.@yolkin/config
)@nuxt/module-builder
tries to inline lots of files, because@yolkin/config
is not listed in externals:module-builder/src/build.ts
Lines 31 to 41 in 6453ed0
So, I want to have an ability to extend externals to have an ability to build my modules with extended functions without inlining the whole nuxt inside of it.
The text was updated successfully, but these errors were encountered: