mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-31 07:40:33 +00:00
docs: replace @nuxt/kit
example with node built-ins (#19873)
This commit is contained in:
parent
dc5982d9e0
commit
284199979f
@ -160,13 +160,14 @@ When importing using aliases (such as `~/` and `@/`) in a layer components and c
|
||||
Also when using relative paths in `nuxt.config` file of a layer, (with exception of nested `extends`) they are resolved relative to user's project instead of the layer. As a workaround, use full resolved paths in `nuxt.config`:
|
||||
|
||||
```js [nuxt.config.ts]
|
||||
import { createResolver } from '@nuxt/kit'
|
||||
import { fileURLToPath } from 'url'
|
||||
import { dirname, join } from 'path'
|
||||
|
||||
const { resolve } = createResolver(import.meta.url)
|
||||
const currentDir = dirname(fileURLToPath(import.meta.url))
|
||||
|
||||
export default defineNuxtConfig({
|
||||
css: [
|
||||
resolve('./assets/main.css')
|
||||
join(currentDir, './assets/main.css')
|
||||
]
|
||||
})
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user