Skip to content

Commit

Permalink
fix(webpack): using official react-refresh-webpack-plugin (#1831)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiahan authored and caohuilin committed Oct 13, 2022
1 parent 7d856bc commit a6d734f
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 51 deletions.
1 change: 1 addition & 0 deletions .changeset/twelve-spoons-burn.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
'@modern-js/webpack': patch
'@modern-js/builder-provider-webpack': patch
---

fix(webpack): react-refresh-webpack-plugin cause rebuild slow
Expand Down
2 changes: 1 addition & 1 deletion packages/builder/builder-webpack-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"@modern-js/server": "workspace:*",
"@modern-js/types": "workspace:*",
"@modern-js/utils": "workspace:*",
"@modern-js/react-refresh-webpack-plugin": "0.5.8",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.8",
"@svgr/webpack": "6.2.1",
"@types/mini-css-extract-plugin": "2.2.0",
"caniuse-lite": "^1.0.30001332",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const PluginReact = (): BuilderPlugin => ({
}

const { default: ReactFastRefreshPlugin } = await import(
'@modern-js/react-refresh-webpack-plugin'
'@pmmmwh/react-refresh-webpack-plugin'
);
const useTsLoader = Boolean(config.tools?.tsLoader);
const rule = useTsLoader
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@modern-js/babel-preset-app": "workspace:*",
"@modern-js/css-config": "workspace:*",
"@modern-js/utils": "workspace:*",
"@modern-js/react-refresh-webpack-plugin": "0.5.8",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.8",
"@svgr/webpack": "^6.2.1",
"core-js": "^3.25.0",
"css-minimizer-webpack-plugin": "^3.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/webpack/src/config/features/react-refresh.ts
Original file line number Diff line number Diff line change
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('@modern-js/react-refresh-webpack-plugin');
const ReactFastRefreshPlugin = require('@pmmmwh/react-refresh-webpack-plugin');

chain.plugin(CHAIN_ID.PLUGIN.REACT_FAST_REFRESH).use(ReactFastRefreshPlugin, [
{
Expand Down
94 changes: 47 additions & 47 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 a6d734f

Please sign in to comment.