From 9fc8ab528ffd19c96f7a17c1f5bef44b6f2285f5 Mon Sep 17 00:00:00 2001 From: Colum Ferry Date: Tue, 17 Dec 2024 11:59:49 +0000 Subject: [PATCH] chore(rsbuild): add migration notes --- e2e/react/src/react-rsbuild.test.ts | 8 ++++---- packages/rsbuild/src/plugins/plugin.spec.ts | 3 +++ packages/rsbuild/src/utils/versions.ts | 8 ++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/e2e/react/src/react-rsbuild.test.ts b/e2e/react/src/react-rsbuild.test.ts index e84b4be79a22b..5770e450fd0d3 100644 --- a/e2e/react/src/react-rsbuild.test.ts +++ b/e2e/react/src/react-rsbuild.test.ts @@ -36,7 +36,7 @@ describe('Build React applications and libraries with Rsbuild', () => { ); await runCLIAsync(`build ${rsbuildApp}`); - checkFilesExist(`dist/apps/${rsbuildApp}/index.html`); + checkFilesExist(`apps/${rsbuildApp}/dist/index.html`); }, 300_000); it('should test and lint app with bundler=rsbuild', async () => { @@ -57,7 +57,7 @@ describe('Build React applications and libraries with Rsbuild', () => { ); await runCLIAsync(`build ${rsbuildApp}`); - checkFilesExist(`dist/apps/${rsbuildApp}/index.html`); + checkFilesExist(`apps/${rsbuildApp}/dist/index.html`); }, 300_000); it('should test and lint app with bundler=rsbuild and inSourceTests', async () => { @@ -81,7 +81,7 @@ describe('Build React applications and libraries with Rsbuild', () => { ); await runCLIAsync(`build ${rsbuildApp}`); - checkFilesExist(`dist/apps/${rsbuildApp}/index.html`); + checkFilesExist(`apps/${rsbuildApp}/dist/index.html`); }, 300_000); it('should support bundling with Rsbuild and Jest', async () => { @@ -97,6 +97,6 @@ describe('Build React applications and libraries with Rsbuild', () => { ); await runCLIAsync(`build ${rsbuildApp}`); - checkFilesExist(`dist/apps/${rsbuildApp}/index.html`); + checkFilesExist(`apps/${rsbuildApp}/dist/index.html`); }, 300_000); }); diff --git a/packages/rsbuild/src/plugins/plugin.spec.ts b/packages/rsbuild/src/plugins/plugin.spec.ts index 06ec5d6d8a786..0a1893131d607 100644 --- a/packages/rsbuild/src/plugins/plugin.spec.ts +++ b/packages/rsbuild/src/plugins/plugin.spec.ts @@ -124,6 +124,9 @@ describe('@nx/rsbuild/plugin', () => { }, "preview-serve": { "command": "rsbuild preview", + "dependsOn": [ + "^build-something", + ], "options": { "args": [ "--mode=production", diff --git a/packages/rsbuild/src/utils/versions.ts b/packages/rsbuild/src/utils/versions.ts index 9f9a369be5003..5c5f757741a51 100644 --- a/packages/rsbuild/src/utils/versions.ts +++ b/packages/rsbuild/src/utils/versions.ts @@ -4,5 +4,13 @@ export const rsbuildPluginReactVersion = '1.1.0'; export const rsbuildPluginSassVersion = '1.1.2'; export const rsbuildPluginLessVersion = '1.1.0'; export const rsbuildPluginStyledComponentsVersion = '1.1.0'; + +/** + * These versions need to line up with the version of the swc_core crate Rspack uses for the version of Rsbuild above + * Checking the `cargo.toml` at https://github.com/web-infra-dev/rspack/blob/main/Cargo.toml for the correct Rspack version + * is the best way to ensure that these versions are correct. + * + * The release notes for the packages below are very helpful in understanding what version of swc_core crate they require. + */ export const rsbuildSwcPluginEmotionVersion = '^7.0.3'; export const rsbuildSwcPluginStyledJsxVersion = '^5.0.2';