mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
Merge branch 'main' into patch-21
This commit is contained in:
commit
b749509f9d
@ -2,6 +2,7 @@ import { fileURLToPath } from 'node:url'
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import type { Component, Nuxt } from '@nuxt/schema'
|
import type { Component, Nuxt } from '@nuxt/schema'
|
||||||
import { kebabCase } from 'scule'
|
import { kebabCase } from 'scule'
|
||||||
|
import { normalize } from 'pathe'
|
||||||
|
|
||||||
import { createTransformPlugin } from '../src/components/transform'
|
import { createTransformPlugin } from '../src/components/transform'
|
||||||
|
|
||||||
@ -92,7 +93,7 @@ function createTransformer (components: Component[], mode: 'client' | 'server' |
|
|||||||
|
|
||||||
return async (code: string, id: string) => {
|
return async (code: string, id: string) => {
|
||||||
const result = await (plugin as any).transform!(code, id)
|
const result = await (plugin as any).transform!(code, id)
|
||||||
return (typeof result === 'string' ? result : result?.code)?.replaceAll(rootDir, '<repo>/')
|
return (typeof result === 'string' ? result : result?.code)?.replaceAll(normalize(rootDir), '<repo>/')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { applyDefaults } from 'untyped'
|
import { applyDefaults } from 'untyped'
|
||||||
|
|
||||||
|
import { normalize } from 'pathe'
|
||||||
import { NuxtConfigSchema } from '../src'
|
import { NuxtConfigSchema } from '../src'
|
||||||
import type { NuxtOptions } from '../src'
|
import type { NuxtOptions } from '../src'
|
||||||
|
|
||||||
@ -75,7 +76,9 @@ describe('nuxt folder structure', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function getDirs (options: NuxtOptions) {
|
function getDirs (options: NuxtOptions) {
|
||||||
const stripRoot = (dir: string) => dir.replace(process.cwd(), '<cwd>')
|
const stripRoot = (dir: string) => {
|
||||||
|
return normalize(dir).replace(normalize(process.cwd()), '<cwd>')
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
rootDir: stripRoot(options.rootDir),
|
rootDir: stripRoot(options.rootDir),
|
||||||
serverDir: stripRoot(options.serverDir),
|
serverDir: stripRoot(options.serverDir),
|
||||||
|
Loading…
Reference in New Issue
Block a user