vike 0.4.227 → 0.4.228-commit-1553dee

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.
Files changed (91) hide show
  1. package/dist/cjs/node/api/dev.js +2 -0
  2. package/dist/cjs/node/plugin/plugins/build/handleAssetsManifest.js +9 -4
  3. package/dist/cjs/node/plugin/plugins/build/pluginBuildConfig.js +3 -5
  4. package/dist/cjs/node/plugin/plugins/build/pluginBuildEntry.js +13 -8
  5. package/dist/cjs/node/plugin/plugins/build/pluginModuleBanner.js +13 -21
  6. package/dist/cjs/node/plugin/plugins/devConfig/determineFsAllowList.js +8 -9
  7. package/dist/cjs/node/plugin/plugins/envVars.js +22 -13
  8. package/dist/cjs/node/plugin/plugins/extractAssetsPlugin.js +1 -2
  9. package/dist/cjs/node/plugin/plugins/extractExportNamesPlugin.js +1 -2
  10. package/dist/cjs/node/plugin/plugins/fileEnv.js +1 -2
  11. package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/resolvePointerImport.js +1 -3
  12. package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/transpileAndExecuteFile.js +25 -19
  13. package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +7 -4
  14. package/dist/cjs/node/plugin/plugins/setGlobalContext.js +3 -4
  15. package/dist/cjs/node/plugin/shared/getViteConfigRuntime.js +21 -0
  16. package/dist/cjs/node/plugin/shared/resolveClientEntriesDev.js +11 -12
  17. package/dist/cjs/node/plugin/utils.js +1 -0
  18. package/dist/cjs/node/prerender/resolvePrerenderConfig.js +1 -1
  19. package/dist/cjs/node/prerender/runPrerender.js +157 -196
  20. package/dist/cjs/node/prerender/utils.js +1 -1
  21. package/dist/cjs/node/runtime/globalContext.js +57 -34
  22. package/dist/cjs/node/runtime/html/stream.js +2 -4
  23. package/dist/cjs/node/runtime/index-common.js +2 -1
  24. package/dist/cjs/node/runtime/renderPage/renderPageAlreadyRouted.js +0 -23
  25. package/dist/cjs/node/runtime-dev/createDevMiddleware.js +1 -1
  26. package/dist/cjs/shared/route/executeOnBeforeRouteHook.js +1 -1
  27. package/dist/cjs/shared/route/index.js +13 -11
  28. package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
  29. package/dist/cjs/utils/assert.js +2 -5
  30. package/dist/cjs/utils/findPackageJson.js +2 -2
  31. package/dist/cjs/utils/isFilePathAbsoluteFilesystem.js +1 -1
  32. package/dist/cjs/utils/isNpmPackage.js +1 -1
  33. package/dist/cjs/utils/isScriptFile.js +4 -4
  34. package/dist/cjs/utils/parseUrl.js +4 -4
  35. package/dist/cjs/utils/preservePropertyGetters.js +30 -0
  36. package/dist/cjs/utils/requireResolve.js +60 -16
  37. package/dist/cjs/{node/plugin/shared → utils}/rollupSourceMap.js +4 -4
  38. package/dist/esm/client/client-routing-runtime/initOnLinkClick.js +2 -2
  39. package/dist/esm/node/api/dev.js +2 -0
  40. package/dist/esm/node/plugin/plugins/build/handleAssetsManifest.js +9 -4
  41. package/dist/esm/node/plugin/plugins/build/pluginBuildConfig.js +2 -4
  42. package/dist/esm/node/plugin/plugins/build/pluginBuildEntry.d.ts +1 -1
  43. package/dist/esm/node/plugin/plugins/build/pluginBuildEntry.js +12 -7
  44. package/dist/esm/node/plugin/plugins/build/pluginModuleBanner.js +11 -22
  45. package/dist/esm/node/plugin/plugins/devConfig/determineFsAllowList.js +7 -8
  46. package/dist/esm/node/plugin/plugins/envVars.js +19 -13
  47. package/dist/esm/node/plugin/plugins/extractAssetsPlugin.js +2 -3
  48. package/dist/esm/node/plugin/plugins/extractExportNamesPlugin.js +2 -3
  49. package/dist/esm/node/plugin/plugins/fileEnv.js +2 -3
  50. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/resolvePointerImport.js +2 -4
  51. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/transpileAndExecuteFile.js +26 -20
  52. package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +7 -4
  53. package/dist/esm/node/plugin/plugins/setGlobalContext.js +4 -5
  54. package/dist/esm/node/plugin/shared/getViteConfigRuntime.d.ts +14 -0
  55. package/dist/esm/node/plugin/shared/getViteConfigRuntime.js +19 -0
  56. package/dist/esm/node/plugin/shared/resolveClientEntriesDev.js +10 -11
  57. package/dist/esm/node/plugin/utils.d.ts +1 -0
  58. package/dist/esm/node/plugin/utils.js +1 -0
  59. package/dist/esm/node/prerender/resolvePrerenderConfig.d.ts +1 -1
  60. package/dist/esm/node/prerender/resolvePrerenderConfig.js +1 -1
  61. package/dist/esm/node/prerender/runPrerender.d.ts +1 -0
  62. package/dist/esm/node/prerender/runPrerender.js +160 -199
  63. package/dist/esm/node/prerender/utils.d.ts +1 -1
  64. package/dist/esm/node/prerender/utils.js +1 -1
  65. package/dist/esm/node/runtime/globalContext.d.ts +26 -17
  66. package/dist/esm/node/runtime/globalContext.js +57 -34
  67. package/dist/esm/node/runtime/html/stream.js +2 -4
  68. package/dist/esm/node/runtime/index-common.d.ts +1 -1
  69. package/dist/esm/node/runtime/index-common.js +1 -1
  70. package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.d.ts +9 -197
  71. package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.js +0 -23
  72. package/dist/esm/node/runtime-dev/createDevMiddleware.js +1 -1
  73. package/dist/esm/shared/page-configs/getConfigDefinedAt.d.ts +1 -1
  74. package/dist/esm/shared/route/executeOnBeforeRouteHook.js +1 -1
  75. package/dist/esm/shared/route/index.d.ts +1 -1
  76. package/dist/esm/shared/route/index.js +13 -11
  77. package/dist/esm/shared/types.d.ts +1 -3
  78. package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
  79. package/dist/esm/utils/PROJECT_VERSION.js +1 -1
  80. package/dist/esm/utils/assert.js +2 -5
  81. package/dist/esm/utils/isFilePathAbsoluteFilesystem.js +1 -1
  82. package/dist/esm/utils/isNpmPackage.js +1 -1
  83. package/dist/esm/utils/isScriptFile.js +4 -4
  84. package/dist/esm/utils/parseUrl.js +4 -4
  85. package/dist/esm/utils/preservePropertyGetters.d.ts +2 -0
  86. package/dist/esm/utils/preservePropertyGetters.js +28 -0
  87. package/dist/esm/utils/requireResolve.d.ts +7 -1
  88. package/dist/esm/utils/requireResolve.js +54 -13
  89. package/dist/esm/{node/plugin/shared → utils}/rollupSourceMap.d.ts +4 -4
  90. package/dist/esm/{node/plugin/shared → utils}/rollupSourceMap.js +4 -4
  91. package/package.json +3 -2
