Skip to content

Commit

Permalink
chore(builder): compat rspack 0.4.0 (#4953)
Browse files Browse the repository at this point in the history
  • Loading branch information
9aoy committed Nov 20, 2023
1 parent 838205b commit 4dffb01
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/modern-fans-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@modern-js/builder-rspack-provider': patch
---

chore(rspack-provider): set disableTransformByDefault false to compat rspack next version(0.4.0)

chore(rspack-provider): 设置 disableTransformByDefault 为 false 以兼容 Rspack next(0.4.0) 版本
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { BuilderPlugin } from '../types';

import { setConfig } from '@modern-js/builder-shared';
/**
* Provide some temporary configurations for Rspack early transition
*/
Expand All @@ -14,5 +14,13 @@ export const builderPluginTransition = (): BuilderPlugin => ({
chain.optimization.chunkIds('deterministic');
}
});

api.modifyRspackConfig(config => {
setConfig(
config,
'experiments.rspackFuture.disableTransformByDefault',
false,
);
});
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ exports[`applyDefaultPlugins > should apply default plugins correctly 1`] = `
"devtool": "cheap-module-source-map",
"experiments": {
"asyncWebAssembly": true,
"rspackFuture": {
"disableTransformByDefault": false,
},
},
"infrastructureLogging": {
"level": "error",
Expand Down Expand Up @@ -781,6 +784,9 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when prod
"devtool": "hidden-source-map",
"experiments": {
"asyncWebAssembly": true,
"rspackFuture": {
"disableTransformByDefault": false,
},
},
"infrastructureLogging": {
"level": "error",
Expand Down Expand Up @@ -1552,6 +1558,9 @@ exports[`applyDefaultPlugins > should apply default plugins correctyly when targ
"devtool": "cheap-module-source-map",
"experiments": {
"asyncWebAssembly": true,
"rspackFuture": {
"disableTransformByDefault": false,
},
},
"infrastructureLogging": {
"level": "error",
Expand Down Expand Up @@ -2017,6 +2026,9 @@ exports[`tools.rspack > should match snapshot 1`] = `
"devtool": "cheap-module-source-map",
"experiments": {
"asyncWebAssembly": true,
"rspackFuture": {
"disableTransformByDefault": false,
},
},
"infrastructureLogging": {
"level": "error",
Expand Down

0 comments on commit 4dffb01

Please sign in to comment.