From 0199610834e603e052db5767a1fca36c7ce47d34 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 7 Dec 2020 13:53:32 +0100 Subject: [PATCH] chore: enable back automock plugin --- packages/nitro/src/rollup/config.ts | 4 ++-- packages/nitro/src/rollup/plugins/automock.ts | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/nitro/src/rollup/config.ts b/packages/nitro/src/rollup/config.ts index b278487e7c..34f994c8ce 100644 --- a/packages/nitro/src/rollup/config.ts +++ b/packages/nitro/src/rollup/config.ts @@ -18,7 +18,7 @@ import { resolvePath, MODULE_DIR } from '../utils' import { dynamicRequire } from './plugins/dynamic-require' import { externals } from './plugins/externals' import { timing } from './plugins/timing' -// import { autoMock } from './plugins/automock' +import { autoMock } from './plugins/automock' import { staticAssets, dirnames } from './plugins/static' import { middleware } from './plugins/middleware' import { esbuild } from './plugins/esbuild' @@ -190,7 +190,7 @@ export const getRollupConfig = (sigmaContext: SigmaContext) => { })) // Automatically mock unresolved externals - // rollupConfig.plugins.push(autoMock()) + rollupConfig.plugins.push(autoMock()) // https://github.com/rollup/plugins/tree/master/packages/commonjs rollupConfig.plugins.push(commonjs({ diff --git a/packages/nitro/src/rollup/plugins/automock.ts b/packages/nitro/src/rollup/plugins/automock.ts index f5aad11b10..7393c5820d 100644 --- a/packages/nitro/src/rollup/plugins/automock.ts +++ b/packages/nitro/src/rollup/plugins/automock.ts @@ -1,11 +1,8 @@ -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') }