From 00c7ede623728d289bb66b459b6eec184affcbfb Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 9 Apr 2021 09:03:49 +0100 Subject: [PATCH] fix(nitro): exclude `rootDir` from externals and reinstate automock warning (#66) --- packages/nitro/src/rollup/config.ts | 1 + packages/nitro/src/rollup/plugins/automock.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/packages/nitro/src/rollup/config.ts b/packages/nitro/src/rollup/config.ts index b293d3b59f..3daeb0c95f 100644 --- a/packages/nitro/src/rollup/config.ts +++ b/packages/nitro/src/rollup/config.ts @@ -195,6 +195,7 @@ export const getRollupConfig = (nitroContext: NitroContext) => { nitroContext._internal.runtimeDir, ...(nitroContext._nuxt.dev ? [] : [nitroContext._nuxt.buildDir]), ...nitroContext.middleware.map(m => m.handle), + nitroContext._nuxt.rootDir, nitroContext._nuxt.serverDir ], traceOptions: { diff --git a/packages/nitro/src/rollup/plugins/automock.ts b/packages/nitro/src/rollup/plugins/automock.ts index 7393c5820d..f5aad11b10 100644 --- a/packages/nitro/src/rollup/plugins/automock.ts +++ b/packages/nitro/src/rollup/plugins/automock.ts @@ -1,8 +1,11 @@ +import consola from 'consola' + export function autoMock () { return { name: 'auto-mock', resolveId (src: string) { if (src && !src.startsWith('.') && !src.includes('?') && !src.includes('.js')) { + consola.warn('Auto mock external ', src) return { id: require.resolve('@nuxt/un/runtime/mock/proxy') }