Skip to content

Commit 2370f6b

Browse files
committed
Fixed: allow vite access to node_modules
1 parent acc3231 commit 2370f6b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

nuxt.config.ts

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { defineConfig, searchForWorkspaceRoot } from 'vite'
2+
13
const urlSchema = process.env.URL_SCHEMA || 'http'
24
const urlDomain = process.env.URL_DOMAIN || 'localhost:3000'
35
const urlBase = `${urlSchema}://${urlDomain}`
@@ -123,5 +125,17 @@ export default defineNuxtConfig({
123125
configFile: 'unocss.config.ts',
124126
},
125127

128+
// Vite
129+
vite: {
130+
server: {
131+
fs: {
132+
allow: [
133+
searchForWorkspaceRoot(process.cwd()),
134+
'node_modules',
135+
],
136+
},
137+
},
138+
},
139+
126140
compatibilityDate: '2025-01-01',
127-
})
141+
})

0 commit comments

Comments
 (0)