mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
fix(cjs): fix HMR issue with mongoose (#7938)
This commit is contained in:
parent
7cecbccabd
commit
9f05febe08
@ -1,11 +1,15 @@
|
||||
import { join } from 'path'
|
||||
|
||||
export function isHMRCompatible (id) {
|
||||
return !/[/\\]mongoose[/\\/]/.test(id)
|
||||
}
|
||||
|
||||
export function isExternalDependency (id) {
|
||||
return /[/\\]node_modules[/\\]/.test(id)
|
||||
}
|
||||
|
||||
export function clearRequireCache (id) {
|
||||
if (isExternalDependency(id)) {
|
||||
if (isExternalDependency(id) && isHMRCompatible(id)) {
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user