mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +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'
|
import { RouteRecordRaw } from 'vue-router'
|
||||||
|
|
||||||
const _default: RouteRecordRaw[]
|
const _default: RouteRecordRaw[]
|
||||||
|
@ -6,10 +6,9 @@ import {
|
|||||||
RouterLink
|
RouterLink
|
||||||
} from 'vue-router'
|
} from 'vue-router'
|
||||||
import type { Plugin } from 'nuxt/app'
|
import type { Plugin } from 'nuxt/app'
|
||||||
|
import routes from 'nuxt/build/routes'
|
||||||
import NuxtPage from './NuxtPage.vue'
|
import NuxtPage from './NuxtPage.vue'
|
||||||
|
|
||||||
import routes from '~build/routes'
|
|
||||||
|
|
||||||
export default <Plugin> function router (nuxt) {
|
export default <Plugin> function router (nuxt) {
|
||||||
const { app } = nuxt
|
const { app } = nuxt
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ export async function bundle (nuxt: Nuxt) {
|
|||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'nuxt/app': nuxt.options.appDir,
|
'nuxt/app': nuxt.options.appDir,
|
||||||
'~build': nuxt.options.buildDir,
|
'nuxt/build': nuxt.options.buildDir,
|
||||||
'~': nuxt.options.srcDir,
|
'~': nuxt.options.srcDir,
|
||||||
'@': nuxt.options.srcDir
|
'@': nuxt.options.srcDir
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ function baseAlias (ctx: WebpackConfigContext) {
|
|||||||
|
|
||||||
ctx.alias = {
|
ctx.alias = {
|
||||||
'nuxt/app': options.appDir,
|
'nuxt/app': options.appDir,
|
||||||
'~build': options.buildDir,
|
'nuxt/build': options.buildDir,
|
||||||
...options.alias,
|
...options.alias,
|
||||||
...ctx.alias
|
...ctx.alias
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user