vike 0.4.239 → 0.4.240-commit-bac5dee
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.
- package/dist/esm/client/index.d.ts +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/client/runtime-client-routing/createPageContextClientSide.d.ts +1 -1
- package/dist/esm/client/runtime-client-routing/createPageContextClientSide.js +1 -1
- package/dist/esm/client/runtime-client-routing/entry.js +5 -3
- package/dist/esm/client/runtime-client-routing/getBaseServer.js +0 -1
- package/dist/esm/client/runtime-client-routing/{globalContext.d.ts → getGlobalContextClientInternal.d.ts} +2 -2
- package/dist/esm/client/runtime-client-routing/{globalContext.js → getGlobalContextClientInternal.js} +8 -4
- package/dist/esm/client/runtime-client-routing/getPageContextFromHooks.d.ts +6 -6
- package/dist/esm/client/runtime-client-routing/getPageContextFromHooks.js +1 -1
- package/dist/esm/client/runtime-client-routing/isClientSideRoutable.d.ts +1 -1
- package/dist/esm/client/runtime-client-routing/renderPageClientSide.d.ts +4 -4
- package/dist/esm/client/runtime-client-routing/renderPageClientSide.js +15 -4
- package/dist/esm/client/runtime-server-routing/createPageContextClientSide.d.ts +1 -1
- package/dist/esm/client/runtime-server-routing/createPageContextClientSide.js +1 -1
- package/dist/esm/client/runtime-server-routing/entry.js +5 -3
- package/dist/esm/client/runtime-server-routing/{globalContext.d.ts → getGlobalContextClientInternal.d.ts} +2 -2
- package/dist/esm/client/runtime-server-routing/getGlobalContextClientInternal.js +6 -0
- package/dist/esm/client/shared/execHookOnRenderClient.d.ts +1 -1
- package/dist/esm/client/shared/{createGetGlobalContextClient.d.ts → getGlobalContextClientInternalShared.d.ts} +11 -8
- package/dist/esm/client/shared/getGlobalContextClientInternalShared.js +66 -0
- package/dist/esm/client/shared/loadPageConfigsLazyClientSide.js +1 -3
- package/dist/esm/node/prerender/runPrerender.d.ts +4 -2
- package/dist/esm/node/prerender/runPrerender.js +5 -2
- package/dist/esm/node/runtime/globalContext.d.ts +15 -2
- package/dist/esm/node/runtime/globalContext.js +46 -32
- package/dist/esm/node/runtime/renderPage/createPageContextServerSide.d.ts +4 -2
- package/dist/esm/node/runtime/renderPage/loadPageConfigsLazyServerSide.d.ts +4 -2
- package/dist/esm/node/runtime/renderPage/renderPageAfterRoute.d.ts +8 -4
- package/dist/esm/node/runtime/renderPage.d.ts +4 -2
- package/dist/esm/node/vite/index.js +42 -18
- package/dist/esm/node/vite/onLoad.js +1 -1
- package/dist/esm/node/vite/plugins/{pluginBuild → build}/handleAssetsManifest.d.ts +4 -0
- package/dist/esm/node/vite/plugins/{pluginBuild → build}/handleAssetsManifest.js +21 -6
- package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginBuildApp.js +24 -20
- package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginBuildConfig.js +20 -6
- package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginDistFileNames.d.ts +1 -1
- package/dist/esm/node/vite/plugins/build/pluginDistFileNames.js +253 -0
- package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginDistPackageJsonFile.d.ts +1 -1
- package/dist/esm/node/vite/plugins/build/pluginDistPackageJsonFile.js +40 -0
- package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginModuleBanner.d.ts +1 -1
- package/dist/esm/node/vite/plugins/build/pluginModuleBanner.js +49 -0
- package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginProdBuildEntry.js +4 -2
- package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginSuppressRollupWarning.d.ts +1 -1
- package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginSuppressRollupWarning.js +27 -23
- package/dist/esm/node/vite/plugins/non-runnable-dev/pluginReplaceConstantsNonRunnableDev.d.ts +7 -0
- package/dist/esm/node/vite/plugins/non-runnable-dev/pluginReplaceConstantsNonRunnableDev.js +47 -0
- package/dist/esm/node/vite/plugins/{pluginNonRunnableDev.d.ts → non-runnable-dev/pluginViteRPC.d.ts} +3 -7
- package/dist/esm/node/vite/plugins/non-runnable-dev/pluginViteRPC.js +30 -0
- package/dist/esm/node/vite/plugins/pluginBaseUrls.d.ts +1 -1
- package/dist/esm/node/vite/plugins/pluginBaseUrls.js +39 -33
- package/dist/esm/node/vite/plugins/pluginCommon.js +8 -28
- package/dist/esm/node/vite/plugins/pluginDev/determineFsAllowList.js +0 -1
- package/dist/esm/node/vite/plugins/pluginDev/determineOptimizeDeps.js +1 -1
- package/dist/esm/node/vite/plugins/pluginDev.js +51 -47
- package/dist/esm/node/vite/plugins/pluginExtractAssets.js +108 -92
- package/dist/esm/node/vite/plugins/pluginExtractExportNames.d.ts +1 -1
- package/dist/esm/node/vite/plugins/pluginExtractExportNames.js +39 -23
- package/dist/esm/node/vite/plugins/pluginFileEnv.d.ts +1 -1
- package/dist/esm/node/vite/plugins/pluginFileEnv.js +117 -92
- package/dist/esm/node/vite/plugins/pluginPreview.d.ts +1 -1
- package/dist/esm/node/vite/plugins/pluginPreview.js +38 -30
- package/dist/esm/node/vite/plugins/pluginReplaceConstantsEnvVars.d.ts +3 -0
- package/dist/esm/node/vite/plugins/pluginReplaceConstantsEnvVars.js +127 -0
- package/dist/esm/node/vite/plugins/pluginReplaceConstantsGlobalThis.d.ts +17 -0
- package/dist/esm/node/vite/plugins/pluginReplaceConstantsGlobalThis.js +52 -0
- package/dist/esm/node/vite/plugins/pluginReplaceConstantsPageContext.d.ts +3 -0
- package/dist/esm/node/vite/plugins/pluginReplaceConstantsPageContext.js +89 -0
- package/dist/esm/node/vite/plugins/pluginSetGlobalContext.js +4 -2
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/generateVirtualFilePageEntry.js +1 -1
- package/dist/esm/node/vite/plugins/pluginVirtualFiles.d.ts +1 -1
- package/dist/esm/node/vite/plugins/pluginVirtualFiles.js +67 -47
- package/dist/esm/node/vite/plugins/pluginWorkaroundCssModuleHmr.d.ts +1 -1
- package/dist/esm/node/vite/plugins/pluginWorkaroundCssModuleHmr.js +13 -9
- package/dist/esm/node/vite/plugins/pluginWorkaroundVite6HmrRegression.d.ts +1 -1
- package/dist/esm/node/vite/plugins/pluginWorkaroundVite6HmrRegression.js +26 -24
- package/dist/esm/node/vite/shared/getMagicString.d.ts +1 -1
- package/dist/esm/node/vite/shared/getMagicString.js +2 -0
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/configDefinitionsBuiltIn.js +2 -2
- package/dist/esm/shared/createGlobalContextShared.d.ts +4 -4
- package/dist/esm/shared/route/abort.d.ts +22 -11
- package/dist/esm/shared/route/abort.js +45 -5
- package/dist/esm/shared/route/index.js +13 -4
- package/dist/esm/shared/route/utils.d.ts +1 -0
- package/dist/esm/shared/route/utils.js +1 -0
- package/dist/esm/types/Config.d.ts +1 -1
- package/dist/esm/types/PageContext.d.ts +8 -8
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/assert.js +1 -0
- package/dist/esm/utils/debug.d.ts +5 -3
- package/dist/esm/utils/debug.js +28 -11
- package/dist/esm/utils/findPackageJson.js +0 -1
- package/dist/esm/utils/getGlobalObject.d.ts +5 -1
- package/dist/esm/utils/getGlobalObject.js +5 -1
- package/dist/esm/utils/getViteRPC.js +0 -2
- package/dist/esm/utils/isDev.js +3 -1
- package/dist/esm/utils/isNonRunnableDev.js +2 -2
- package/dist/esm/utils/requireResolve.js +1 -2
- package/dist/esm/utils/virtualFileId.d.ts +4 -0
- package/dist/esm/utils/virtualFileId.js +14 -11
- package/package.json +7 -26
- package/dist/cjs/__internal/index.js +0 -35
- package/dist/cjs/client/runtime-client-routing/globalContext.js +0 -49
- package/dist/cjs/client/runtime-client-routing/prefetch/PrefetchSetting.js +0 -2
- package/dist/cjs/client/runtime-server-routing/globalContext.js +0 -41
- package/dist/cjs/client/runtime-server-routing/onLoad.js +0 -7
- package/dist/cjs/client/runtime-server-routing/utils.js +0 -34
- package/dist/cjs/client/shared/createGetGlobalContextClient.js +0 -65
- package/dist/cjs/client/shared/getJsonSerializedInHtml.js +0 -40
- package/dist/cjs/client/shared/preparePageContextForPublicUsageClientShared.js +0 -41
- package/dist/cjs/client/shared/utils.js +0 -23
- package/dist/cjs/node/api/build.js +0 -24
- package/dist/cjs/node/api/context.js +0 -23
- package/dist/cjs/node/api/dev.js +0 -18
- package/dist/cjs/node/api/index.js +0 -44
- package/dist/cjs/node/api/onLoad.js +0 -9
- package/dist/cjs/node/api/prepareViteApiCall.js +0 -206
- package/dist/cjs/node/api/prerender.js +0 -18
- package/dist/cjs/node/api/preview.js +0 -38
- package/dist/cjs/node/api/types.js +0 -2
- package/dist/cjs/node/api/utils.js +0 -27
- package/dist/cjs/node/cli/context.js +0 -17
- package/dist/cjs/node/cli/entry.js +0 -121
- package/dist/cjs/node/cli/index.js +0 -12
- package/dist/cjs/node/cli/onLoad.js +0 -9
- package/dist/cjs/node/cli/parseCli.js +0 -95
- package/dist/cjs/node/cli/utils.js +0 -24
- package/dist/cjs/node/client/router.js +0 -19
- package/dist/cjs/node/createPageRenderer.js +0 -132
- package/dist/cjs/node/importBuild.js +0 -3
- package/dist/cjs/node/prerender/context.js +0 -26
- package/dist/cjs/node/prerender/index.js +0 -12
- package/dist/cjs/node/prerender/resolvePrerenderConfig.js +0 -66
- package/dist/cjs/node/prerender/runPrerender.js +0 -777
- package/dist/cjs/node/prerender/runPrerenderEntry.js +0 -55
- package/dist/cjs/node/prerender/utils.js +0 -37
- package/dist/cjs/node/runtime/globalContext.js +0 -572
- package/dist/cjs/node/runtime/index-deprecated.js +0 -33
- package/dist/cjs/node/runtime/index.js +0 -74
- package/dist/cjs/node/runtime/loggerRuntime.js +0 -17
- package/dist/cjs/node/runtime/onLoad.js +0 -29
- package/dist/cjs/node/runtime/page-files/setup.js +0 -5
- package/dist/cjs/node/runtime/renderPage/analyzePage.js +0 -71
- package/dist/cjs/node/runtime/renderPage/assertArguments.js +0 -42
- package/dist/cjs/node/runtime/renderPage/createHttpResponse/assertNoInfiniteHttpRedirect.js +0 -51
- package/dist/cjs/node/runtime/renderPage/createHttpResponse.js +0 -114
- package/dist/cjs/node/runtime/renderPage/createPageContextServerSide.js +0 -59
- package/dist/cjs/node/runtime/renderPage/csp.js +0 -47
- package/dist/cjs/node/runtime/renderPage/execHookDataAndOnBeforeRender.js +0 -31
- package/dist/cjs/node/runtime/renderPage/execHookOnRenderHtml.js +0 -120
- package/dist/cjs/node/runtime/renderPage/execHookServer.js +0 -8
- package/dist/cjs/node/runtime/renderPage/getCacheControl.js +0 -24
- package/dist/cjs/node/runtime/renderPage/getEarlyHints.js +0 -20
- package/dist/cjs/node/runtime/renderPage/getHttpResponseBody.js +0 -137
- package/dist/cjs/node/runtime/renderPage/getPageAssets/getManifestEntry.js +0 -125
- package/dist/cjs/node/runtime/renderPage/getPageAssets/retrievePageAssetsDev.js +0 -86
- package/dist/cjs/node/runtime/renderPage/getPageAssets/retrievePageAssetsProd.js +0 -77
- package/dist/cjs/node/runtime/renderPage/getPageAssets/sortPageAssetsForEarlyHintsHeader.js +0 -36
- package/dist/cjs/node/runtime/renderPage/getPageAssets.js +0 -50
- package/dist/cjs/node/runtime/renderPage/handleErrorWithoutErrorPage.js +0 -41
- package/dist/cjs/node/runtime/renderPage/handlePageContextRequestUrl.js +0 -68
- package/dist/cjs/node/runtime/renderPage/headersResponse.js +0 -48
- package/dist/cjs/node/runtime/renderPage/html/injectAssets/getHtmlTags.js +0 -269
- package/dist/cjs/node/runtime/renderPage/html/injectAssets/getViteDevScript.js +0 -32
- package/dist/cjs/node/runtime/renderPage/html/injectAssets/inferHtmlTags.js +0 -55
- package/dist/cjs/node/runtime/renderPage/html/injectAssets/injectAssets__public.js +0 -31
- package/dist/cjs/node/runtime/renderPage/html/injectAssets/injectHtmlTags.js +0 -161
- package/dist/cjs/node/runtime/renderPage/html/injectAssets/mergeScriptTags.js +0 -73
- package/dist/cjs/node/runtime/renderPage/html/injectAssets/sanitizeJson.js +0 -8
- package/dist/cjs/node/runtime/renderPage/html/injectAssets.js +0 -93
- package/dist/cjs/node/runtime/renderPage/html/propKeys.js +0 -47
- package/dist/cjs/node/runtime/renderPage/html/renderHtml.js +0 -245
- package/dist/cjs/node/runtime/renderPage/html/serializeContext.js +0 -189
- package/dist/cjs/node/runtime/renderPage/html/stream/react-streaming.js +0 -36
- package/dist/cjs/node/runtime/renderPage/html/stream.js +0 -829
- package/dist/cjs/node/runtime/renderPage/inferMediaType.js +0 -81
- package/dist/cjs/node/runtime/renderPage/isFontFallback.js +0 -29
- package/dist/cjs/node/runtime/renderPage/isNewError.js +0 -25
- package/dist/cjs/node/runtime/renderPage/loadPageConfigsLazyServerSide.js +0 -124
- package/dist/cjs/node/runtime/renderPage/log404/index.js +0 -154
- package/dist/cjs/node/runtime/renderPage/logErrorHint/errors.js +0 -20
- package/dist/cjs/node/runtime/renderPage/logErrorHint.js +0 -200
- package/dist/cjs/node/runtime/renderPage/loggerProd.js +0 -34
- package/dist/cjs/node/runtime/renderPage/preparePageContextForPublicUsageServer.js +0 -10
- package/dist/cjs/node/runtime/renderPage/renderPageAfterRoute.js +0 -83
- package/dist/cjs/node/runtime/renderPage/resolveRedirects.js +0 -71
- package/dist/cjs/node/runtime/renderPage.js +0 -502
- package/dist/cjs/node/runtime/universal-middleware.js +0 -20
- package/dist/cjs/node/runtime/utils.js +0 -83
- package/dist/cjs/node/runtime-dev/createDevMiddleware.js +0 -27
- package/dist/cjs/node/runtime-dev/index.js +0 -42
- package/dist/cjs/node/shared/assertV1Design.js +0 -30
- package/dist/cjs/node/shared/extractAssetsQuery.js +0 -29
- package/dist/cjs/node/shared/getVikeConfigError.js +0 -22
- package/dist/cjs/node/shared/isErrorDebug.js +0 -7
- package/dist/cjs/node/shared/prependEntriesDir.js +0 -13
- package/dist/cjs/node/shared/resolveBase.js +0 -35
- package/dist/cjs/node/shared/utils.js +0 -35
- package/dist/cjs/node/shared/virtualFileId.js +0 -110
- package/dist/cjs/node/vite/index.js +0 -69
- package/dist/cjs/node/vite/onLoad.js +0 -21
- package/dist/cjs/node/vite/plugins/pluginBaseUrls.js +0 -48
- package/dist/cjs/node/vite/plugins/pluginBuild/handleAssetsManifest.js +0 -342
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginBuildApp.js +0 -179
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginBuildConfig.js +0 -220
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginDistFileNames.js +0 -254
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginDistPackageJsonFile.js +0 -36
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginModuleBanner.js +0 -41
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginProdBuildEntry.js +0 -109
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginSuppressRollupWarning.js +0 -63
- package/dist/cjs/node/vite/plugins/pluginBuild.js +0 -21
- package/dist/cjs/node/vite/plugins/pluginCommon/assertResolveAlias.js +0 -88
- package/dist/cjs/node/vite/plugins/pluginCommon.js +0 -197
- package/dist/cjs/node/vite/plugins/pluginDev/determineFsAllowList.js +0 -28
- package/dist/cjs/node/vite/plugins/pluginDev/determineOptimizeDeps.js +0 -163
- package/dist/cjs/node/vite/plugins/pluginDev.js +0 -107
- package/dist/cjs/node/vite/plugins/pluginEnvVars.js +0 -87
- package/dist/cjs/node/vite/plugins/pluginExtractAssets.js +0 -227
- package/dist/cjs/node/vite/plugins/pluginExtractExportNames.js +0 -99
- package/dist/cjs/node/vite/plugins/pluginFileEnv.js +0 -149
- package/dist/cjs/node/vite/plugins/pluginNonRunnableDev.js +0 -52
- package/dist/cjs/node/vite/plugins/pluginPreview.js +0 -76
- package/dist/cjs/node/vite/plugins/pluginReplaceConstants.js +0 -69
- package/dist/cjs/node/vite/plugins/pluginSetGlobalContext.js +0 -49
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/debug.js +0 -5
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/generateVirtualFileGlobalEntry.js +0 -56
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/generateVirtualFileGlobalEntryWithOldDesign.js +0 -190
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/generateVirtualFilePageEntry.js +0 -54
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/getConfigValueSourcesRelevant.js +0 -97
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles.js +0 -215
- package/dist/cjs/node/vite/plugins/pluginWorkaroundCssModuleHmr.js +0 -15
- package/dist/cjs/node/vite/plugins/pluginWorkaroundVite6HmrRegression.js +0 -35
- package/dist/cjs/node/vite/shared/addSsrMiddleware.js +0 -60
- package/dist/cjs/node/vite/shared/findPageFiles.js +0 -25
- package/dist/cjs/node/vite/shared/getAssetsDir.js +0 -10
- package/dist/cjs/node/vite/shared/getClientEntrySrcDev.js +0 -42
- package/dist/cjs/node/vite/shared/getEnvVarObject.js +0 -37
- package/dist/cjs/node/vite/shared/getFilePath.js +0 -172
- package/dist/cjs/node/vite/shared/getHttpRequestAsyncStore.js +0 -125
- package/dist/cjs/node/vite/shared/getMagicString.js +0 -18
- package/dist/cjs/node/vite/shared/getManifestFilePathRelative.js +0 -10
- package/dist/cjs/node/vite/shared/getOutDirs.js +0 -146
- package/dist/cjs/node/vite/shared/getViteConfigRuntime.js +0 -21
- package/dist/cjs/node/vite/shared/isAsset.js +0 -40
- package/dist/cjs/node/vite/shared/isViteCliCall.js +0 -83
- package/dist/cjs/node/vite/shared/isViteServerSide.js +0 -68
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errBabelReact.js +0 -15
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errBabelSolid.js +0 -15
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errEsbuild.js +0 -38
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errMdx1.js +0 -26
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errMdx2.js +0 -85
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errPostcss.js +0 -30
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errSwc.js +0 -19
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errSwcBig.js +0 -19
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueCss.js +0 -29
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueHtml.js +0 -13
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueJavascript.js +0 -15
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet.js +0 -162
- package/dist/cjs/node/vite/shared/loggerNotProd/log.js +0 -102
- package/dist/cjs/node/vite/shared/loggerNotProd.js +0 -208
- package/dist/cjs/node/vite/shared/loggerVite/removeSuperfluousViteLog.js +0 -26
- package/dist/cjs/node/vite/shared/loggerVite.js +0 -54
- package/dist/cjs/node/vite/shared/normalizeId.js +0 -9
- package/dist/cjs/node/vite/shared/parseEsModule.js +0 -33
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/assertExtensions.js +0 -136
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/configDefinitionsBuiltIn.js +0 -262
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/crawlPlusFiles/ignorePatternsBuiltIn.js +0 -18
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/crawlPlusFiles.js +0 -252
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/filesystemRouting.js +0 -190
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/getConfigFileExport.js +0 -17
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/getPlusFilesAll.js +0 -127
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/loadFileAtConfigTime.js +0 -129
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/pointerImports.js +0 -195
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/resolvePointerImport.js +0 -102
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/transpileAndExecuteFile.js +0 -425
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal.js +0 -1151
- package/dist/cjs/node/vite/shared/rollupIsEsm.js +0 -15
- package/dist/cjs/node/vite/utils.js +0 -45
- package/dist/cjs/package.json +0 -1
- package/dist/cjs/shared/NOT_SERIALIZABLE.js +0 -4
- package/dist/cjs/shared/RenderErrorPage.js +0 -6
- package/dist/cjs/shared/abort.js +0 -16
- package/dist/cjs/shared/addIs404ToPageProps.js +0 -18
- package/dist/cjs/shared/assertHookReturnedObject.js +0 -21
- package/dist/cjs/shared/assertOnBeforeRenderHookReturn.js +0 -21
- package/dist/cjs/shared/assertPageContextProvidedByUser.js +0 -20
- package/dist/cjs/shared/createGlobalContextShared.js +0 -109
- package/dist/cjs/shared/createPageContextShared.js +0 -17
- package/dist/cjs/shared/determinePageIdOld.js +0 -11
- package/dist/cjs/shared/error-page.js +0 -40
- package/dist/cjs/shared/getPageContext.js +0 -6
- package/dist/cjs/shared/getPageContextRequestUrl.js +0 -16
- package/dist/cjs/shared/getPageContextUrlComputed.js +0 -132
- package/dist/cjs/shared/getPageFiles/analyzeClientSide.js +0 -19
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/ClientDependency.js +0 -2
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/analyzeExports.js +0 -50
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/determineClientEntry.js +0 -30
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/getExportNames.js +0 -15
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide.js +0 -59
- package/dist/cjs/shared/getPageFiles/analyzePageServerSide.js +0 -22
- package/dist/cjs/shared/getPageFiles/assert_exports_old_design.js +0 -24
- package/dist/cjs/shared/getPageFiles/fileTypes.js +0 -52
- package/dist/cjs/shared/getPageFiles/getAllPageIdFiles.js +0 -102
- package/dist/cjs/shared/getPageFiles/getPageFileObject.js +0 -56
- package/dist/cjs/shared/getPageFiles/parseVirtualFileExportsGlobalEntry.js +0 -100
- package/dist/cjs/shared/getPageFiles.js +0 -7
- package/dist/cjs/shared/getProxyForPublicUsage.js +0 -56
- package/dist/cjs/shared/hooks/execHook.js +0 -147
- package/dist/cjs/shared/hooks/getHook.js +0 -173
- package/dist/cjs/shared/htmlElementIds.js +0 -5
- package/dist/cjs/shared/misc/isServerSideError.js +0 -4
- package/dist/cjs/shared/misc/pageContextInitIsPassedToClient.js +0 -4
- package/dist/cjs/shared/modifyUrl.js +0 -28
- package/dist/cjs/shared/modifyUrlSameOrigin.js +0 -47
- package/dist/cjs/shared/page-configs/assertPlusFileExport.js +0 -42
- package/dist/cjs/shared/page-configs/findPageConfig.js +0 -10
- package/dist/cjs/shared/page-configs/getConfigDefinedAt.js +0 -65
- package/dist/cjs/shared/page-configs/getConfigValueBuildTime.js +0 -68
- package/dist/cjs/shared/page-configs/getConfigValueRuntime.js +0 -10
- package/dist/cjs/shared/page-configs/getConfigValueTyped.js +0 -32
- package/dist/cjs/shared/page-configs/getExportPath.js +0 -29
- package/dist/cjs/shared/page-configs/helpers.js +0 -27
- package/dist/cjs/shared/page-configs/loadAndParseVirtualFilePageEntry.js +0 -25
- package/dist/cjs/shared/page-configs/resolveVikeConfigPublic.js +0 -287
- package/dist/cjs/shared/page-configs/serialize/PageConfigSerialized.js +0 -2
- package/dist/cjs/shared/page-configs/serialize/assertPageConfigsSerialized.js +0 -1
- package/dist/cjs/shared/page-configs/serialize/parsePageConfigsSerialized.js +0 -145
- package/dist/cjs/shared/page-configs/serialize/serializeConfigValues.js +0 -290
- package/dist/cjs/shared/prepareGlobalContextForPublicUsage.js +0 -10
- package/dist/cjs/shared/preparePageContextForPublicUsage.js +0 -80
- package/dist/cjs/shared/route/abort.js +0 -178
- package/dist/cjs/shared/route/debug.js +0 -23
- package/dist/cjs/shared/route/deduceRouteStringFromFilesystemPath.js +0 -52
- package/dist/cjs/shared/route/execHookGuard.js +0 -37
- package/dist/cjs/shared/route/execHookOnBeforeRoute.js +0 -84
- package/dist/cjs/shared/route/index.js +0 -107
- package/dist/cjs/shared/route/loadPageRoutes.js +0 -197
- package/dist/cjs/shared/route/noRouteMatch.js +0 -4
- package/dist/cjs/shared/route/resolvePrecedence.js +0 -93
- package/dist/cjs/shared/route/resolveRoute.js +0 -20
- package/dist/cjs/shared/route/resolveRouteFunction.js +0 -73
- package/dist/cjs/shared/route/resolveRouteString.js +0 -153
- package/dist/cjs/shared/route/resolveUrlPathname.js +0 -47
- package/dist/cjs/shared/route/routing.js +0 -9
- package/dist/cjs/shared/route/utils.js +0 -40
- package/dist/cjs/shared/utils.js +0 -49
- package/dist/cjs/types/Config/ConfigResolved.js +0 -2
- package/dist/cjs/types/Config.js +0 -2
- package/dist/cjs/types/FilePath.js +0 -2
- package/dist/cjs/types/PageConfig.js +0 -2
- package/dist/cjs/types/PageContext.js +0 -2
- package/dist/cjs/types/VikeGlobalInternal.js +0 -2
- package/dist/cjs/types/VikeNamespace.js +0 -2
- package/dist/cjs/types/ViteManifest.js +0 -2
- package/dist/cjs/types/defineConfig.js +0 -6
- package/dist/cjs/types/index-dreprecated.js +0 -3
- package/dist/cjs/types/index.js +0 -5
- package/dist/cjs/utils/PROJECT_VERSION.js +0 -5
- package/dist/cjs/utils/PromiseType.js +0 -2
- package/dist/cjs/utils/assert.js +0 -211
- package/dist/cjs/utils/assertIsBrowser.js +0 -8
- package/dist/cjs/utils/assertIsNotBrowser.js +0 -9
- package/dist/cjs/utils/assertKeys.js +0 -27
- package/dist/cjs/utils/assertNodeVersion.js +0 -14
- package/dist/cjs/utils/assertRoutingType.js +0 -29
- package/dist/cjs/utils/assertSetup.js +0 -171
- package/dist/cjs/utils/assertSingleInstance.js +0 -110
- package/dist/cjs/utils/assertVersion.js +0 -60
- package/dist/cjs/utils/capitalizeFirstLetter.js +0 -9
- package/dist/cjs/utils/cast.js +0 -6
- package/dist/cjs/utils/catchInfiniteLoop.js +0 -34
- package/dist/cjs/utils/changeEnumerable.js +0 -8
- package/dist/cjs/utils/checkType.js +0 -6
- package/dist/cjs/utils/compareString.js +0 -10
- package/dist/cjs/utils/createErrorWithCleanStackTrace.js +0 -39
- package/dist/cjs/utils/debug.js +0 -178
- package/dist/cjs/utils/debugGlob.js +0 -6
- package/dist/cjs/utils/deepEqual.js +0 -10
- package/dist/cjs/utils/escapeHtml.js +0 -13
- package/dist/cjs/utils/escapeRegex.js +0 -7
- package/dist/cjs/utils/findFile.js +0 -30
- package/dist/cjs/utils/findPackageJson.js +0 -18
- package/dist/cjs/utils/formatHintLog.js +0 -17
- package/dist/cjs/utils/freezePartial.js +0 -35
- package/dist/cjs/utils/genPromise.js +0 -51
- package/dist/cjs/utils/getFileExtension.js +0 -16
- package/dist/cjs/utils/getGlobalObject.js +0 -15
- package/dist/cjs/utils/getMostSimilar.js +0 -68
- package/dist/cjs/utils/getPropAccessNotation.js +0 -9
- package/dist/cjs/utils/getRandomId.js +0 -14
- package/dist/cjs/utils/getTerminalWidth.js +0 -7
- package/dist/cjs/utils/getValuePrintable.js +0 -10
- package/dist/cjs/utils/getViteRPC.js +0 -79
- package/dist/cjs/utils/hasProp.js +0 -50
- package/dist/cjs/utils/humanizeTime.js +0 -24
- package/dist/cjs/utils/includes.js +0 -13
- package/dist/cjs/utils/injectRollupInputs.js +0 -29
- package/dist/cjs/utils/isArray.js +0 -7
- package/dist/cjs/utils/isArrayOfStrings.js +0 -7
- package/dist/cjs/utils/isBrowser.js +0 -8
- package/dist/cjs/utils/isCallable.js +0 -6
- package/dist/cjs/utils/isDev.js +0 -20
- package/dist/cjs/utils/isDocker.js +0 -45
- package/dist/cjs/utils/isEqualStringList.js +0 -13
- package/dist/cjs/utils/isFilePathAbsoluteFilesystem.js +0 -66
- package/dist/cjs/utils/isHtml.js +0 -9
- package/dist/cjs/utils/isImportPath.js +0 -21
- package/dist/cjs/utils/isNodeJS.js +0 -16
- package/dist/cjs/utils/isNonRunnableDev.js +0 -12
- package/dist/cjs/utils/isNullish.js +0 -16
- package/dist/cjs/utils/isObject.js +0 -6
- package/dist/cjs/utils/isObjectOfStrings.js +0 -7
- package/dist/cjs/utils/isObjectWithKeys.js +0 -15
- package/dist/cjs/utils/isPlainObject.js +0 -19
- package/dist/cjs/utils/isPromise.js +0 -7
- package/dist/cjs/utils/isPropertyGetter.js +0 -7
- package/dist/cjs/utils/isReact.js +0 -23
- package/dist/cjs/utils/isRunnableDevEnvironment.js +0 -9
- package/dist/cjs/utils/isSameErrorMessage.js +0 -9
- package/dist/cjs/utils/isScriptFile.js +0 -67
- package/dist/cjs/utils/isVikeReactApp.js +0 -8
- package/dist/cjs/utils/isVitest.js +0 -6
- package/dist/cjs/utils/joinEnglish.js +0 -14
- package/dist/cjs/utils/normalizeHeaders.js +0 -17
- package/dist/cjs/utils/objectAssign.js +0 -14
- package/dist/cjs/utils/objectAssignSafe.js +0 -7
- package/dist/cjs/utils/objectDefineProperty.js +0 -7
- package/dist/cjs/utils/objectEntries.js +0 -8
- package/dist/cjs/utils/objectEntriesForEach.js +0 -7
- package/dist/cjs/utils/objectFilter.js +0 -10
- package/dist/cjs/utils/objectFromEntries.js +0 -7
- package/dist/cjs/utils/objectKeys.js +0 -9
- package/dist/cjs/utils/objectReplace.js +0 -9
- package/dist/cjs/utils/onPageVisibilityChange.js +0 -18
- package/dist/cjs/utils/pLimit.js +0 -134
- package/dist/cjs/utils/parseNpmPackage.js +0 -106
- package/dist/cjs/utils/parseUrl-extras.js +0 -110
- package/dist/cjs/utils/parseUrl.js +0 -338
- package/dist/cjs/utils/path.js +0 -59
- package/dist/cjs/utils/pick.js +0 -12
- package/dist/cjs/utils/preservePropertyGetters.js +0 -30
- package/dist/cjs/utils/redirectHard.js +0 -6
- package/dist/cjs/utils/removeEmptyLines.js +0 -9
- package/dist/cjs/utils/removeFileExtension.js +0 -6
- package/dist/cjs/utils/requireResolve.js +0 -214
- package/dist/cjs/utils/rollupSourceMap.js +0 -19
- package/dist/cjs/utils/sleep.js +0 -6
- package/dist/cjs/utils/slice.js +0 -35
- package/dist/cjs/utils/sorter.js +0 -117
- package/dist/cjs/utils/stringifyStringArray.js +0 -6
- package/dist/cjs/utils/stripAnsi.js +0 -21
- package/dist/cjs/utils/styleFileRE.js +0 -6
- package/dist/cjs/utils/throttle.js +0 -15
- package/dist/cjs/utils/trackLogs.js +0 -31
- package/dist/cjs/utils/trimWithAnsi.js +0 -40
- package/dist/cjs/utils/truncateString.js +0 -23
- package/dist/cjs/utils/unique.js +0 -6
- package/dist/cjs/utils/updateType.js +0 -9
- package/dist/cjs/utils/urlToFile.js +0 -36
- package/dist/cjs/utils/virtualFileId.js +0 -39
- package/dist/cjs/utils/warnIfErrorIsNotObject.js +0 -23
- package/dist/esm/client/runtime-server-routing/globalContext.js +0 -5
- package/dist/esm/client/shared/createGetGlobalContextClient.js +0 -65
- package/dist/esm/node/vite/plugins/pluginBuild/pluginDistFileNames.js +0 -249
- package/dist/esm/node/vite/plugins/pluginBuild/pluginDistPackageJsonFile.js +0 -34
- package/dist/esm/node/vite/plugins/pluginBuild/pluginModuleBanner.js +0 -39
- package/dist/esm/node/vite/plugins/pluginBuild.d.ts +0 -3
- package/dist/esm/node/vite/plugins/pluginBuild.js +0 -19
- package/dist/esm/node/vite/plugins/pluginEnvVars.d.ts +0 -3
- package/dist/esm/node/vite/plugins/pluginEnvVars.js +0 -85
- package/dist/esm/node/vite/plugins/pluginNonRunnableDev.js +0 -50
- package/dist/esm/node/vite/plugins/pluginReplaceConstants.d.ts +0 -3
- package/dist/esm/node/vite/plugins/pluginReplaceConstants.js +0 -67
- package/dist/esm/shared/route/debug.d.ts +0 -6
- package/dist/esm/shared/route/debug.js +0 -21
- /package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginBuildApp.d.ts +0 -0
- /package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginBuildConfig.d.ts +0 -0
- /package/dist/esm/node/vite/plugins/{pluginBuild → build}/pluginProdBuildEntry.d.ts +0 -0
|
@@ -8,75 +8,104 @@ import { getExportNames } from '../shared/parseEsModule.js';
|
|
|
8
8
|
import { normalizeId } from '../shared/normalizeId.js';
|
|
9
9
|
import { isV1Design } from '../shared/resolveVikeConfigInternal.js';
|
|
10
10
|
import { isViteServerSide, isViteServerSide_extraSafe } from '../shared/isViteServerSide.js';
|
|
11
|
+
const skipNodeModules = '/node_modules/'; // Only apply `.server.js` and `.client.js` to user files
|
|
12
|
+
const filterRolldown = {
|
|
13
|
+
id: {
|
|
14
|
+
include: ['client', 'server'].map((env) => `**/*${getSuffix(env)}*`),
|
|
15
|
+
exclude: [`**${skipNodeModules}**`],
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
const filterFunction = (id) => {
|
|
19
|
+
if (id.includes(skipNodeModules))
|
|
20
|
+
return false;
|
|
21
|
+
if (!id.includes(getSuffix('client')) && !id.includes(getSuffix('server')))
|
|
22
|
+
return false;
|
|
23
|
+
return true;
|
|
24
|
+
};
|
|
11
25
|
function pluginFileEnv() {
|
|
12
26
|
let config;
|
|
13
27
|
let viteDevServer;
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
28
|
+
return [
|
|
29
|
+
{
|
|
30
|
+
name: 'vike:pluginFileEnv',
|
|
31
|
+
load: {
|
|
32
|
+
filter: filterRolldown,
|
|
33
|
+
handler(id, options) {
|
|
34
|
+
// In build, we use generateBundle() instead of the load() hook. Using load() works for dynamic imports in dev thanks to Vite's lazy transpiling, but it doesn't work in build because Rollup transpiles any dynamically imported module even if it's never actually imported.
|
|
35
|
+
if (!viteDevServer)
|
|
36
|
+
return;
|
|
37
|
+
if (!isV1Design())
|
|
38
|
+
return;
|
|
39
|
+
if (skip(id, config.root))
|
|
40
|
+
return;
|
|
41
|
+
// For `.vue` files: https://github.com/vikejs/vike/issues/1912#issuecomment-2394981475
|
|
42
|
+
if (id.endsWith('?direct'))
|
|
43
|
+
id = id.slice(0, -1 * '?direct'.length);
|
|
44
|
+
const moduleInfo = viteDevServer.moduleGraph.getModuleById(id);
|
|
45
|
+
assert(moduleInfo);
|
|
46
|
+
const importers = Array.from(moduleInfo.importers)
|
|
47
|
+
.map((m) => m.id)
|
|
48
|
+
.filter((id) => id !== null);
|
|
49
|
+
assertFileEnv(id, isViteServerSide_extraSafe(config, this.environment, options), importers,
|
|
50
|
+
// In dev, we only show a warning because we don't want to disrupt when the user plays with settings such as [ssr](https://vike.dev/ssr).
|
|
51
|
+
true);
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
// In production, we have to use transform() to replace modules with a runtime error because generateBundle() doesn't work for dynamic imports. In production, dynamic imports can only be verified at runtime.
|
|
55
|
+
transform: {
|
|
56
|
+
filter: filterRolldown,
|
|
57
|
+
async handler(code, id, options) {
|
|
58
|
+
id = normalizeId(id);
|
|
59
|
+
// In dev, only using load() is enough as it also works for dynamic imports (see sibling comment).
|
|
60
|
+
if (viteDevServer)
|
|
61
|
+
return;
|
|
62
|
+
if (skip(id, config.root))
|
|
63
|
+
return;
|
|
64
|
+
const isServerSide = isViteServerSide_extraSafe(config, this.environment, options);
|
|
65
|
+
if (!isWrongEnv(id, isServerSide))
|
|
66
|
+
return;
|
|
67
|
+
const { importers } = this.getModuleInfo(id);
|
|
68
|
+
// Throwing a verbose error doesn't waste client-side KBs as dynamic imports are code split.
|
|
69
|
+
const errMsg = getErrorMessage(id, isServerSide, importers, false, true);
|
|
70
|
+
// We have to inject empty exports to avoid Rollup complaining about missing exports, see https://gist.github.com/brillout/5ea45776e65bd65100a52ecd7bfda3ff
|
|
71
|
+
const { exportNames } = await getExportNames(code);
|
|
72
|
+
return rollupSourceMapRemove([
|
|
73
|
+
`throw new Error(${JSON.stringify(errMsg)});`,
|
|
74
|
+
...exportNames.map((name) => name === 'default' ? 'export default undefined;' : `export const ${name} = undefined;`),
|
|
75
|
+
].join('\n'));
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
generateBundle: {
|
|
79
|
+
handler() {
|
|
80
|
+
Array.from(this.getModuleIds())
|
|
81
|
+
.filter(filterFunction)
|
|
82
|
+
.filter((id) => !skip(id, config.root))
|
|
83
|
+
.forEach((moduleId) => {
|
|
84
|
+
const mod = this.getModuleInfo(moduleId);
|
|
85
|
+
const { importers } = mod;
|
|
86
|
+
if (importers.length === 0) {
|
|
87
|
+
// Dynamic imports can only be verified at runtime
|
|
88
|
+
/* This assertion can fail: https://github.com/vikejs/vike/issues/2227
|
|
89
|
+
assert(dynamicImporters.length > 0)
|
|
90
|
+
*/
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
assertFileEnv(moduleId, isViteServerSide(config, this.environment), importers, false);
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
configResolved: {
|
|
98
|
+
handler(config_) {
|
|
99
|
+
config = config_;
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
configureServer: {
|
|
103
|
+
handler(viteDevServer_) {
|
|
104
|
+
viteDevServer = viteDevServer_;
|
|
105
|
+
},
|
|
106
|
+
},
|
|
78
107
|
},
|
|
79
|
-
|
|
108
|
+
];
|
|
80
109
|
function assertFileEnv(moduleId, isServerSide, importers, onlyWarn) {
|
|
81
110
|
if (!isWrongEnv(moduleId, isServerSide))
|
|
82
111
|
return;
|
|
@@ -114,31 +143,27 @@ function pluginFileEnv() {
|
|
|
114
143
|
}
|
|
115
144
|
return errMsg;
|
|
116
145
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
function getModulePath(moduleId) {
|
|
142
|
-
return moduleId.split('?')[0];
|
|
143
|
-
}
|
|
146
|
+
}
|
|
147
|
+
function isWrongEnv(moduleId, isServerSide) {
|
|
148
|
+
const modulePath = getModulePath(moduleId);
|
|
149
|
+
const suffixWrong = getSuffix(isServerSide ? 'client' : 'server');
|
|
150
|
+
return modulePath.includes(suffixWrong);
|
|
151
|
+
}
|
|
152
|
+
function skip(id, userRootDir) {
|
|
153
|
+
assert(filterFunction(id));
|
|
154
|
+
// TO-DO/next-major-release: remove
|
|
155
|
+
if (extractAssetsRE.test(id) || extractExportNamesRE.test(id))
|
|
156
|
+
return true;
|
|
157
|
+
if (getModulePath(id).endsWith('.css'))
|
|
158
|
+
return true;
|
|
159
|
+
// Skip linked dependencies
|
|
160
|
+
if (!id.startsWith(userRootDir))
|
|
161
|
+
return true;
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
function getSuffix(env) {
|
|
165
|
+
return `.${env}.`;
|
|
166
|
+
}
|
|
167
|
+
function getModulePath(moduleId) {
|
|
168
|
+
return moduleId.split('?')[0];
|
|
144
169
|
}
|
|
@@ -11,37 +11,45 @@ import { getVikeConfigInternal } from '../shared/resolveVikeConfigInternal.js';
|
|
|
11
11
|
function pluginPreview() {
|
|
12
12
|
let config;
|
|
13
13
|
let vikeConfig;
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
name: 'vike:pluginPreview',
|
|
17
|
+
apply: applyPreview,
|
|
18
|
+
config: {
|
|
19
|
+
handler() {
|
|
20
|
+
return {
|
|
21
|
+
appType: 'custom',
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
configResolved: {
|
|
26
|
+
async handler(config_) {
|
|
27
|
+
config = config_;
|
|
28
|
+
vikeConfig = await getVikeConfigInternal();
|
|
29
|
+
logDockerHint(config.preview.host);
|
|
30
|
+
// vikeConfig = await getVikeConfig(config)
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
configurePreviewServer: {
|
|
34
|
+
handler(server) {
|
|
35
|
+
/* - Couldn't make `appType: 'mpa'` work as of npm:@brillout/vite@5.0.0-beta.14.0426910c
|
|
36
|
+
- This ugly hack to set appType for preview won't be need once https://github.com/vitejs/vite/pull/14855 is merged.
|
|
37
|
+
config.appType = 'mpa'
|
|
38
|
+
*/
|
|
39
|
+
return () => {
|
|
40
|
+
const { isPrerenderingEnabledForAllPages, isPrerenderingEnabled } = vikeConfig.prerenderContext;
|
|
41
|
+
assertDist(isPrerenderingEnabledForAllPages);
|
|
42
|
+
// We cannot re-use Vite's static middleware: https://github.com/vitejs/vite/pull/14836#issuecomment-1788540300
|
|
43
|
+
addStaticAssetsMiddleware(server.middlewares);
|
|
44
|
+
if (!isPrerenderingEnabledForAllPages) {
|
|
45
|
+
addSsrMiddleware(server.middlewares, config, true, isPrerenderingEnabled);
|
|
46
|
+
}
|
|
47
|
+
addStatic404Middleware(server.middlewares);
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
},
|
|
21
51
|
},
|
|
22
|
-
|
|
23
|
-
config = config_;
|
|
24
|
-
vikeConfig = await getVikeConfigInternal();
|
|
25
|
-
logDockerHint(config.preview.host);
|
|
26
|
-
// vikeConfig = await getVikeConfig(config)
|
|
27
|
-
},
|
|
28
|
-
configurePreviewServer(server) {
|
|
29
|
-
/* - Couldn't make `appType: 'mpa'` work as of npm:@brillout/vite@5.0.0-beta.14.0426910c
|
|
30
|
-
- This ugly hack to set appType for preview won't be need once https://github.com/vitejs/vite/pull/14855 is merged.
|
|
31
|
-
config.appType = 'mpa'
|
|
32
|
-
*/
|
|
33
|
-
return () => {
|
|
34
|
-
const { isPrerenderingEnabledForAllPages, isPrerenderingEnabled } = vikeConfig.prerenderContext;
|
|
35
|
-
assertDist(isPrerenderingEnabledForAllPages);
|
|
36
|
-
// We cannot re-use Vite's static middleware: https://github.com/vitejs/vite/pull/14836#issuecomment-1788540300
|
|
37
|
-
addStaticAssetsMiddleware(server.middlewares);
|
|
38
|
-
if (!isPrerenderingEnabledForAllPages) {
|
|
39
|
-
addSsrMiddleware(server.middlewares, config, true, isPrerenderingEnabled);
|
|
40
|
-
}
|
|
41
|
-
addStatic404Middleware(server.middlewares);
|
|
42
|
-
};
|
|
43
|
-
},
|
|
44
|
-
};
|
|
52
|
+
];
|
|
45
53
|
function assertDist(isPrerenderingEnabledForAllPages) {
|
|
46
54
|
const { outDirRoot, outDirClient, outDirServer } = getOutDirs(config, undefined);
|
|
47
55
|
const dirS = [outDirRoot, outDirClient];
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
export { pluginReplaceConstantsEnvVars };
|
|
2
|
+
import { loadEnv } from 'vite';
|
|
3
|
+
import { assert, assertPosixPath, assertUsage, assertWarning, escapeRegex, isArray, isNotNullish, lowerFirst, } from '../utils.js';
|
|
4
|
+
import { getModuleFilePathAbsolute } from '../shared/getFilePath.js';
|
|
5
|
+
import { normalizeId } from '../shared/normalizeId.js';
|
|
6
|
+
import { isViteServerSide_extraSafe } from '../shared/isViteServerSide.js';
|
|
7
|
+
import { getMagicString } from '../shared/getMagicString.js';
|
|
8
|
+
const PUBLIC_ENV_PREFIX = 'PUBLIC_ENV__';
|
|
9
|
+
const PUBLIC_ENV_ALLOWLIST = [
|
|
10
|
+
// https://github.com/vikejs/vike/issues/1724
|
|
11
|
+
'STORYBOOK',
|
|
12
|
+
];
|
|
13
|
+
// TO-DO/eventually:
|
|
14
|
+
// - Make import.meta.env work inside +config.js
|
|
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
|
|
16
|
+
// - Or stop using Vite's `mode` implementation and have Vike implement its own `mode` feature? (So that the only dependencies are `$ vike build --mode staging` and `$ MODE=staging vike build`.)
|
|
17
|
+
const skipNodeModules = '/node_modules/';
|
|
18
|
+
const skipIrrelevant = 'import.meta.env.';
|
|
19
|
+
const filterRolldown = {
|
|
20
|
+
id: {
|
|
21
|
+
exclude: `**${skipNodeModules}**`,
|
|
22
|
+
},
|
|
23
|
+
code: {
|
|
24
|
+
include: skipIrrelevant,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
const filterFunction = (id, code) => {
|
|
28
|
+
if (id.includes(skipNodeModules))
|
|
29
|
+
return false;
|
|
30
|
+
if (!code.includes(skipIrrelevant))
|
|
31
|
+
return false;
|
|
32
|
+
return true;
|
|
33
|
+
};
|
|
34
|
+
function pluginReplaceConstantsEnvVars() {
|
|
35
|
+
let envVarsAll;
|
|
36
|
+
let envPrefix;
|
|
37
|
+
let config;
|
|
38
|
+
return [
|
|
39
|
+
{
|
|
40
|
+
name: 'vike:pluginReplaceConstantsEnvVars',
|
|
41
|
+
enforce: 'post',
|
|
42
|
+
configResolved: {
|
|
43
|
+
handler(config_) {
|
|
44
|
+
config = config_;
|
|
45
|
+
envVarsAll = loadEnv(config.mode, config.envDir || config.root, '');
|
|
46
|
+
envPrefix = getEnvPrefix(config);
|
|
47
|
+
config.plugins.sort(lowerFirst((plugin) => (plugin.name === 'vite:define' ? 1 : 0)));
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
transform: {
|
|
51
|
+
filter: filterRolldown,
|
|
52
|
+
handler(code, id, options) {
|
|
53
|
+
id = normalizeId(id);
|
|
54
|
+
assertPosixPath(id);
|
|
55
|
+
assertPosixPath(config.root);
|
|
56
|
+
if (!id.startsWith(config.root))
|
|
57
|
+
return; // skip linked dependencies
|
|
58
|
+
assert(filterFunction(id, code));
|
|
59
|
+
const isBuild = config.command === 'build';
|
|
60
|
+
const isClientSide = !isViteServerSide_extraSafe(config, this.environment, options);
|
|
61
|
+
const { magicString, getMagicStringResult } = getMagicString(code, id);
|
|
62
|
+
// Get regex operations
|
|
63
|
+
const replacements = Object.entries(envVarsAll)
|
|
64
|
+
// Skip env vars that start with [`config.envPrefix`](https://vite.dev/config/shared-options.html#envprefix) => they are already handled by Vite
|
|
65
|
+
.filter(([envName]) => !envPrefix.some((prefix) => envName.startsWith(prefix)))
|
|
66
|
+
.map(([envName, envVal]) => {
|
|
67
|
+
const envStatement = `import.meta.env.${envName}`;
|
|
68
|
+
const envStatementRegExpStr = escapeRegex(envStatement) + '\\b';
|
|
69
|
+
// Show error (warning in dev) if client code contains a private environment variable (one that doesn't start with PUBLIC_ENV__ and that isn't included in `PUBLIC_ENV_ALLOWLIST`).
|
|
70
|
+
if (isClientSide) {
|
|
71
|
+
const skip = assertNoClientSideLeak({
|
|
72
|
+
envName,
|
|
73
|
+
envStatement,
|
|
74
|
+
envStatementRegExpStr,
|
|
75
|
+
code,
|
|
76
|
+
id,
|
|
77
|
+
config,
|
|
78
|
+
isBuild,
|
|
79
|
+
});
|
|
80
|
+
if (skip)
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
return { regExpStr: envStatementRegExpStr, replacement: envVal };
|
|
84
|
+
})
|
|
85
|
+
.filter(isNotNullish);
|
|
86
|
+
// Apply regex operations
|
|
87
|
+
replacements.forEach(({ regExpStr, replacement }) => {
|
|
88
|
+
magicString.replaceAll(new RegExp(regExpStr, 'g'), JSON.stringify(replacement));
|
|
89
|
+
});
|
|
90
|
+
return getMagicStringResult();
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
];
|
|
95
|
+
}
|
|
96
|
+
function getEnvPrefix(config) {
|
|
97
|
+
const { envPrefix } = config;
|
|
98
|
+
if (!envPrefix)
|
|
99
|
+
return [];
|
|
100
|
+
if (!isArray(envPrefix))
|
|
101
|
+
return [envPrefix];
|
|
102
|
+
return envPrefix;
|
|
103
|
+
}
|
|
104
|
+
function assertNoClientSideLeak({ envName, envStatement, envStatementRegExpStr, code, id, config, isBuild, }) {
|
|
105
|
+
const isPrivate = !envName.startsWith(PUBLIC_ENV_PREFIX) && !PUBLIC_ENV_ALLOWLIST.includes(envName);
|
|
106
|
+
// ✅ All good
|
|
107
|
+
if (!isPrivate)
|
|
108
|
+
return;
|
|
109
|
+
if (!new RegExp(envStatementRegExpStr).test(code))
|
|
110
|
+
return true;
|
|
111
|
+
// ❌ Security leak!
|
|
112
|
+
// - Warning in dev
|
|
113
|
+
// - assertUsage() and abort when building for production
|
|
114
|
+
const modulePath = getModuleFilePathAbsolute(id, config);
|
|
115
|
+
const errMsgAddendum = isBuild ? '' : ' (Vike will prevent your app from building for production)';
|
|
116
|
+
const envNameFixed = `${PUBLIC_ENV_PREFIX}${envName}`;
|
|
117
|
+
const errMsg = `${envStatement} is used in client-side file ${modulePath} which means that the environment variable ${envName} will be included in client-side bundles and, therefore, ${envName} will be publicly exposed which can be a security leak${errMsgAddendum}. Use ${envStatement} only in server-side files, or rename ${envName} to ${envNameFixed}, see https://vike.dev/env`;
|
|
118
|
+
if (isBuild) {
|
|
119
|
+
assertUsage(false, errMsg);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
// - Only a warning for faster development DX (e.g. when user toggles `ssr: boolean` or `onBeforeRenderIsomorph: boolean`).
|
|
123
|
+
// - Although only showing a warning can be confusing: https://github.com/vikejs/vike/issues/1641
|
|
124
|
+
assertWarning(false, errMsg, { onlyOnce: true });
|
|
125
|
+
}
|
|
126
|
+
assert(!isBuild); // we should abort if building for production
|
|
127
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { pluginReplaceConstantsGlobalThis };
|
|
2
|
+
import type { Plugin } from 'vite';
|
|
3
|
+
declare global {
|
|
4
|
+
/** Like `import.meta.env.DEV` but works inside `node_modules/` (even if package is `ssr.external`). The value `undefined` is to be interpreted as `false`. */
|
|
5
|
+
var __VIKE__IS_DEV: boolean | undefined;
|
|
6
|
+
/** Like `import.meta.env.SSR` but works inside `node_modules/` (even if package is `ssr.external`). The value `undefined` is to be interpreted as `false`. */
|
|
7
|
+
var __VIKE__IS_CLIENT: boolean | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Whether a debug flag is enabled (either the global flag `DEBUG=vike` or a specific flag `DEBUG=vike:some-flag`).
|
|
10
|
+
*
|
|
11
|
+
* WARNING: must be used ONLY on the client-side. (The value is always `undefined` on the server-side.)
|
|
12
|
+
*
|
|
13
|
+
* In isomorhpic code, use `globalThis.__VIKE__IS_CLIENT` to make sure it's only used on the client-side.
|
|
14
|
+
*/
|
|
15
|
+
var __VIKE__IS_DEBUG: boolean | undefined;
|
|
16
|
+
}
|
|
17
|
+
declare function pluginReplaceConstantsGlobalThis(): Plugin[];
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export { pluginReplaceConstantsGlobalThis };
|
|
2
|
+
import { assert, isDebug } from '../utils.js';
|
|
3
|
+
// === Explanation: globalThis.__VIKE__IS_DEV
|
|
4
|
+
// If client-side => always noExternal => globalThis.__VIKE__IS_DEV is set by the `define` config below.
|
|
5
|
+
// If server-side:
|
|
6
|
+
// If ssr.noExternal => globalThis.__VIKE__IS_DEV is set by the `define` config below.
|
|
7
|
+
// If `ssr.external`:
|
|
8
|
+
// If not RunnableDevEnvironment (e.g. `@cloudflare/vite-plugin`) => always ssr.noExternal => globalThis.__VIKE__IS_DEV is set by the `define` config below.
|
|
9
|
+
// If RunnableDevEnvironment (the default setup):
|
|
10
|
+
// If dev/preview/pre-rendering => Vite is loaded, and server and Vite run inside the same process (because RunnableDevEnvironment) => globalThis.__VIKE__IS_DEV is set by the assignment below.
|
|
11
|
+
// If production => Vite isn't loaded => globalThis.__VIKE__IS_DEV is `undefined` (it's never set) => value `undefined` is to be interpreted as `false`.
|
|
12
|
+
// === Explanation: globalThis.__VIKE__IS_CLIENT
|
|
13
|
+
// If client-side => always noExternal => globalThis.__VIKE__IS_CLIENT is set to `true` by the `define` config below.
|
|
14
|
+
// If server-side => globalThis.__VIKE__IS_CLIENT is either `false` or `undefined` (the value `undefined` is to be interpreted as `false`).
|
|
15
|
+
globalThis.__VIKE__IS_CLIENT = false;
|
|
16
|
+
function pluginReplaceConstantsGlobalThis() {
|
|
17
|
+
return [
|
|
18
|
+
{
|
|
19
|
+
name: 'vike:pluginReplaceConstantsGlobalThis',
|
|
20
|
+
config: {
|
|
21
|
+
handler(config) {
|
|
22
|
+
const isDev = config._isDev;
|
|
23
|
+
assert(typeof isDev === 'boolean');
|
|
24
|
+
globalThis.__VIKE__IS_DEV = isDev;
|
|
25
|
+
return {
|
|
26
|
+
define: {
|
|
27
|
+
'globalThis.__VIKE__IS_DEV': JSON.stringify(isDev),
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
configEnvironment: {
|
|
33
|
+
handler(name, config) {
|
|
34
|
+
const consumer = config.consumer ?? (name === 'client' ? 'client' : 'server');
|
|
35
|
+
const isClientSide = consumer === 'client';
|
|
36
|
+
const defineIsDebug = !isClientSide
|
|
37
|
+
? {}
|
|
38
|
+
: {
|
|
39
|
+
// We purposely only define it on the client-side, because we cannot know the value in server-side ssr.external production.
|
|
40
|
+
'globalThis.__VIKE__IS_DEBUG': JSON.stringify(isDebug()),
|
|
41
|
+
};
|
|
42
|
+
return {
|
|
43
|
+
define: {
|
|
44
|
+
'globalThis.__VIKE__IS_CLIENT': JSON.stringify(isClientSide),
|
|
45
|
+
...defineIsDebug,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export { pluginReplaceConstantsPageContext };
|
|
2
|
+
import { assert, assertPosixPath } from '../utils.js';
|
|
3
|
+
import { normalizeId } from '../shared/normalizeId.js';
|
|
4
|
+
import { isViteServerSide_extraSafe } from '../shared/isViteServerSide.js';
|
|
5
|
+
import { getMagicString } from '../shared/getMagicString.js';
|
|
6
|
+
const constantsIsClientSide = [
|
|
7
|
+
//
|
|
8
|
+
'pageContext.isClientSide',
|
|
9
|
+
'globalContext.isClientSide',
|
|
10
|
+
'pageContext.globalContext.isClientSide',
|
|
11
|
+
];
|
|
12
|
+
// - See https://vike.dev/pageContext#narrowing-down
|
|
13
|
+
// - We cannot use [`define`](https://vite.dev/config/shared-options.html#define) because of https://github.com/rolldown/rolldown/issues/4300
|
|
14
|
+
const skipNodeModules = '/node_modules/';
|
|
15
|
+
const skipIrrelevant = 'Context.isClientSide';
|
|
16
|
+
assert(constantsIsClientSide.every((constant) => constant.endsWith(skipIrrelevant)));
|
|
17
|
+
const filterRolldown = {
|
|
18
|
+
id: {
|
|
19
|
+
exclude: `**${skipNodeModules}**`,
|
|
20
|
+
},
|
|
21
|
+
code: {
|
|
22
|
+
include: skipIrrelevant,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
const filterFunction = (id, code) => {
|
|
26
|
+
if (id.includes(skipNodeModules))
|
|
27
|
+
return false;
|
|
28
|
+
if (!code.includes(skipIrrelevant))
|
|
29
|
+
return false;
|
|
30
|
+
return true;
|
|
31
|
+
};
|
|
32
|
+
function pluginReplaceConstantsPageContext() {
|
|
33
|
+
let config;
|
|
34
|
+
return [
|
|
35
|
+
{
|
|
36
|
+
name: 'vike:pluginReplaceConstantsPageContext',
|
|
37
|
+
enforce: 'post',
|
|
38
|
+
apply: 'build',
|
|
39
|
+
configResolved: {
|
|
40
|
+
handler(config_) {
|
|
41
|
+
config = config_;
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
transform: {
|
|
45
|
+
filter: filterRolldown,
|
|
46
|
+
handler(code, id, options) {
|
|
47
|
+
id = normalizeId(id);
|
|
48
|
+
assertPosixPath(id);
|
|
49
|
+
assertPosixPath(config.root);
|
|
50
|
+
if (!id.startsWith(config.root))
|
|
51
|
+
return; // skip linked dependencies
|
|
52
|
+
assert(filterFunction(id, code));
|
|
53
|
+
const isBuild = config.command === 'build';
|
|
54
|
+
assert(isBuild);
|
|
55
|
+
// Used by vike.dev
|
|
56
|
+
// https://github.com/vikejs/vike/blob/08a1ff55c80ddca64ca6d4417fefd45fefeb4ffb/docs/vite.config.ts#L12
|
|
57
|
+
// @ts-expect-error
|
|
58
|
+
if (config._skipVikeReplaceConstants?.(id))
|
|
59
|
+
return;
|
|
60
|
+
const { magicString, getMagicStringResult } = getMagicString(code, id);
|
|
61
|
+
if (constantsIsClientSide.some((c) => code.includes(c))) {
|
|
62
|
+
const replacement = !isViteServerSide_extraSafe(config, this.environment, options);
|
|
63
|
+
const regExp = getConstantRegExp(constantsIsClientSide);
|
|
64
|
+
magicString.replaceAll(regExp, JSON.stringify(replacement));
|
|
65
|
+
}
|
|
66
|
+
return getMagicStringResult();
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
|
+
// Copied & adapted from:
|
|
73
|
+
// https://github.com/rollup/plugins/blob/e1a5ef99f1578eb38a8c87563cb9651db228f3bd/packages/replace/src/index.js#L57-L67
|
|
74
|
+
function getConstantRegExp(constants) {
|
|
75
|
+
const keys = Object.values(constants).sort(longest).map(escape);
|
|
76
|
+
// const delimiters = ['\\b', '\\b(?!\\.)']
|
|
77
|
+
const delimiters = ['(?<!\\.)\\b', '\\b(?!\\.)']; // Improved version, to avoid replacing `globalContext.pageContext.isClientSide` with `globalContext.false`
|
|
78
|
+
const preventAssignment = false; // Let's try without it first, let's see if a user complains
|
|
79
|
+
const lookbehind = preventAssignment ? '(?<!\\b(?:const|let|var)\\s*)' : '';
|
|
80
|
+
const lookahead = preventAssignment ? '(?!\\s*=[^=])' : '';
|
|
81
|
+
const pattern = new RegExp(`${lookbehind}${delimiters[0]}(${keys.join('|')})${delimiters[1]}${lookahead}`, 'g');
|
|
82
|
+
return pattern;
|
|
83
|
+
}
|
|
84
|
+
function escape(str) {
|
|
85
|
+
return str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&');
|
|
86
|
+
}
|
|
87
|
+
function longest(a, b) {
|
|
88
|
+
return b.length - a.length;
|
|
89
|
+
}
|
|
@@ -20,8 +20,10 @@ function pluginSetGlobalContext() {
|
|
|
20
20
|
markSetup_viteDevServer();
|
|
21
21
|
},
|
|
22
22
|
},
|
|
23
|
-
configurePreviewServer
|
|
24
|
-
|
|
23
|
+
configurePreviewServer: {
|
|
24
|
+
handler() {
|
|
25
|
+
markSetup_vitePreviewServer();
|
|
26
|
+
},
|
|
25
27
|
},
|
|
26
28
|
config: {
|
|
27
29
|
order: 'pre',
|
|
@@ -5,7 +5,7 @@ import { getVikeConfigInternal } from '../../shared/resolveVikeConfigInternal.js
|
|
|
5
5
|
import { extractAssetsAddQuery } from '../../../shared/extractAssetsQuery.js';
|
|
6
6
|
import { debug } from './debug.js';
|
|
7
7
|
import { serializeConfigValues } from '../../../../shared/page-configs/serialize/serializeConfigValues.js';
|
|
8
|
-
import { handleAssetsManifest_isFixEnabled } from '../
|
|
8
|
+
import { handleAssetsManifest_isFixEnabled } from '../build/handleAssetsManifest.js';
|
|
9
9
|
import { getConfigValueBuildTime } from '../../../../shared/page-configs/getConfigValueBuildTime.js';
|
|
10
10
|
import { resolveIncludeAssetsImportedByServer } from '../../../runtime/renderPage/getPageAssets/retrievePageAssetsProd.js';
|
|
11
11
|
async function generateVirtualFilePageEntry(id, isDev) {
|