Skip to content
This repository has been archived by the owner on Nov 17, 2022. It is now read-only.

Commit

Permalink
fix: hmr fail (#189)
Browse files Browse the repository at this point in the history
* fix: hmr fail

* chore: comment
  • Loading branch information
luhc228 committed May 7, 2022
1 parent 1e9b585 commit 89f44fa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/webpack-config/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,19 @@ function getEntry(rootDir: string) {
// use generated file in template directory
entryFile = path.join(rootDir, '.ice/entry.client.ts');
}
const dataLoaderFile = path.join(rootDir, '.ice/data-loader.ts');
return {
loader: [path.join(rootDir, '.ice/data-loader.ts')],
runtime: ['react', 'react-dom', '@ice/runtime'],
main: {
import: [entryFile],
dependOn: 'runtime',
},
// Should set `dependOn` property to avoid hmr fail.
// ref: https://github.com/pmmmwh/react-refresh-webpack-plugin/issues/88#issuecomment-627558799
loader: {
import: [dataLoaderFile],
dependOn: 'runtime',
},
};
}

Expand Down

0 comments on commit 89f44fa

Please sign in to comment.