--- applyTo: "packages/rspeedy/plugin-lynx/**,packages/rspeedy/plugin-debug-metadata/**,packages/webpack/template-webpack-plugin/**,packages/webpack/runtime-wrapper-webpack-plugin/**,packages/webpack/chunk-loading-webpack-plugin/**,packages/webpack/cache-events-webpack-plugin/**,packages/web-platform/web-core/package.json" --- `@lynx-js/rsbuild-plugin` (`pluginLynx`) and the plugins it imports must stay importable in a browser Worker, where a host bundles them with `@rspack/browser` and replaces Node.js built-ins with shims. Keep module evaluation free of Node-only side effects: no `require.resolve` of on-disk files, no worker pools or child processes, and no top-level calls into `node:os`, `node:fs` or `worker_threads`. Static `import`s of Node built-ins are fine; do that work on first use instead. For example, `LynxEncodePlugin.encodePool` is a lazy getter that `require()`s tinypool, because tinypool calls `availableParallelism()` and extends `EventEmitterAsyncResource` at import time, and `new Tinypool()` starts its threads at once. `test/encode-pool-lazy.test.ts` guards this through the `process` `worker` event. Only the web target can build in a browser: a native `.lynx.bundle` needs the `@lynx-js/tasm` addon. `@lynx-js/web-core/encode` resolves to `dist/encode_prod` (built by rslib for Node, which loads its wasm through `fs`) by default, and to the unbundled `dist/encode` under the `browser` condition, whose `wasm-bindgen --target bundler` glue a browser bundler loads as async WebAssembly. Keep both entries when changing that export. To check for regressions, bundle the plugin for `target: 'webworker'` and alias every Node built-in to a proxy that throws when used. Keep `createRequire` itself working, and strip the `node:` prefix with `NormalModuleReplacementPlugin` first, because Rspack does not alias `node:` scheme requests. Then import the plugin, call `pluginLynx()`, and run each plugin's `setup()` in a Worker in headless Chromium.