vike 0.4.246-commit-abafe24 → 0.4.246-commit-bdf9e49

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.
@@ -7,19 +7,26 @@ import { virtualFileIdGlobalEntryClientCR, virtualFileIdGlobalEntryClientSR } fr
7
7
  import { getFilePathResolved } from '../../shared/getFilePath.js';
8
8
  import { getConfigValueSourcesRelevant } from '../pluginVirtualFiles/getConfigValueSourcesRelevant.js';
9
9
  const debug = createDebugger('vike:optimizeDeps');
10
- async function determineOptimizeDeps(config) {
11
- const vikeConfig = await getVikeConfigInternal();
12
- const { _pageConfigs: pageConfigs } = vikeConfig;
13
- const { entriesClient, entriesServer, includeClient, includeServer } = await getPageDeps(config, pageConfigs);
10
+ const WORKAROUND_LATE_DISCOVERY = [
14
11
  // Workaround for https://github.com/vitejs/vite-plugin-react/issues/650
15
12
  // - The issue was closed as completed with https://github.com/vitejs/vite/pull/20495 but it doesn't fix the issue and the workaround is still needed.
16
13
  // - TO-DO/eventually: try removing the workaround and see if the CI fails (at test/@cloudflare_vite-plugin/) — maybe the issue will get fixed at some point.
17
- includeServer.push('react/jsx-dev-runtime');
14
+ 'react/jsx-dev-runtime',
18
15
  // Workaround for https://github.com/vikejs/vike/issues/2823#issuecomment-3514325487
19
- includeServer.push('@compiled/react/runtime');
20
- if (requireResolveOptional({ importPath: '@compiled/react/runtime', userRootDir: config.root, importerFilePath: null })) {
21
- includeClient.push('@compiled/react/runtime');
22
- }
16
+ '@compiled/react/runtime',
17
+ ];
18
+ async function determineOptimizeDeps(config) {
19
+ const vikeConfig = await getVikeConfigInternal();
20
+ const { _pageConfigs: pageConfigs } = vikeConfig;
21
+ const { entriesClient, entriesServer, includeClient, includeServer } = await getPageDeps(config, pageConfigs);
22
+ WORKAROUND_LATE_DISCOVERY.forEach((dep) => {
23
+ const userRootDir = config.root;
24
+ const resolved = requireResolveOptional({ importPath: dep, userRootDir, importerFilePath: null });
25
+ if (resolved && resolved.startsWith(userRootDir)) {
26
+ includeClient.push(dep);
27
+ includeServer.push(dep);
28
+ }
29
+ });
23
30
  config.optimizeDeps.include = add(config.optimizeDeps.include, includeClient);
24
31
  config.optimizeDeps.entries = add(config.optimizeDeps.entries, entriesClient);
25
32
  for (const envName in config.environments) {
@@ -1 +1 @@
1
- export declare const PROJECT_VERSION: "0.4.246-commit-abafe24";
1
+ export declare const PROJECT_VERSION: "0.4.246-commit-bdf9e49";
@@ -1,2 +1,2 @@
1
1
  // Automatically updated by @brillout/release-me
2
- export const PROJECT_VERSION = '0.4.246-commit-abafe24';
2
+ export const PROJECT_VERSION = '0.4.246-commit-bdf9e49';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.246-commit-abafe24",
3
+ "version": "0.4.246-commit-bdf9e49",
4
4
  "repository": "https://github.com/vikejs/vike",
5
5
  "exports": {
6
6
  "./server": {