feat(client): migration old package to rspack (#15068)

#### PR Dependency Tree


* **PR #15068** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Upgraded Vitest across packages to 4.1.8 and bumped Tailwind PostCSS
to 4.3.0
* CLI/tooling updated to support the media-capture-playground package
and adjust build/dev server behavior

* **Bug Fixes**
  * Improved workspace deletion reliability in the Electron app

* **Refactor**
* Simplified media capture playground build setup (build/config
adjustments)

* **Tests**
* Made tests more robust by preserving/restoring environment state
during runs
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
DarkSky
2026-06-02 12:00:50 +08:00
committed by GitHub
parent 69c2f09eba
commit aca47445aa
50 changed files with 738 additions and 507 deletions
+11 -5
View File
@@ -77,12 +77,20 @@ export function createHTMLTargetConfig(
deps?: string[]
): RspackConfiguration {
entry = typeof entry === 'string' ? { index: entry } : entry;
const tailwindConfigPath = pkg.join('tailwind.config.js');
const hasTailwind =
tailwindConfigPath.exists() ||
pkg.name === '@affine/media-capture-playground';
const tailwindPlugin = tailwindConfigPath.exists()
? ['@tailwindcss/postcss', require(tailwindConfigPath.value)]
: ['@tailwindcss/postcss'];
htmlConfig = merge(
{},
{
filename: 'index.html',
additionalEntryForSelfhost: true,
copySharedPublicAssets: true,
injectGlobalErrorHandler: true,
emitAssetsManifest: true,
},
@@ -268,12 +276,9 @@ export function createHTMLTargetConfig(
loader: 'postcss-loader',
options: {
postcssOptions: {
plugins: pkg.join('tailwind.config.js').exists()
plugins: hasTailwind
? [
[
'@tailwindcss/postcss',
require(pkg.join('tailwind.config.js').value),
],
tailwindPlugin,
['autoprefixer'],
...(buildConfig.isAdmin
? [queuedashScopePostcssPlugin()]
@@ -318,6 +323,7 @@ export function createHTMLTargetConfig(
}),
new VanillaExtractPlugin(),
!buildConfig.isAdmin &&
htmlConfig.copySharedPublicAssets &&
new rspack.CopyRspackPlugin({
patterns: [
{