Skip to content

Commit

Permalink
chore: update rspack to 0.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
9aoy committed Jul 11, 2023
1 parent fbcac63 commit 176106f
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 52 deletions.
7 changes: 7 additions & 0 deletions .changeset/khaki-nails-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@modern-js/builder-rspack-provider': patch
---

chore(builder): update rspack to 0.2.6 and compatible dev-client change

chore(builder): 升级 rspack 到 0.2.6 并兼容 dev-client 变更
6 changes: 3 additions & 3 deletions packages/builder/builder-rspack-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
"@modern-js/types": "workspace:*",
"@modern-js/utils": "workspace:*",
"@babel/preset-typescript": "^7.21.5",
"@rspack/core": "0.2.5",
"@rspack/dev-client": "0.2.5",
"@rspack/plugin-html": "0.2.5",
"@rspack/core": "0.2.6",
"@rspack/dev-client": "0.2.6",
"@rspack/plugin-html": "0.2.6",
"rspack-manifest-plugin": "5.0.0-alpha0",
"caniuse-lite": "^1.0.30001489",
"core-js": "~3.30.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function getHotRuntimeEntries(compiler: Compiler) {

if (hot && refresh) {
const reactRefreshEntryPath = require.resolve(
'@rspack/dev-client/react-refresh',
'@rspack/dev-client/react-refresh-entry',
);
return [reactRefreshEntryPath];
}
Expand Down
6 changes: 6 additions & 0 deletions packages/builder/builder-rspack-provider/src/plugins/react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ export const builderPluginReact = (): BuilderPlugin => ({
// https://swc.rs/docs/configuration/compilation#jsctransformreactruntime
runtime: 'automatic',
});

setConfig(rspackConfig, 'builtins.provide', {
$ReactRefreshRuntime$: [
require.resolve('@rspack/dev-client/react-refresh'),
],
});
});
},
});
96 changes: 48 additions & 48 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 176106f

Please sign in to comment.