Skip to content

Commit

Permalink
fix: exclude hmr from path alias mapping
Browse files Browse the repository at this point in the history
fix #357
  • Loading branch information
yyx990803 committed Jun 8, 2020
1 parent 47923c7 commit 4ed19b9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/node/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
moduleFileToIdMap
} from './server/serverPluginModuleResolve'
import { resolveOptimizedCacheDir } from './optimizer'
import { hmrClientPublicPath } from './server/serverPluginHmr'
import chalk from 'chalk'

const debug = require('debug')('vite:resolve')
Expand Down Expand Up @@ -204,6 +205,9 @@ export function createResolver(
* Given a fuzzy public path, resolve missing extensions and /index.xxx
*/
normalizePublicPath(publicPath) {
if (publicPath === hmrClientPublicPath) {
return publicPath
}
// preserve query
const queryMatch = publicPath.match(/\?.*$/)
const query = queryMatch ? queryMatch[0] : ''
Expand Down

0 comments on commit 4ed19b9

Please sign in to comment.