Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix(nuxt): include layers in esbuild transform (#9014)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Nov 15, 2022
1 parent 74b81bb commit 4c8369f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/nuxt/src/core/nitro.ts
Expand Up @@ -4,6 +4,7 @@ import { createNitro, createDevServer, build, prepare, copyPublicAssets, writeTy
import type { NitroConfig } from 'nitropack'
import type { Nuxt } from '@nuxt/schema'
import { resolvePath } from '@nuxt/kit'
import escapeRE from 'escape-string-regexp'
import defu from 'defu'
import fsExtra from 'fs-extra'
import { dynamicEventHandler } from 'h3'
Expand All @@ -21,6 +22,13 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
srcDir: nuxt.options.serverDir,
dev: nuxt.options.dev,
buildDir: nuxt.options.buildDir,
esbuild: {
options: {
exclude: [
new RegExp(`node_modules\\/(?!${nuxt.options._layers.map(l => l.cwd.match(/(?<=\/)node_modules\/(.+)$/)?.[1]).filter(Boolean).map(dir => escapeRE(dir!)).join('|')})`)
]
}
},
analyze: nuxt.options.build.analyze && {
template: 'treemap',
projectRoot: nuxt.options.rootDir,
Expand Down

0 comments on commit 4c8369f

Please sign in to comment.