()
| 354 | // with the bundler's options read under them |
| 355 | let changedSettings: string | undefined |
| 356 | const checkSettings = () => { |
| 357 | const cwd = settingsRead?.cwd ?? process.cwd() |
| 358 | let read: PrecompileUnpluginOptions |
| 359 | let fixed: string |
| 360 | try { |
| 361 | read = withSettingsFile(settingsRead) |
| 362 | if (JSON.stringify(read) === JSON.stringify(set)) |
| 363 | return void (changedSettings = undefined) |
| 364 | const resolved = resolvePrecompileOptions(read) |
| 365 | // what Vite's config read of them |
| 366 | fixed = JSON.stringify([ |
| 367 | inlinedOf( |
| 368 | resolved, |
| 369 | optedInPackagesOf( |
| 370 | resolved.cwd ?? process.cwd(), |
| 371 | resolved.dependencies |
| 372 | ) |
| 373 | ), |
| 374 | resolved.allowUnsafe |
| 375 | ]) |
| 376 | } catch (e) { |
| 377 | return void (changedSettings = (e as Error).message) |
| 378 | } |
| 379 | const redoes = |
| 380 | meta.framework === "rollup" || |
| 381 | (meta.framework === "vite" && |
| 382 | (isServing ? |
| 383 | !!server && !environment?.testing |
| 384 | : fixed === JSON.stringify([inlined, opts?.allowUnsafe]))) |
| 385 | if (!redoes) { |
| 386 | changedSettings = writeWatchedSettingsMessage( |
| 387 | printablePathOf( |
| 388 | realCwd(), |
| 389 | settingsFileOf(cwd) ?? join(realCwd(), settingsFile) |
| 390 | ), |
| 391 | meta.framework |
| 392 | ) |
| 393 | return |
| 394 | } |
| 395 | changedSettings = undefined |
| 396 | applySettings(settingsRead) |
| 397 | // a shared module's text may change with them where its name doesn't |
| 398 | for (const id in modules) delete modules[id] |
| 399 | if (isServing) void server!.restart() |
| 400 | else rewritesCached = true |
| 401 | } |
| 402 | const modules: Record<string, string> = {} |
| 403 | const importersById: Record<string, string> = {} |
| 404 | // Rollup and Rolldown resolve what these import relatively through it, as |
no test coverage detected