mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix: replace ~build with nuxt/build
vite sees does not likes ~ for alias when file is in node_modules
This commit is contained in:
parent
a1ac066cb5
commit
52592a5d64
@ -1,4 +1,4 @@
|
||||
declare module '~build/routes' {
|
||||
declare module 'nuxt/build/routes' {
|
||||
import { RouteRecordRaw } from 'vue-router'
|
||||
|
||||
const _default: RouteRecordRaw[]
|
||||
|
@ -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 <Plugin> function router (nuxt) {
|
||||
const { app } = nuxt
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user