@@ -3,12 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.dev = dev;
4
4
  const prepareViteApiCall_js_1 = require("./prepareViteApiCall.js");
5
5
  const vite_1 = require("vite");
6
+ const globalContext_js_1 = require("../runtime/globalContext.js");
6
7
  /**
7
8
  * Programmatically trigger `$ vike dev`
8
9
  *
9
10
  * https://vike.dev/api#dev
10
11
  */
11
12
  async function dev(options = {}) {
13
+ (0, globalContext_js_1.setGlobalContext_isProduction)(false);
12
14
  const { viteConfigFromUserEnhanced } = await (0, prepareViteApiCall_js_1.prepareViteApiCall)(options, 'dev');
13
15
  const server = await (0, vite_1.createServer)(viteConfigFromUserEnhanced);
14
16
  return {
@@ -301,16 +301,21 @@ function handleAssetsManifest_getBuildConfig(config) {
301
301
  };
302
302
  }
303
303
  async function handleAssetsManifest(config, viteEnv, options, bundle) {
304
- if ((0, isViteServerBuild_js_1.isViteServerBuild_onlySsrEnv)(config, viteEnv)) {
304
+ const isSsREnv = (0, isViteServerBuild_js_1.isViteServerBuild_onlySsrEnv)(config, viteEnv);
305
+ if (isSsREnv) {
305
306
  (0, utils_js_1.assert)(!assetsJsonFilePath);
306
307
  const outDirs = (0, getOutDirs_js_1.getOutDirs)(config, viteEnv);
307
308
  assetsJsonFilePath = path_1.default.posix.join(outDirs.outDirRoot, 'assets.json');
308
309
  await writeAssetsManifestFile(outDirs, assetsJsonFilePath, config);
309
310
  }
310
311
  if ((0, isViteServerBuild_js_1.isViteServerBuild)(config, viteEnv)) {
311
- (0, utils_js_1.assert)(assetsJsonFilePath);
312
- // Replace __VITE_ASSETS_MANIFEST__ in all server-side bundles
313
- await (0, pluginBuildEntry_js_1.set_macro_ASSETS_MANIFEST)(options, bundle, assetsJsonFilePath);
312
+ // Replace __VITE_ASSETS_MANIFEST__ in server builds
313
+ // - Always replace it in dist/server/
314
+ // - Also in some other server builds such as dist/vercel/ from vike-vercel
315
+ // - Don't replace it in dist/rsc/ from vike-react-rsc since __VITE_ASSETS_MANIFEST__ doesn't exist there
316
+ const noop = await (0, pluginBuildEntry_js_1.set_macro_ASSETS_MANIFEST)(options, bundle, assetsJsonFilePath);
317
+ if (isSsREnv)
318
+ (0, utils_js_1.assert)(!noop); // dist/server should always contain __VITE_ASSETS_MANIFEST__
314
319
  }
315
320
  }
316
321
  async function writeAssetsManifestFile(outDirs, assetsJsonFilePath, config) {
@@ -9,16 +9,14 @@ const getVikeConfig_js_1 = require("../importUserCode/v1-design/getVikeConfig.js
9
9
  const findPageFiles_js_1 = require("../../shared/findPageFiles.js");
10
10
  const virtualFilePageConfigValuesAll_js_1 = require("../../../shared/virtual-files/virtualFilePageConfigValuesAll.js");
11
11
  const extractAssetsQuery_js_1 = require("../../../shared/extractAssetsQuery.js");
12
- const module_1 = require("module");
13
12
  const prependEntriesDir_js_1 = require("../../../shared/prependEntriesDir.js");
14
13
  const getFilePath_js_1 = require("../../shared/getFilePath.js");
15
14
  const getConfigValueBuildTime_js_1 = require("../../../../shared/page-configs/getConfigValueBuildTime.js");
16
15
  const isViteServerBuild_js_1 = require("../../shared/isViteServerBuild.js");
17
16
  const getOutDirs_js_1 = require("../../shared/getOutDirs.js");
18
17
  const handleAssetsManifest_js_1 = require("./handleAssetsManifest.js");
19
- // @ts-ignore `file://${__filename}` is shimmed at dist/cjs by dist-cjs-fixup.js.
20
- const importMetaUrl = `file://${__filename}`;
21
- const require_ = (0, module_1.createRequire)(importMetaUrl);
18
+ // @ts-ignore `file:///${__filename.split('\\').join('/')}` is shimmed at dist/cjs by dist-cjs-fixup.js.
19
+ const importMetaUrl = `file:///${__filename.split('\\').join('/')}`;
22
20
  const manifestTempFile = '_temp_manifest.json';
23
21
  exports.manifestTempFile = manifestTempFile;
24
22
  function pluginBuildConfig() {
@@ -200,7 +198,7 @@ function getEntryFromPageConfig(pageConfig, isForClientSide) {
200
198
  function resolve(filePath) {
201
199
  (0, utils_js_1.assert)(filePath.startsWith('dist/'));
202
200
  // [RELATIVE_PATH_FROM_DIST] Current directory: node_modules/vike/dist/esm/node/plugin/plugins/build/
203
- return require_.resolve(`../../../../../../${filePath}`);
201
+ return (0, utils_js_1.requireResolveNonUserFile)(`../../../../../../${filePath}`, importMetaUrl);
204
202
  }
205
203
  function addLogHook() {
206
204
  const tty = process.stdout.isTTY && !process.env.CI; // Equals https://github.com/vitejs/vite/blob/193d55c7b9cbfec5b79ebfca276d4a721e7de14d/packages/vite/src/node/plugins/reporter.ts#L27
@@ -10,13 +10,12 @@ const virtualFileImportUserCode_js_1 = require("../../../shared/virtual-files/vi
10
10
  const utils_js_1 = require("../../utils.js");
11
11
  const promises_1 = __importDefault(require("fs/promises"));
12
12
  const path_1 = __importDefault(require("path"));
13
- const module_1 = require("module");
14
- // @ts-ignore `file://${__filename}` is shimmed at dist/cjs by dist-cjs-fixup.js.
15
- const importMetaUrl = `file://${__filename}`;
16
- const require_ = (0, module_1.createRequire)(importMetaUrl);
13
+ // @ts-ignore `file:///${__filename.split('\\').join('/')}` is shimmed at dist/cjs by dist-cjs-fixup.js.
14
+ const importMetaUrl = `file:///${__filename.split('\\').join('/')}`;
17
15
  const extractExportNamesPlugin_js_1 = require("../extractExportNamesPlugin.js");
18
16
  const globalContext_js_1 = require("../../../runtime/globalContext.js");
19
17
  const getOutDirs_js_1 = require("../../shared/getOutDirs.js");
18
+ const getViteConfigRuntime_js_1 = require("../../shared/getViteConfigRuntime.js");
20
19
  const ASSETS_MANIFEST = '__VITE_ASSETS_MANIFEST__';
21
20
  function pluginBuildEntry() {
22
21
  let config;
@@ -42,7 +41,7 @@ function getServerProductionEntryCode(config) {
42
41
  const buildInfo = {
43
42
  versionAtBuildTime: utils_js_1.PROJECT_VERSION,
44
43
  usesClientRouter: (0, extractExportNamesPlugin_js_1.isUsingClientRouter)(), // TODO/v1-release: remove
45
- viteConfigRuntime: (0, globalContext_js_1.getViteConfigRuntime)(config)
44
+ viteConfigRuntime: (0, getViteConfigRuntime_js_1.getViteConfigRuntime)(config)
46
45
  };
47
46
  (0, globalContext_js_1.assertBuildInfo)(buildInfo);
48
47
  // After the old design is removed, let's maybe simplify and move everything into a single virtual module
@@ -69,6 +68,12 @@ async function set_macro_ASSETS_MANIFEST(options, bundle, assetsJsonFilePath) {
69
68
  const { dir } = options;
70
69
  (0, utils_js_1.assert)(dir);
71
70
  const chunkPath = find_ASSETS_MANIFEST(bundle);
71
+ // Some server builds don't contain __VITE_ASSETS_MANIFEST__ such as dist/rsc/ from vike-react-rsc
72
+ if (!chunkPath) {
73
+ const noop = true; // no operation
74
+ return noop;
75
+ }
76
+ (0, utils_js_1.assert)(assetsJsonFilePath);
72
77
  const chunkFilePath = path_1.default.join(dir, chunkPath);
73
78
  const [assetsJsonString, chunkFileContent] = await Promise.all([
74
79
  await promises_1.default.readFile(assetsJsonFilePath, 'utf8'),
@@ -77,6 +82,8 @@ async function set_macro_ASSETS_MANIFEST(options, bundle, assetsJsonFilePath) {
77
82
  const serverEntryFileContentPatched = chunkFileContent.replace(ASSETS_MANIFEST, assetsJsonString);
78
83
  (0, utils_js_1.assert)(serverEntryFileContentPatched !== chunkFileContent);
79
84
  await promises_1.default.writeFile(chunkFilePath, serverEntryFileContentPatched);
85
+ const noop = false;
86
+ return noop;
80
87
  }
81
88
  function find_ASSETS_MANIFEST(bundle) {
82
89
  let chunkPath;
@@ -87,14 +94,12 @@ function find_ASSETS_MANIFEST(bundle) {
87
94
  chunkPath = filePath;
88
95
  }
89
96
  }
90
- (0, utils_js_1.assert)(chunkPath);
91
97
  return chunkPath;
92
98
  }
93
99
  function getImportPath(config) {
94
100
  // We resolve filePathAbsolute even if we don't use it: we use require.resolve() as an assertion that the relative path is correct
95
- const filePathAbsolute = (0, utils_js_1.toPosixPath)(
96
101
  // [RELATIVE_PATH_FROM_DIST] Current file: node_modules/vike/dist/esm/node/plugin/plugins/pluginBuildEntry/index.js
97
- require_.resolve(`../../../../../../dist/esm/__internal/index.js`));
102
+ const filePathAbsolute = (0, utils_js_1.requireResolveNonUserFile)(`../../../../../../dist/esm/__internal/index.js`, importMetaUrl);
98
103
  if (
99
104
  // Let's implement a new config if a user needs the import to be a relative path instead of 'vike/__internal' (AFAIK a relative path is needed only if a framework has npm package 'vike' as direct dependency instead of a peer dependency and if the user of that framework uses pnpm)
100
105
  true) {
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.pluginModuleBanner = pluginModuleBanner;
4
- const utils_js_1 = require("../../utils.js");
7
+ const magic_string_1 = __importDefault(require("magic-string"));
5
8
  const virtual_files_js_1 = require("../../../shared/virtual-files.js");
6
9
  const isViteServerBuild_js_1 = require("../../shared/isViteServerBuild.js");
7
10
  // Rollup's banner feature doesn't work with Vite: https://github.com/vitejs/vite/issues/8412
8
11
  // But, anyways, we want to prepend the banner at the beginning of each module, not at the beginning of each file (I believe that's what Rollup's banner feature does).
9
- const vikeModuleBannerPlaceholder = 'vikeModuleBannerPlaceholder';
10
12
  function pluginModuleBanner() {
11
13
  let config;
12
14
  return {
@@ -16,24 +18,6 @@ function pluginModuleBanner() {
16
18
  configResolved(config_) {
17
19
  config = config_;
18
20
  },
19
- generateBundle: {
20
- order: 'post',
21
- handler(_options, bundle) {
22
- for (const module of Object.values(bundle)) {
23
- if (module.type === 'chunk') {
24
- if ((0, isViteServerBuild_js_1.isViteServerBuild)(config)) {
25
- const codeOld = module.code;
26
- const codeNew = codeOld.replace(/vikeModuleBannerPlaceholder\("([^"]*)"\);/g, '/* $1 [vike:pluginModuleBanner] */');
27
- (0, utils_js_1.assert)(!codeNew.includes(vikeModuleBannerPlaceholder));
28
- module.code = codeNew;
29
- }
30
- else {
31
- (0, utils_js_1.assert)(!module.code.includes(vikeModuleBannerPlaceholder));
32
- }
33
- }
34
- }
35
- }
36
- },
37
21
  transform: {
38
22
  order: 'post',
39
23
  handler(code, id, options) {
@@ -44,7 +28,15 @@ function pluginModuleBanner() {
44
28
  id = (0, virtual_files_js_1.removeVirtualIdTag)(id);
45
29
  if (id.startsWith(config.root))
46
30
  id = id.slice(config.root.length + 1);
47
- return `${vikeModuleBannerPlaceholder}(${JSON.stringify(id)}); ${code}`;
31
+ const s = new magic_string_1.default(code);
32
+ // Use legal comment so that esbuild doesn't remove it.
33
+ // - Terser still removes the comment, but I guess users use terser to minify JavaScript so I guess it's a good thing that comment is removed.
34
+ // - https://esbuild.github.io/api/#legal-comments
35
+ s.prepend(`/*! ${id} [vike:pluginModuleBanner] */\n`);
36
+ return {
37
+ code: s.toString(),
38
+ map: s.generateMap({ hires: true, source: id })
39
+ };
48
40
  }
49
41
  }
50
42
  };
@@ -5,15 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.determineFsAllowList = determineFsAllowList;
7
7
  const vite_1 = require("vite");
8
- const path_1 = __importDefault(require("path"));
8
+ const node_path_1 = __importDefault(require("node:path"));
9
9
  const utils_js_1 = require("../../utils.js");
10
- const module_1 = require("module");
11
- const path_2 = require("path");
12
10
  const url_1 = require("url");
13
- // @ts-ignore `file://${__filename}` is shimmed at dist/cjs by dist-cjs-fixup.js.
14
- const importMetaUrl = `file://${__filename}`;
15
- const require_ = (0, module_1.createRequire)(importMetaUrl);
16
- const __dirname_ = (0, path_2.dirname)((0, url_1.fileURLToPath)(importMetaUrl));
11
+ // @ts-ignore `file:///${__filename.split('\\').join('/')}` is shimmed at dist/cjs by dist-cjs-fixup.js.
12
+ const importMetaUrl = `file:///${__filename.split('\\').join('/')}`;
13
+ (0, utils_js_1.assertPosixPath)(importMetaUrl);
14
+ const __dirname_ = node_path_1.default.posix.dirname((0, url_1.fileURLToPath)(importMetaUrl));
15
+ (0, utils_js_1.assertPosixPath)(__dirname_);
17
16
  async function determineFsAllowList(config) {
18
17
  const fsAllow = config.server.fs.allow;
19
18
  // fsAllow should already contain searchForWorkspaceRoot()
@@ -26,9 +25,9 @@ async function determineFsAllowList(config) {
26
25
  // Add node_modules/vike/
27
26
  {
28
27
  // [RELATIVE_PATH_FROM_DIST] Current directory: node_modules/vike/dist/esm/node/plugin/plugins/config/
29
- const vikeRoot = path_1.default.join(__dirname_, '../../../../../../');
28
+ const vikeRoot = node_path_1.default.posix.join(__dirname_, '../../../../../../');
30
29
  // Assert that `vikeRoot` is indeed pointing to `node_modules/vike/`
31
- require_.resolve(`${vikeRoot}/dist/esm/node/plugin/plugins/devConfig/index.js`);
30
+ (0, utils_js_1.requireResolveNonUserFile)(`${vikeRoot}/dist/esm/node/plugin/plugins/devConfig/index.js`, importMetaUrl);
32
31
  fsAllow.push(vikeRoot);
33
32
  }
34
33
  }
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.envVarsPlugin = envVarsPlugin;
7
+ const magic_string_1 = __importDefault(require("magic-string"));
4
8
  const vite_1 = require("vite");
5
9
  const utils_js_1 = require("../utils.js");
6
- const rollupSourceMap_js_1 = require("../shared/rollupSourceMap.js");
7
10
  const getFilePath_js_1 = require("../shared/getFilePath.js");
8
11
  const normalizeId_js_1 = require("../shared/normalizeId.js");
9
12
  const isViteServerBuild_js_1 = require("../shared/isViteServerBuild.js");
@@ -12,7 +15,7 @@ const isViteServerBuild_js_1 = require("../shared/isViteServerBuild.js");
12
15
  // - For it to work, we'll probably need the user to define the settings (e.g. `envDir`) for loadEnv() inside vike.config.js instead of vite.config.js
13
16
  // - Or stop using Vite's `mode` implemention and have Vike implement its own `mode` feature? (So that the only dependencies are `$ vike build --mode staging` and `$ MODE=staging vike build`.)
14
17
  const PUBLIC_ENV_PREFIX = 'PUBLIC_ENV__';
15
- const PUBLIC_ENV_WHITELIST = [
18
+ const PUBLIC_ENV_ALLOWLIST = [
16
19
  // https://github.com/vikejs/vike/issues/1724
17
20
  'STORYBOOK'
18
21
  ];
@@ -40,6 +43,7 @@ function envVarsPlugin() {
40
43
  return;
41
44
  const isBuild = config.command === 'build';
42
45
  const isClientSide = !(0, isViteServerBuild_js_1.isViteServerBuild_safe)(config, options);
46
+ const s = new magic_string_1.default(code);
43
47
  Object.entries(envsAll)
44
48
  .filter(([key]) => {
45
49
  // Already handled by Vite
@@ -48,12 +52,12 @@ function envVarsPlugin() {
48
52
  })
49
53
  .forEach(([envName, envVal]) => {
50
54
  const envStatement = `import.meta.env.${envName}`;
51
- const envStatementRegEx = new RegExp((0, utils_js_1.escapeRegex)(envStatement) + '\\b', 'g');
55
+ const envStatementRegExStr = (0, utils_js_1.escapeRegex)(envStatement) + '\\b';
52
56
  // Security check
53
57
  {
54
- const isPrivate = !envName.startsWith(PUBLIC_ENV_PREFIX) && !PUBLIC_ENV_WHITELIST.includes(envName);
58
+ const isPrivate = !envName.startsWith(PUBLIC_ENV_PREFIX) && !PUBLIC_ENV_ALLOWLIST.includes(envName);
55
59
  if (isPrivate && isClientSide) {
56
- if (!envStatementRegEx.test(code))
60
+ if (!new RegExp(envStatementRegExStr).test(code))
57
61
  return;
58
62
  const modulePath = (0, getFilePath_js_1.getModuleFilePathAbsolute)(id, config);
59
63
  const errMsgAddendum = isBuild ? '' : ' (Vike will prevent your app from building for production)';
@@ -72,16 +76,21 @@ function envVarsPlugin() {
72
76
  (0, utils_js_1.assert)(!(isPrivate && isClientSide) || !isBuild);
73
77
  }
74
78
  // Apply
75
- code = applyEnvVar(envStatementRegEx, envVal, code);
79
+ applyEnvVar(s, envStatementRegExStr, envVal);
76
80
  });
77
- // Line numbers didn't change.
78
- // - We only break the column number of a couple of lines, wich is acceptable.
79
- // - Anyways, I'm not even sure Vite supports high-resolution column number source mapping.
80
- const ret = (0, rollupSourceMap_js_1.sourceMapPassthrough)(code);
81
- return ret;
81
+ if (!s.hasChanged())
82
+ return null;
83
+ return {
84
+ code: s.toString(),
85
+ map: s.generateMap({ hires: true, source: id })
86
+ };
82
87
  }
83
88
  };
84
89
  }
85
- function applyEnvVar(envStatementRegEx, envVal, code) {
86
- return code.replace(envStatementRegEx, JSON.stringify(envVal));
90
+ function applyEnvVar(s, envStatementRegExStr, envVal) {
91
+ const envStatementRegEx = new RegExp(envStatementRegExStr, 'g');
92
+ let match;
93
+ while ((match = envStatementRegEx.exec(s.original))) {
94
+ s.overwrite(match.index, match.index + match[0].length, JSON.stringify(envVal));
95
+ }
87
96
  }
@@ -12,7 +12,6 @@ const virtual_files_js_1 = require("../../shared/virtual-files.js");
12
12
  const extractAssetsQuery_js_1 = require("../../shared/extractAssetsQuery.js");
13
13
  const isAsset_js_1 = require("../shared/isAsset.js");
14
14
  const parseEsModule_js_1 = require("../shared/parseEsModule.js");
15
- const rollupSourceMap_js_1 = require("../shared/rollupSourceMap.js");
16
15
  const picocolors_1 = __importDefault(require("@brillout/picocolors"));
17
16
  const handleAssetsManifest_js_1 = require("./build/handleAssetsManifest.js");
18
17
  const getVikeConfig_js_1 = require("./importUserCode/v1-design/getVikeConfig.js");
@@ -53,7 +52,7 @@ function extractAssetsPlugin() {
53
52
  const moduleNames = getImportedModules(importStatements);
54
53
  const code = moduleNames.map((moduleName) => `import '${moduleName}';`).join('\n');
55
54
  debugTransformResult(id, code, importStatements);
56
- return (0, rollupSourceMap_js_1.sourceMapRemove)(code);
55
+ return (0, utils_js_1.rollupSourceMapRemove)(code);
57
56
  }
58
57
  },
59
58
  // This plugin appends `?extractAssets` to module IDs
@@ -5,7 +5,6 @@ exports.extractExportNamesPlugin = extractExportNamesPlugin;
5
5
  exports.isUsingClientRouter = isUsingClientRouter;
6
6
  const utils_js_1 = require("../utils.js");
7
7
  const parseEsModule_js_1 = require("../shared/parseEsModule.js");
8
- const rollupSourceMap_js_1 = require("../shared/rollupSourceMap.js");
9
8
  const normalizeId_js_1 = require("../shared/normalizeId.js");
10
9
  const isViteServerBuild_js_1 = require("../shared/isViteServerBuild.js");
11
10
  const extractExportNamesRE = /(\?|&)extractExportNames(?:&|$)/;
@@ -42,7 +41,7 @@ async function getExtractExportNamesCode(src, isClientSide, isProduction, id) {
42
41
  globalObject.usesClientRouter = true;
43
42
  }
44
43
  const code = getCode(exportNames, wildcardReExports, isClientSide, isProduction, id);
45
- return (0, rollupSourceMap_js_1.sourceMapRemove)(code);
44
+ return (0, utils_js_1.rollupSourceMapRemove)(code);
46
45
  }
47
46
  function getCode(exportNames, wildcardReExports, isClientSide, isProduction, id) {
48
47
  let code = '';
@@ -9,7 +9,6 @@ const extractAssetsPlugin_js_1 = require("./extractAssetsPlugin.js");
9
9
  const extractExportNamesPlugin_js_1 = require("./extractExportNamesPlugin.js");
10
10
  const picocolors_1 = __importDefault(require("@brillout/picocolors"));
11
11
  const getFilePath_js_1 = require("../shared/getFilePath.js");
12
- const rollupSourceMap_js_1 = require("../shared/rollupSourceMap.js");
13
12
  const parseEsModule_js_1 = require("../shared/parseEsModule.js");
14
13
  const normalizeId_js_1 = require("../shared/normalizeId.js");
15
14
  const getVikeConfig_js_1 = require("./importUserCode/v1-design/getVikeConfig.js");
@@ -54,7 +53,7 @@ function fileEnv() {
54
53
  const errMsg = getErrorMessage(id, isServerSide, importers, false, true);
55
54
  // We have to inject empty exports to avoid Rollup complaining about missing exports, see https://gist.github.com/brillout/5ea45776e65bd65100a52ecd7bfda3ff
56
55
  const { exportNames } = await (0, parseEsModule_js_1.getExportNames)(code);
57
- return (0, rollupSourceMap_js_1.sourceMapRemove)([
56
+ return (0, utils_js_1.rollupSourceMapRemove)([
58
57
  `throw new Error(${JSON.stringify(errMsg)});`,
59
58
  ...exportNames.map((name) => name === 'default' ? 'export default undefined;' : `export const ${name} = undefined;`)
60
59
  ].join('\n'));
@@ -77,10 +77,8 @@ function resolveImportPathWithNode(pointerImportData, importerFilePath) {
77
77
  const importerFilePathAbsolute = importerFilePath.filePathAbsoluteFilesystem;
78
78
  (0, utils_js_1.assertPosixPath)(importerFilePathAbsolute);
79
79
  const cwd = path_1.default.posix.dirname(importerFilePathAbsolute);
80
- // We still can't use import.meta.resolve() as of 23.1.0 (November 2024) because `parent` argument requires an experimental flag.
81
- // - https://stackoverflow.com/questions/54977743/do-require-resolve-for-es-modules#comment139581675_62272600
82
80
  // filePathAbsoluteFilesystem is expected to be null when pointerImportData.importPath is a Vite path alias
83
- const filePathAbsoluteFilesystem = (0, utils_js_1.requireResolve)(pointerImportData.importPath, cwd);
81
+ const filePathAbsoluteFilesystem = (0, utils_js_1.requireResolveOptional)(pointerImportData.importPath, cwd);
84
82
  return filePathAbsoluteFilesystem;
85
83
  }
86
84
  function assertUsageResolutionSuccess(filePathAbsoluteFilesystem, pointerImportData, importerFilePath) {
@@ -16,10 +16,6 @@ const utils_js_1 = require("../../../../utils.js");
16
16
  const transformPointerImports_js_1 = require("./transformPointerImports.js");
17
17
  const source_map_support_1 = __importDefault(require("source-map-support"));
18
18
  const getFilePath_js_1 = require("../../../../shared/getFilePath.js");
19
- const module_1 = require("module");
20
- // @ts-ignore `file://${__filename}` is shimmed at dist/cjs by dist-cjs-fixup.js.
21
- const importMetaUrl = `file://${__filename}`;
22
- const require_ = (0, module_1.createRequire)(importMetaUrl);
23
19
  (0, utils_js_1.assertIsNotProductionRuntime)();
24
20
  installSourceMapSupport();
25
21
  const debug = (0, utils_js_1.createDebugger)('vike:pointer-imports');
@@ -115,8 +111,6 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports, esb
115
111
  build.onResolve({ filter: /.*/ }, async (args) => {
116
112
  if (args.kind !== 'import-statement')
117
113
  return;
118
- if (debugEsbuildResolve.isActivated)
119
- debugEsbuildResolve('args', args);
120
114
  // Avoid infinite loop: https://github.com/evanw/esbuild/issues/3095#issuecomment-1546916366
121
115
  const useEsbuildResolver = 'useEsbuildResolver';
122
116
  if (args.pluginData?.[useEsbuildResolver])
@@ -124,17 +118,15 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports, esb
124
118
  const { path, ...opts } = args;
125
119
  opts.pluginData = { [useEsbuildResolver]: true };
126
120
  let resolved = await build.resolve(path, opts);
121
+ if (debugEsbuildResolve.isActivated)
122
+ debugEsbuildResolve('args', args);
127
123
  if (debugEsbuildResolve.isActivated)
128
124
  debugEsbuildResolve('resolved', resolved);
129
125
  // Temporary workaround for https://github.com/evanw/esbuild/issues/3973
130
126
  // - Sitll required for esbuild@0.24.0 (November 2024).
131
127
  // - Let's try to remove this workaround again later.
132
128
  if (resolved.errors.length > 0) {
133
- let resolvedWithNode;
134
- try {
135
- resolvedWithNode = require_.resolve(path, { paths: [args.resolveDir] });
136
- }
137
- catch { }
129
+ const resolvedWithNode = (0, utils_js_1.requireResolveOptional)(path, args.resolveDir);
138
130
  if (debugEsbuildResolve.isActivated)
139
131
  debugEsbuildResolve('resolvedWithNode', resolvedWithNode);
140
132
  if (resolvedWithNode)
@@ -168,11 +160,25 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports, esb
168
160
  // - vike@0.4.162 started soft-requiring Vike extensions to set the name config.
169
161
  // - In practice, it seems like it requires some (non-trivial?) refactoring.
170
162
  isVikeExtensionImport;
171
- // Externalize npm package imports
172
163
  (0, utils_js_1.assertPosixPath)(importPathResolved);
173
- const isNpmPkgImport = importPathResolved.includes('/node_modules/') ||
164
+ // `isNpmPkgImport` => `importPathOriginal` is most likely an npm package import, but it can also be a path alias that a) looks like an npm package import and b) resolves outside of `userRootDir`.
165
+ const isNpmPkgImport = (() => {
166
+ if (importPathResolved.includes('/node_modules/')) {
167
+ // So far I can't think of a use case where this assertion would fail, but let's eventually remove it to avoid artificially restricting the user.
168
+ (0, utils_js_1.assert)((0, utils_js_1.isNpmPackageImport_unreliable)(importPathOriginal));
169
+ return true;
170
+ }
174
171
  // Linked npm packages
175
- !importPathResolved.startsWith(userRootDir);
172
+ if (
173
+ // Assuming path aliases usually resolve inside `userRootDir`.
174
+ // - This isn't always the case: https://github.com/vikejs/vike/issues/2326
175
+ !importPathResolved.startsWith(userRootDir) &&
176
+ // False positive if `importPathOriginal` is a path alias that a) looks like an npm package import and b) resolves outside of `userRootDir` => we then we wrongfully assume that `importPathOriginal` is an npm package import.
177
+ (0, utils_js_1.isNpmPackageImport_unreliable)(importPathOriginal)) {
178
+ return true;
179
+ }
180
+ return false;
181
+ })();
176
182
  const isExternal = isPointerImport ||
177
183
  // Performance: npm package imports can be externalized. (We could as well let esbuild transpile /node_modules/ code but it's useless as /node_modules/ code is already built. It would unnecessarily slow down transpilation.)
178
184
  isNpmPkgImport;
@@ -196,19 +202,19 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports, esb
196
202
  filePathAbsoluteFilesystem: importPathResolved,
197
203
  userRootDir
198
204
  });
199
- // We assuming that path aliases always resolve inside `userRootDir`.
200
205
  if (filePathAbsoluteUserRootDir && !isNpmPkgImport) {
201
- // `importPathOriginal` is a path alias.
206
+ // `importPathOriginal` is most likely a path alias.
202
207
  // - We have to use esbuild's path alias resolution, because:
203
208
  // - Vike doesn't resolve path aliases at all.
204
209
  // - Node.js doesn't support `tsconfig.js#compilerOptions.paths`.
205
- // - Esbuild path alias resolution seems to be reliable, e.g. it supports `tsconfig.js#compilerOptions.paths`.
210
+ // - Esbuild path alias resolution seems reliable, e.g. it supports `tsconfig.js#compilerOptions.paths`.
211
+ (0, utils_js_1.assert)(!(0, utils_js_1.isNpmPackageImport_unreliable)(importPathOriginal));
206
212
  importPathTranspiled = importPathResolved;
207
213
  }
208
214
  else {
209
- // `importPathOriginal` is an npm package import.
215
+ // `importPathOriginal` is most likely an npm package import.
210
216
  (0, utils_js_1.assertIsNpmPackageImport)(importPathOriginal);
211
- // For less confusing error messages, let the resolution be handled by Vike or Node.js.
217
+ // For improved error messages, let the resolution be handled by Vike or Node.js.
212
218
  importPathTranspiled = importPathOriginal;
213
219
  }
214
220
  }
@@ -410,7 +410,7 @@ function setCliAndApiOptions(pageConfigGlobal, configDefinitionsResolved) {
410
410
  Object.entries(configValues).forEach(([configName, value]) => {
411
411
  var _a;
412
412
  const sourceName = `The ${(0, getConfigDefinedAt_js_1.getDefinedByString)(definedBy, configName)}`;
413
- assertKnownConfig(configName, configDefinitionsResolved.configNamesKnownGlobal, configDefinitionsResolved, '/', sourceName, exitOnError);
413
+ assertKnownConfig(configName, configDefinitionsResolved.configNamesKnownGlobal, configDefinitionsResolved, '/', false, sourceName, exitOnError);
414
414
  const sources = ((_a = pageConfigGlobal.configValueSources)[configName] ?? (_a[configName] = []));
415
415
  sources.unshift(getSourceNonConfigFile(configName, value, definedBy));
416
416
  });
@@ -885,12 +885,12 @@ function assertKnownConfigs(configDefinitionsResolved) {
885
885
  configNames.forEach((configName) => {
886
886
  const { locationId } = plusFile;
887
887
  const sourceName = plusFile.filePath.filePathToShowToUser;
888
- assertKnownConfig(configName, configNamesKnownLocal, configDefinitionsResolved, locationId, sourceName, false);
888
+ assertKnownConfig(configName, configNamesKnownLocal, configDefinitionsResolved, locationId, true, sourceName, false);
889
889
  });
890
890
  });
891
891
  });
892
892
  }
893
- function assertKnownConfig(configName, configNamesKnownRelevant, configDefinitionsResolved, locationId, sourceName, exitOnError) {
893
+ function assertKnownConfig(configName, configNamesKnownRelevant, configDefinitionsResolved, locationId, isPlusFile, sourceName, exitOnError) {
894
894
  const { configNamesKnownAll } = configDefinitionsResolved;
895
895
  if (configNamesKnownRelevant.includes(configName)) {
896
896
  (0, utils_js_1.assert)(configNamesKnownAll.includes(configName));
@@ -901,7 +901,10 @@ function assertKnownConfig(configName, configNamesKnownRelevant, configDefinitio
901
901
  if (configNamesKnownAll.includes(configName)) {
902
902
  (0, utils_js_1.assertUsage)(false, `${sourceName} sets the value of the config ${configNameColored} which is a custom config that is defined with ${picocolors_1.default.underline('https://vike.dev/meta')} at a path that doesn't apply to ${locationId} — see ${picocolors_1.default.underline('https://vike.dev/config#inheritance')}`, { exitOnError });
903
903
  }
904
- const errMsg = `${sourceName} sets an unknown config ${configNameColored}`;
904
+ const errMsg = isPlusFile
905
+ ? `${sourceName} sets an unknown config ${configNameColored}`
906
+ : `${sourceName} sets an unknown Vike config, see ${picocolors_1.default.underline('https://vike.dev/cli')} for the list of CLI options`;
907
+ (0, utils_js_1.assert)(errMsg.includes(configName));
905
908
  // Missing vike-{react,vue,solid} installation
906
909
  {
907
910
  const ui = ['vike-react', 'vike-vue', 'vike-solid'];
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setGlobalContext = setGlobalContext;
4
4
  const globalContext_js_1 = require("../../runtime/globalContext.js");
5
5
  const utils_js_1 = require("../utils.js");
6
- const getOutDirs_js_1 = require("../shared/getOutDirs.js");
7
6
  const getVikeConfig_js_1 = require("./importUserCode/v1-design/getVikeConfig.js");
7
+ const getViteConfigRuntime_js_1 = require("../shared/getViteConfigRuntime.js");
8
8
  function setGlobalContext() {
9
9
  let isServerReload = false;
10
10
  let config;
@@ -43,9 +43,8 @@ function setGlobalContext() {
43
43
  order: 'post',
44
44
  async handler(config_) {
45
45
  config = config_;
46
- const { outDirRoot } = (0, getOutDirs_js_1.getOutDirs)(config);
47
- (0, utils_js_1.assertFilePathAbsoluteFilesystem)(outDirRoot); // Needed for `importServerProductionEntry({ outDir })` of @brillout/vite-plugin-server-entry
48
- (0, globalContext_js_1.setGlobalContext_viteConfig)(config, outDirRoot);
46
+ const viteConfigRuntime = (0, getViteConfigRuntime_js_1.getViteConfigRuntime)(config);
47
+ (0, globalContext_js_1.setGlobalContext_viteConfig)(config, viteConfigRuntime);
49
48
  }
50
49
  }
51
50
  }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getViteConfigRuntime = getViteConfigRuntime;
4
+ const utils_js_1 = require("../utils.js");
5
+ const getOutDirs_js_1 = require("./getOutDirs.js");
6
+ function getViteConfigRuntime(config) {
7
+ (0, utils_js_1.assert)((0, utils_js_1.hasProp)(config, '_baseViteOriginal', 'string'));
8
+ const { outDirRoot } = (0, getOutDirs_js_1.getOutDirs)(config);
9
+ (0, utils_js_1.assertFilePathAbsoluteFilesystem)(outDirRoot);
10
+ const viteConfigRuntime = {
11
+ root: config.root,
12
+ build: {
13
+ outDir: outDirRoot
14
+ },
15
+ _baseViteOriginal: config._baseViteOriginal,
16
+ vitePluginServerEntry: {
17
+ inject: config.vitePluginServerEntry?.inject
18
+ }
19
+ };
20
+ return viteConfigRuntime;
21
+ }
@@ -2,10 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resolveClientEntriesDev = resolveClientEntriesDev;
4
4
  const utils_js_1 = require("../utils.js");
5
- const module_1 = require("module");
6
- // @ts-ignore `file://${__filename}` is shimmed at dist/cjs by dist-cjs-fixup.js.
7
- const importMetaUrl = `file://${__filename}`;
8
- const require_ = (0, module_1.createRequire)(importMetaUrl);
5
+ // @ts-ignore `file:///${__filename.split('\\').join('/')}` is shimmed at dist/cjs by dist-cjs-fixup.js.
6
+ const importMetaUrl = `file:///${__filename.split('\\').join('/')}`;
9
7
  (0, utils_js_1.assertIsNotProductionRuntime)();
10
8
  async function resolveClientEntriesDev(clientEntry, viteDevServer) {
11
9
  let root = viteDevServer.config.root;
@@ -29,20 +27,21 @@ async function resolveClientEntriesDev(clientEntry, viteDevServer) {
29
27
  else {
30
28
  if (clientEntry.startsWith('@@vike/')) {
31
29
  (0, utils_js_1.assert)(clientEntry.endsWith('.js'));
32
- try {
33
- // For Vitest (which doesn't resolve vike to its dist but to its source files)
34
- // [RELATIVE_PATH_FROM_DIST] Current file: node_modules/vike/node/plugin/shared/resolveClientEntriesDev.js
35
- filePath = (0, utils_js_1.toPosixPath)(require_.resolve(clientEntry.replace('@@vike/dist/esm/client/', '../../../client/').replace('.js', '.ts')));
36
- }
37
- catch {
30
+ let filePath_;
31
+ // For Vitest (which doesn't resolve vike to its dist but to its source files)
32
+ // [RELATIVE_PATH_FROM_DIST] Current file: node_modules/vike/node/plugin/shared/resolveClientEntriesDev.js
33
+ filePath_ = (0, utils_js_1.requireResolveOptionalNonUserFile)(clientEntry.replace('@@vike/dist/esm/client/', '../../../client/').replace('.js', '.ts'), importMetaUrl);
34
+ if (!filePath_) {
38
35
  // For users
39
36
  // [RELATIVE_PATH_FROM_DIST] Current file: node_modules/vike/dist/esm/node/plugin/shared/resolveClientEntriesDev.js
40
- filePath = (0, utils_js_1.toPosixPath)(require_.resolve(clientEntry.replace('@@vike/dist/esm/client/', '../../../../../dist/esm/client/')));
37
+ filePath_ = (0, utils_js_1.requireResolveOptionalNonUserFile)(clientEntry.replace('@@vike/dist/esm/client/', '../../../../../dist/esm/client/'), importMetaUrl);
41
38
  }
39
+ (0, utils_js_1.assert)(filePath_);
40
+ filePath = filePath_;
42
41
  }
43
42
  else {
44
43
  (0, utils_js_1.assertIsNpmPackageImport)(clientEntry);
45
- filePath = require_.resolve(clientEntry);
44
+ filePath = (0, utils_js_1.requireResolve)(clientEntry, root);
46
45
  }
47
46
  }
48
47
  if (!filePath.startsWith('/')) {
@@ -45,3 +45,4 @@ __exportStar(require("../../utils/PROJECT_VERSION.js"), exports);
45
45
  __exportStar(require("../../utils/isEqualStringList.js"), exports);
46
46
  __exportStar(require("../../utils/isDocker.js"), exports);
47
47
  __exportStar(require("../../utils/isVitest.js"), exports);
48
+ __exportStar(require("../../utils/rollupSourceMap.js"), exports);
@@ -11,7 +11,7 @@ function resolvePrerenderConfigGlobal(vikeConfig) {
11
11
  const prerenderSettings = prerenderConfigs.filter(isObject2);
12
12
  const prerenderConfigGlobal = {
13
13
  partial: pickFirst(prerenderSettings.map((c) => c.partial)) ?? false,
14
- noExtraDir: pickFirst(prerenderSettings.map((c) => c.noExtraDir)) ?? false,
14
+ noExtraDir: pickFirst(prerenderSettings.map((c) => c.noExtraDir)) ?? null,
15
15
  keepDistServer: pickFirst(prerenderSettings.map((c) => c.keepDistServer)) ?? false,
16
16
  parallel: pickFirst(prerenderSettings.map((c) => c.parallel)) ?? true,
17
17
  disableAutoRun: pickFirst(prerenderSettings.map((c) => c.disableAutoRun)) ?? false