fix: use esm syntax for webpack module hot (#316)

This commit is contained in:
Daniel Roe 2021-07-12 11:19:34 +01:00 committed by GitHub
parent be835de180
commit 1bd0b74299
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,8 +26,9 @@ if (process.server) {
if (process.client) { if (process.client) {
// TODO: temporary webpack 5 HMR fix // TODO: temporary webpack 5 HMR fix
// https://github.com/webpack-contrib/webpack-hot-middleware/issues/390 // https://github.com/webpack-contrib/webpack-hot-middleware/issues/390
if (process.dev && module.hot) { // @ts-ignore
module.hot.accept() if (process.dev && import.meta.webpackHot) {
import.meta.webpackHot.accept()
} }
entry = async function initApp () { entry = async function initApp () {