@solidjs/vite-plugin 3.0.0-next.35 → 3.0.0-next.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ import { mergeAndConcat } from 'merge-anything';
6
6
  import { createRequire } from 'module';
7
7
  import path from 'path';
8
8
  import { Readable } from 'node:stream';
9
- import { createFilter, normalizePath, loadEnv, runnerImport, defaultClientConditions, defaultServerConditions } from 'vite';
9
+ import { createFilter, normalizePath, loadEnv, runnerImport, defaultClientConditions, defaultServerConditions, defaultExternalConditions } from 'vite';
10
10
  import { pathToFileURL, fileURLToPath } from 'node:url';
11
11
  import { crawlFrameworkPkgs } from 'vitefu';
12
12
 
@@ -3497,6 +3497,20 @@ function solidPlugin(options = {}) {
3497
3497
  // real server build resolves (isServer true).
3498
3498
  ...(isTestMode && !serverTestPosture && !opts.isSsrTargetWebworker ? ['browser'] : []), ...config.resolve.conditions];
3499
3499
 
3500
+ // `resolve.conditions` above only governs modules Vite inlines.
3501
+ // Externalized server deps are resolved by `fetchModule` with
3502
+ // `resolve.externalConditions` (default `['node', 'module-sync']`) and
3503
+ // handed to the module runner as concrete file paths — without
3504
+ // `development` there, packages that select their dev build through
3505
+ // the `development` export condition (@solidjs/web's server-functions
3506
+ // runtime among them) run their PRODUCTION copy under `vite dev`:
3507
+ // server errors reach the client sanitized to "Internal Server Error"
3508
+ // instead of carrying the real message, dev-only diagnostics vanish.
3509
+ // So the dev flag has to reach both lists.
3510
+ if (replaceDev && config.consumer !== 'client' && name !== 'client') {
3511
+ config.resolve.externalConditions = ['development', ...(config.resolve.externalConditions ?? defaultExternalConditions)];
3512
+ }
3513
+
3500
3514
  // Set resolve.noExternal and resolve.external for the SSR environment.
3501
3515
  // Only set resolve.external if noExternal is not true (to avoid conflicts with plugins like Cloudflare)
3502
3516
  if (name === 'ssr' && solidPkgsConfig) {