Skip to content

Commit

Permalink
fix(webpack): react-refresh-webpack-plugin cause rebuild slow (#1808)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored and JSerFeng committed Oct 18, 2022
1 parent 09f6507 commit 9ee6fe0
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changeset/twelve-spoons-burn.md
@@ -0,0 +1,7 @@
---
'@modern-js/webpack': patch
---

fix(webpack): react-refresh-webpack-plugin cause rebuild slow

fix(webpack): 修复 react-refresh-webpack-plugin 导致重新编译慢的问题
Expand Up @@ -12,7 +12,7 @@ export const PluginReact = (): BuilderPlugin => ({
}

const { default: ReactFastRefreshPlugin } = await import(
'@pmmmwh/react-refresh-webpack-plugin'
'@modern-js/react-refresh-webpack-plugin'
);
const useTsLoader = Boolean(config.tools?.tsLoader);
const rule = useTsLoader
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/webpack/src/config/features/react-refresh.ts
Expand Up @@ -2,7 +2,7 @@ import { CHAIN_ID } from '@modern-js/utils';
import type { ChainUtils } from '../shared';

export function applyReactRefreshPlugin({ chain }: ChainUtils) {
const ReactFastRefreshPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
const ReactFastRefreshPlugin = require('@modern-js/react-refresh-webpack-plugin');

chain.plugin(CHAIN_ID.PLUGIN.REACT_FAST_REFRESH).use(ReactFastRefreshPlugin, [
{
Expand Down
66 changes: 66 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9ee6fe0

Please sign in to comment.