(bundlerEnvironment: Environment)
| 240 | restart() |
| 241 | } |
| 242 | const setEnvironment = (bundlerEnvironment: Environment) => { |
| 243 | // compilers sharing the plugin, as Rsbuild's environments do, that |
| 244 | // build one for a browser and one for a server share its worker, so |
| 245 | // what loads the bundle is unknown |
| 246 | environment = |
| 247 | environment && environment.browser !== bundlerEnvironment.browser ? |
| 248 | { ...bundlerEnvironment, browser: undefined } |
| 249 | : bundlerEnvironment |
| 250 | updateWorker() |
| 251 | } |
| 252 | // a changed file or configuration may need a new worker |
| 253 | const reset = () => { |
| 254 | checkSettings() |
no test coverage detected