From 284199979f5af46a6cd977023128da528a6f5136 Mon Sep 17 00:00:00 2001 From: warflash Date: Thu, 23 Mar 2023 01:40:59 +0100 Subject: [PATCH] docs: replace `@nuxt/kit` example with node built-ins (#19873) --- docs/2.guide/3.going-further/7.layers.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/2.guide/3.going-further/7.layers.md b/docs/2.guide/3.going-further/7.layers.md index fc57ee97d..fdd6ace14 100644 --- a/docs/2.guide/3.going-further/7.layers.md +++ b/docs/2.guide/3.going-further/7.layers.md @@ -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') ] }) ```