Mark specific package as noExternal in development mode
#3823
|
Is there any way to mark specific node module package as |
Replies: 2 comments
|
// nitro.config.ts (or the `nitro` block in your framework config)
export default defineNitroConfig({
externals: {
inline: ['the-package'], // a string, or a RegExp if you need to catch subpaths too
},
})Everything else stays external (so dev stays fast) and only that one package gets bundled. Nitro One heads-up if you're on Nitro v3 / latest Nuxt: noExternals: ['the-package'] |
noExternals: trueis all-or-nothing, that's why it breaks. What you actually want is theinlinelist underexternals, which is additive:Everything else stays external (so dev stays fast) and only that one package gets bundled. Nitro
defu-merges yourinlineinto the externals plugin's default list rather than replacing it, and that same plugin runs in the dev rollup build, not justnitro build, so it takes effect innitro dev.One heads-up if you're on Nitro v3 / latest Nuxt:
ext…