fix(vite): use more strict app entry check in dev-bundler (#5959)

This commit is contained in:
pooya parsa 2022-07-17 18:01:16 +02:00 committed by GitHub
parent 0839e93333
commit ffd40d16c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,7 +63,7 @@ async function transformRequest (opts: TransformOptions, id: string) {
if (id.match(/^\/\w:/)) {
id = id.slice(1)
}
} else if (!id.includes('entry') && id.startsWith('/')) {
} else if (id.startsWith('/') && !(/\/app\/entry(|.mjs)$/.test(id))) {
// Relative to the root directory
const resolvedPath = resolve(opts.viteServer.config.root, '.' + id)
if (existsSync(resolvedPath)) {