diff --git a/packages/nuxt3/src/app/declarations/nuxt-build.d.ts b/packages/nuxt3/src/app/declarations/nuxt-build.d.ts index 854fae47ef..f3681dab5b 100644 --- a/packages/nuxt3/src/app/declarations/nuxt-build.d.ts +++ b/packages/nuxt3/src/app/declarations/nuxt-build.d.ts @@ -1,4 +1,4 @@ -declare module '~build/routes' { +declare module 'nuxt/build/routes' { import { RouteRecordRaw } from 'vue-router' const _default: RouteRecordRaw[] diff --git a/packages/nuxt3/src/app/plugins/router/index.ts b/packages/nuxt3/src/app/plugins/router/index.ts index 98fb06e5b2..f15517c9ee 100644 --- a/packages/nuxt3/src/app/plugins/router/index.ts +++ b/packages/nuxt3/src/app/plugins/router/index.ts @@ -6,10 +6,9 @@ import { RouterLink } from 'vue-router' import type { Plugin } from 'nuxt/app' +import routes from 'nuxt/build/routes' import NuxtPage from './NuxtPage.vue' -import routes from '~build/routes' - export default function router (nuxt) { const { app } = nuxt diff --git a/packages/nuxt3/src/builder/vite/vite.ts b/packages/nuxt3/src/builder/vite/vite.ts index 37d9f10d7b..21c933b470 100644 --- a/packages/nuxt3/src/builder/vite/vite.ts +++ b/packages/nuxt3/src/builder/vite/vite.ts @@ -20,7 +20,7 @@ export async function bundle (nuxt: Nuxt) { resolve: { alias: { 'nuxt/app': nuxt.options.appDir, - '~build': nuxt.options.buildDir, + 'nuxt/build': nuxt.options.buildDir, '~': nuxt.options.srcDir, '@': nuxt.options.srcDir } diff --git a/packages/nuxt3/src/builder/webpack/presets/base.ts b/packages/nuxt3/src/builder/webpack/presets/base.ts index a7ac842a1d..d04ca8bdf7 100644 --- a/packages/nuxt3/src/builder/webpack/presets/base.ts +++ b/packages/nuxt3/src/builder/webpack/presets/base.ts @@ -109,7 +109,7 @@ function baseAlias (ctx: WebpackConfigContext) { ctx.alias = { 'nuxt/app': options.appDir, - '~build': options.buildDir, + 'nuxt/build': options.buildDir, ...options.alias, ...ctx.alias }