Skip to content

Commit

Permalink
fix: bump rspack version
Browse files Browse the repository at this point in the history
  • Loading branch information
ClarkXia committed Nov 13, 2023
1 parent 37008a3 commit 67d1f3d
Show file tree
Hide file tree
Showing 6 changed files with 372 additions and 661 deletions.
4 changes: 2 additions & 2 deletions packages/bundles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"react-refresh": "0.14.0",
"core-js-pure": "^3.8.1",
"error-stack-parser": "^2.0.6",
"@rspack/core": "0.3.6",
"@rspack/dev-server": "0.3.6",
"@rspack/core": "0.3.11",
"@rspack/dev-server": "0.3.11",
"@ice/css-modules-hash": "0.0.6"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/ice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@
"unplugin": "^1.5.0",
"webpack": "^5.88.0",
"webpack-dev-server": "^4.7.4",
"@rspack/core": "0.3.6",
"@rspack/dev-server": "0.3.6"
"@rspack/core": "0.3.11",
"@rspack/dev-server": "0.3.11"
},
"peerDependencies": {
"react": ">=18.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/ice/src/bundler/rspack/getConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ const getConfig: GetConfig = async (context, options, rspack) => {
}),
].filter(Boolean);
};
return taskConfigs.map(({ config }) => {
return await Promise.all(taskConfigs.map(async ({ config }) => {
const plugins = getPlugins(config);
return getRspackConfig({
return await getRspackConfig({
rootDir,
rspack,
runtimeTmpDir: RUNTIME_TMP_DIR,
Expand All @@ -89,7 +89,7 @@ const getConfig: GetConfig = async (context, options, rspack) => {
plugins: (config.plugins || []).concat(plugins),
},
});
});
}));
};


Expand Down
2 changes: 1 addition & 1 deletion packages/rspack-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@ice/bundles": "0.1.17"
},
"devDependencies": {
"@rspack/core": "0.3.6"
"@rspack/core": "0.3.11"
},
"scripts": {
"watch": "tsc -w --sourceMap",
Expand Down
15 changes: 8 additions & 7 deletions packages/rspack-config/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ interface GetRspackConfigOptions {

type GetConfig = (
options: GetRspackConfigOptions,
) => Configuration;
) => Promise<Configuration>;

const require = createRequire(import.meta.url);

const getConfig: GetConfig = (options) => {
const getConfig: GetConfig = async (options) => {
const {
rootDir,
taskConfig,
Expand Down Expand Up @@ -75,6 +75,7 @@ const getConfig: GetConfig = (options) => {
enableEnv: true,
getRoutesFile,
});
const { DefinePlugin, ProvidePlugin } = await import('@ice/bundles/esm/rspack.js');
const cssFilename = `css/${hashKey ? `[name]-[${hashKey}].css` : '[name].css'}`;
// get compile plugins
const compilerWebpackPlugins = getCompilerPlugins(rootDir, taskConfig || {}, 'rspack', { isServer: false });
Expand Down Expand Up @@ -136,13 +137,13 @@ const getConfig: GetConfig = (options) => {
fileName: 'assets-manifest.json',
outputDir: path.join(rootDir, runtimeTmpDir),
}),
].filter(Boolean),
builtins: {
define: getDefineVars(define, runtimeDefineVars, getExpandedEnvs),
provide: {
new DefinePlugin(getDefineVars(define, runtimeDefineVars, getExpandedEnvs)),
new ProvidePlugin({
process: [require.resolve('process/browser')],
$ReactRefreshRuntime$: [require.resolve('./client/reactRefresh.cjs')],
},
}),
].filter(Boolean),
builtins: {
devFriendlySplitChunks: true,
css: {
modules: { localIdentName },
Expand Down
Loading

0 comments on commit 67d1f3d

Please sign in to comment.