Skip to content

Commit a3fa1a3

Browse files
fix: Vite cannot load configuration files in the link directory (#4180) (#4181)
Co-authored-by: sapphi-red <[email protected]>
1 parent 63ec05a commit a3fa1a3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/vite/src/node/config.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -939,9 +939,10 @@ async function loadConfigFromBundledFile(
939939
bundledCode: string
940940
): Promise<UserConfig> {
941941
const extension = path.extname(fileName)
942+
const realFileName = fs.realpathSync(fileName)
942943
const defaultLoader = require.extensions[extension]!
943944
require.extensions[extension] = (module: NodeModule, filename: string) => {
944-
if (filename === fileName) {
945+
if (filename === realFileName) {
945946
;(module as NodeModuleWithCompile)._compile(bundledCode, filename)
946947
} else {
947948
defaultLoader(module, filename)

0 commit comments

Comments
 (0)