mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 17:35:57 +00:00
fix(nitro): exclude rootDir
from externals and reinstate automock warning (#66)
This commit is contained in:
parent
3eb3927779
commit
00c7ede623
@ -195,6 +195,7 @@ export const getRollupConfig = (nitroContext: NitroContext) => {
|
|||||||
nitroContext._internal.runtimeDir,
|
nitroContext._internal.runtimeDir,
|
||||||
...(nitroContext._nuxt.dev ? [] : [nitroContext._nuxt.buildDir]),
|
...(nitroContext._nuxt.dev ? [] : [nitroContext._nuxt.buildDir]),
|
||||||
...nitroContext.middleware.map(m => m.handle),
|
...nitroContext.middleware.map(m => m.handle),
|
||||||
|
nitroContext._nuxt.rootDir,
|
||||||
nitroContext._nuxt.serverDir
|
nitroContext._nuxt.serverDir
|
||||||
],
|
],
|
||||||
traceOptions: {
|
traceOptions: {
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
|
import consola from 'consola'
|
||||||
|
|
||||||
export function autoMock () {
|
export function autoMock () {
|
||||||
return {
|
return {
|
||||||
name: 'auto-mock',
|
name: 'auto-mock',
|
||||||
resolveId (src: string) {
|
resolveId (src: string) {
|
||||||
if (src && !src.startsWith('.') && !src.includes('?') && !src.includes('.js')) {
|
if (src && !src.startsWith('.') && !src.includes('?') && !src.includes('.js')) {
|
||||||
|
consola.warn('Auto mock external ', src)
|
||||||
return {
|
return {
|
||||||
id: require.resolve('@nuxt/un/runtime/mock/proxy')
|
id: require.resolve('@nuxt/un/runtime/mock/proxy')
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user