vike 0.4.231-commit-e1c3295 → 0.4.232-commit-134207d
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/README.md +4 -2
- package/dist/cjs/__internal/index.js +2 -2
- package/dist/cjs/client/runtime-client-routing/globalContext.js +1 -1
- package/dist/cjs/client/shared/createGetGlobalContextClient.js +2 -2
- package/dist/cjs/client/shared/preparePageContextForPublicUsageClientShared.js +2 -2
- package/dist/cjs/node/api/build.js +6 -2
- package/dist/cjs/node/api/dev.js +1 -1
- package/dist/cjs/node/api/prepareViteApiCall.js +8 -8
- package/dist/cjs/node/api/prerender.js +1 -1
- package/dist/cjs/node/api/preview.js +2 -2
- package/dist/cjs/node/cli/entry.js +1 -1
- package/dist/cjs/node/cli/parseCli.js +2 -2
- package/dist/cjs/node/client/router.js +1 -1
- package/dist/cjs/node/createPageRenderer.js +1 -1
- package/dist/cjs/node/prerender/context.js +1 -1
- package/dist/cjs/node/prerender/resolvePrerenderConfig.js +3 -2
- package/dist/cjs/node/prerender/runPrerender.js +91 -46
- package/dist/cjs/node/prerender/runPrerenderEntry.js +1 -1
- package/dist/cjs/node/prerender/utils.js +1 -0
- package/dist/cjs/node/runtime/globalContext.js +22 -15
- package/dist/cjs/node/runtime/html/injectAssets/getHtmlTags.js +7 -7
- package/dist/cjs/node/runtime/html/injectAssets/getViteDevScript.js +1 -1
- package/dist/cjs/node/runtime/html/injectAssets/inferHtmlTags.js +1 -1
- package/dist/cjs/node/runtime/html/injectAssets/injectAssets__public.js +5 -5
- package/dist/cjs/node/runtime/html/injectAssets/injectHtmlTags.js +3 -3
- package/dist/cjs/node/runtime/html/injectAssets.js +1 -1
- package/dist/cjs/node/runtime/html/renderHtml.js +8 -8
- package/dist/cjs/node/runtime/html/serializeContext.js +5 -5
- package/dist/cjs/node/runtime/html/stream.js +19 -19
- package/dist/cjs/node/runtime/index-deprecated.js +2 -2
- package/dist/cjs/node/runtime/index.js +1 -1
- package/dist/cjs/node/runtime/renderPage/analyzePage.js +4 -4
- package/dist/cjs/node/runtime/renderPage/assertArguments.js +1 -1
- package/dist/cjs/node/runtime/renderPage/createHttpResponse/assertNoInfiniteHttpRedirect.js +1 -1
- package/dist/cjs/node/runtime/renderPage/createHttpResponse.js +5 -6
- package/dist/cjs/node/runtime/renderPage/createPageContextServerSide.js +4 -4
- package/dist/cjs/node/runtime/renderPage/debugPageFiles.js +1 -1
- package/dist/cjs/node/runtime/renderPage/execHookServer.js +1 -4
- package/dist/cjs/node/runtime/renderPage/executeOnBeforeRenderAndDataHooks.js +1 -1
- package/dist/cjs/node/runtime/renderPage/executeOnRenderHtmlHook.js +3 -3
- package/dist/cjs/node/runtime/renderPage/getEarlyHints.js +1 -1
- package/dist/cjs/node/runtime/renderPage/getHttpResponseBody.js +1 -1
- package/dist/cjs/node/runtime/renderPage/getPageAssets/getManifestEntry.js +1 -1
- package/dist/cjs/node/runtime/renderPage/getPageAssets/retrieveAssetsProd.js +1 -1
- package/dist/cjs/node/runtime/renderPage/getPageAssets.js +2 -2
- package/dist/cjs/node/runtime/renderPage/handleErrorWithoutErrorPage.js +1 -1
- package/dist/cjs/node/runtime/renderPage/handlePageContextRequestUrl.js +1 -1
- package/dist/cjs/node/runtime/renderPage/isFontFallback.js +3 -3
- package/dist/cjs/node/runtime/renderPage/isNewError.js +2 -1
- package/dist/cjs/node/runtime/renderPage/loadPageConfigsLazyServerSide.js +10 -10
- package/dist/cjs/node/runtime/renderPage/log404/index.js +4 -8
- package/dist/cjs/node/runtime/renderPage/logErrorHint/errors.js +2 -2
- package/dist/cjs/node/runtime/renderPage/logErrorHint.js +18 -18
- package/dist/cjs/node/runtime/renderPage/loggerProd.js +3 -3
- package/dist/cjs/node/runtime/renderPage/renderPageAlreadyRouted.js +1 -1
- package/dist/cjs/node/runtime/renderPage/resolveRedirects.js +22 -4
- package/dist/cjs/node/runtime/renderPage.js +17 -34
- package/dist/cjs/node/runtime/universal-middleware.js +2 -2
- package/dist/cjs/node/runtime/utils.js +1 -1
- package/dist/cjs/node/runtime-dev/createDevMiddleware.js +3 -3
- package/dist/cjs/node/shared/extractAssetsQuery.js +1 -1
- package/dist/cjs/node/shared/getVikeConfigError.js +22 -0
- package/dist/cjs/node/shared/resolveBase.js +1 -1
- package/dist/cjs/node/shared/utils.js +1 -0
- package/dist/cjs/node/shared/virtualFiles/virtualFilePageConfigLazy.js +2 -2
- package/dist/cjs/node/vite/index.js +2 -2
- package/dist/cjs/node/vite/plugins/pluginBaseUrls.js +3 -3
- package/dist/cjs/node/vite/plugins/pluginBuild/handleAssetsManifest.js +30 -28
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginAutoFullBuild.js +10 -10
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginBuildApp.js +10 -10
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginBuildConfig.js +10 -10
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginBuildEntry.js +12 -13
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginDistFileNames.js +14 -12
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginDistPackageJsonFile.js +2 -2
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginModuleBanner.js +3 -3
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginSuppressRollupWarning.js +3 -3
- package/dist/cjs/node/vite/plugins/pluginBuild.js +1 -1
- package/dist/cjs/node/vite/plugins/pluginCommon/assertResolveAlias.js +2 -2
- package/dist/cjs/node/vite/plugins/pluginCommon.js +14 -14
- package/dist/cjs/node/vite/plugins/pluginDev/determineFsAllowList.js +2 -2
- package/dist/cjs/node/vite/plugins/pluginDev/determineOptimizeDeps.js +2 -2
- package/dist/cjs/node/vite/plugins/pluginDev.js +8 -8
- package/dist/cjs/node/vite/plugins/pluginEnvVars.js +4 -4
- package/dist/cjs/node/vite/plugins/pluginExtractAssets.js +6 -6
- package/dist/cjs/node/vite/plugins/pluginExtractExportNames.js +2 -2
- package/dist/cjs/node/vite/plugins/pluginFileEnv.js +3 -3
- package/dist/cjs/node/vite/plugins/pluginPreview.js +9 -9
- package/dist/cjs/node/vite/plugins/pluginReplaceConstants.js +3 -3
- package/dist/cjs/node/vite/plugins/pluginSetGlobalContext.js +6 -6
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/getVirtualFileEntry.js +10 -10
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/getVirtualFilePageConfigLazy.js +11 -1
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles.js +3 -3
- package/dist/cjs/node/vite/plugins/pluginWorkaroundCssModuleHmr.js +1 -1
- package/dist/cjs/node/vite/plugins/pluginWorkaroundVite6HmrRegression.js +2 -2
- package/dist/cjs/node/vite/shared/addSsrMiddleware.js +3 -3
- package/dist/cjs/node/vite/shared/findPageFiles.js +1 -1
- package/dist/cjs/node/vite/shared/getFilePath.js +24 -24
- package/dist/cjs/node/vite/shared/getHttpRequestAsyncStore.js +4 -4
- package/dist/cjs/node/vite/shared/getOutDirs.js +2 -2
- package/dist/cjs/node/vite/shared/getViteConfigRuntime.js +3 -3
- package/dist/cjs/node/vite/shared/isAsset.js +1 -1
- package/dist/cjs/node/vite/shared/isViteCliCall.js +1 -1
- package/dist/cjs/node/vite/shared/isViteServerBuild.js +2 -2
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errBabelReact.js +1 -1
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errBabelSolid.js +1 -1
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errEsbuild.js +5 -5
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errMdx1.js +3 -3
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errMdx2.js +10 -10
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errPostcss.js +2 -2
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errSwc.js +2 -2
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errSwcBig.js +2 -2
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueCss.js +2 -2
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueHtml.js +1 -1
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueJavascript.js +1 -1
- package/dist/cjs/node/vite/shared/loggerNotProd/errorWithCodeSnippet.js +3 -3
- package/dist/cjs/node/vite/shared/loggerNotProd.js +1 -1
- package/dist/cjs/node/vite/shared/resolveClientEntriesDev.js +2 -2
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/assertExtensions.js +2 -2
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/configDefinitionsBuiltIn.js +50 -50
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/crawlPlusFiles/ignorePatternsBuiltIn.js +1 -1
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/crawlPlusFiles.js +13 -13
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/filesystemRouting.js +14 -5
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/getPlusFilesAll.js +4 -4
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/loadFileAtConfigTime.js +1 -1
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/pointerImports.js +5 -5
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/resolvePointerImport.js +5 -5
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/transpileAndExecuteFile.js +25 -25
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal.js +46 -46
- package/dist/cjs/node/vite/utils.js +2 -7
- package/dist/cjs/shared/assertHookReturnedObject.js +1 -1
- package/dist/cjs/shared/assertPageContextProvidedByUser.js +2 -2
- package/dist/cjs/shared/createGlobalContextShared.js +26 -18
- package/dist/cjs/shared/createPageContextShared.js +1 -1
- package/dist/cjs/shared/getPageContextRequestUrl.js +1 -1
- package/dist/cjs/shared/getPageContextUrlComputed.js +5 -5
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/analyzeExports.js +3 -3
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide/determineClientEntry.js +1 -1
- package/dist/cjs/shared/getPageFiles/analyzePageClientSide.js +3 -3
- package/dist/cjs/shared/getPageFiles/fileTypes.js +1 -1
- package/dist/cjs/shared/getPageFiles/getAllPageIdFiles.js +2 -2
- package/dist/cjs/shared/getPageFiles/getPageFileObject.js +1 -1
- package/dist/cjs/shared/getProxyForPublicUsage.js +2 -2
- package/dist/cjs/shared/hooks/execHook.js +2 -2
- package/dist/cjs/shared/hooks/getHook.js +4 -4
- package/dist/cjs/shared/modifyUrl.js +1 -1
- package/dist/cjs/shared/page-configs/assertPlusFileExport.js +2 -2
- package/dist/cjs/shared/page-configs/getConfigValueBuildTime.js +4 -4
- package/dist/cjs/shared/page-configs/resolveVikeConfigPublic.js +21 -21
- package/dist/cjs/shared/page-configs/serialize/parsePageConfigs.js +3 -3
- package/dist/cjs/shared/page-configs/serialize/serializeConfigValues.js +9 -9
- package/dist/cjs/shared/preparePageContextForPublicUsage.js +3 -3
- package/dist/cjs/shared/route/abort.js +7 -7
- package/dist/cjs/shared/route/debug.js +1 -1
- package/dist/cjs/shared/route/deduceRouteStringFromFilesystemPath.js +1 -1
- package/dist/cjs/shared/route/executeOnBeforeRouteHook.js +3 -3
- package/dist/cjs/shared/route/index.js +5 -5
- package/dist/cjs/shared/route/loadPageRoutes.js +8 -8
- package/dist/cjs/shared/route/resolvePrecedence.js +2 -2
- package/dist/cjs/shared/route/resolveRoute.js +1 -1
- package/dist/cjs/shared/route/resolveRouteFunction.js +2 -2
- package/dist/cjs/shared/utils.js +1 -0
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/assert.js +9 -9
- package/dist/cjs/utils/assertKeys.js +1 -1
- package/dist/cjs/utils/assertSetup.js +1 -1
- package/dist/cjs/utils/assertSingleInstance.js +5 -5
- package/dist/cjs/utils/catchInfiniteLoop.js +1 -1
- package/dist/cjs/utils/debug.js +1 -1
- package/dist/cjs/utils/findFile.js +5 -5
- package/dist/cjs/utils/findPackageJson.js +3 -3
- package/dist/cjs/utils/formatHintLog.js +1 -1
- package/dist/cjs/utils/freezePartial.js +1 -1
- package/dist/cjs/utils/genPromise.js +2 -2
- package/dist/cjs/utils/getMostSimilar.js +1 -1
- package/dist/cjs/utils/injectRollupInputs.js +2 -2
- package/dist/cjs/utils/isFilePathAbsoluteFilesystem.js +1 -1
- package/dist/cjs/utils/objectAssignSafe.js +1 -1
- package/dist/cjs/utils/pLimit.js +4 -4
- package/dist/cjs/utils/parseNpmPackage.js +2 -2
- package/dist/cjs/utils/parseUrl.js +3 -3
- package/dist/cjs/utils/path.js +1 -1
- package/dist/cjs/utils/preservePropertyGetters.js +1 -1
- package/dist/cjs/utils/{removeFileExtention.js → removeFileExtension.js} +2 -2
- package/dist/cjs/utils/requireResolve.js +10 -10
- package/dist/cjs/utils/rollupSourceMap.js +2 -2
- package/dist/cjs/utils/stripAnsi.js +1 -1
- package/dist/cjs/utils/styleFileRE.js +1 -0
- package/dist/cjs/utils/trimWithAnsi.js +1 -1
- package/dist/esm/__internal/index.js +2 -2
- package/dist/esm/client/index.d.ts +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/client/node.js +1 -1
- package/dist/esm/client/runtime-client-routing/createPageContextClientSide.js +1 -1
- package/dist/esm/client/runtime-client-routing/getPageContext/removeBuiltInOverrides.js +1 -1
- package/dist/esm/client/runtime-client-routing/getPageContextCurrent.js +1 -1
- package/dist/esm/client/runtime-client-routing/getPageContextFromHooks.d.ts +2 -3
- package/dist/esm/client/runtime-client-routing/getPageContextFromHooks.js +5 -5
- package/dist/esm/client/runtime-client-routing/globalContext.js +1 -1
- package/dist/esm/client/runtime-client-routing/history.js +6 -6
- package/dist/esm/client/runtime-client-routing/initClientRouter.js +1 -1
- package/dist/esm/client/runtime-client-routing/initOnLinkClick.js +1 -1
- package/dist/esm/client/runtime-client-routing/initOnPopState.js +1 -1
- package/dist/esm/client/runtime-client-routing/isClientSideRoutable.js +1 -1
- package/dist/esm/client/runtime-client-routing/navigate.js +1 -1
- package/dist/esm/client/runtime-client-routing/prefetch/getPrefetchSettings.js +2 -2
- package/dist/esm/client/runtime-client-routing/prefetch.js +10 -10
- package/dist/esm/client/runtime-client-routing/renderPageClientSide.d.ts +1 -1
- package/dist/esm/client/runtime-client-routing/renderPageClientSide.js +20 -20
- package/dist/esm/client/runtime-client-routing/setScrollPosition.js +1 -1
- package/dist/esm/client/runtime-server-routing/createPageContextClientSide.js +1 -1
- package/dist/esm/client/shared/createGetGlobalContextClient.js +3 -3
- package/dist/esm/client/shared/loadPageConfigsLazyClientSide.js +1 -1
- package/dist/esm/client/shared/preparePageContextForPublicUsageClientShared.js +3 -3
- package/dist/esm/node/api/build.js +6 -2
- package/dist/esm/node/api/dev.js +1 -1
- package/dist/esm/node/api/prepareViteApiCall.js +8 -8
- package/dist/esm/node/api/prerender.js +1 -1
- package/dist/esm/node/api/preview.js +2 -2
- package/dist/esm/node/cli/entry.js +1 -1
- package/dist/esm/node/cli/parseCli.js +2 -2
- package/dist/esm/node/client/router.js +1 -1
- package/dist/esm/node/createPageRenderer.js +1 -1
- package/dist/esm/node/prerender/context.d.ts +1 -1
- package/dist/esm/node/prerender/context.js +1 -1
- package/dist/esm/node/prerender/resolvePrerenderConfig.d.ts +1 -0
- package/dist/esm/node/prerender/resolvePrerenderConfig.js +3 -2
- package/dist/esm/node/prerender/runPrerender.d.ts +9 -6
- package/dist/esm/node/prerender/runPrerender.js +90 -45
- package/dist/esm/node/prerender/runPrerenderEntry.js +1 -1
- package/dist/esm/node/prerender/utils.d.ts +1 -0
- package/dist/esm/node/prerender/utils.js +1 -0
- package/dist/esm/node/runtime/globalContext.js +25 -18
- package/dist/esm/node/runtime/html/injectAssets/getHtmlTags.js +8 -8
- package/dist/esm/node/runtime/html/injectAssets/getViteDevScript.js +1 -1
- package/dist/esm/node/runtime/html/injectAssets/inferHtmlTags.js +1 -1
- package/dist/esm/node/runtime/html/injectAssets/injectAssets__public.js +5 -5
- package/dist/esm/node/runtime/html/injectAssets/injectHtmlTags.js +3 -3
- package/dist/esm/node/runtime/html/injectAssets.js +2 -2
- package/dist/esm/node/runtime/html/renderHtml.js +10 -10
- package/dist/esm/node/runtime/html/serializeContext.js +5 -5
- package/dist/esm/node/runtime/html/stream.d.ts +1 -1
- package/dist/esm/node/runtime/html/stream.js +21 -21
- package/dist/esm/node/runtime/index-deprecated.js +2 -2
- package/dist/esm/node/runtime/index.js +1 -1
- package/dist/esm/node/runtime/renderPage/analyzePage.js +4 -4
- package/dist/esm/node/runtime/renderPage/assertArguments.js +1 -1
- package/dist/esm/node/runtime/renderPage/createHttpResponse/assertNoInfiniteHttpRedirect.js +1 -1
- package/dist/esm/node/runtime/renderPage/createHttpResponse.js +5 -6
- package/dist/esm/node/runtime/renderPage/createPageContextServerSide.d.ts +1 -1
- package/dist/esm/node/runtime/renderPage/createPageContextServerSide.js +4 -4
- package/dist/esm/node/runtime/renderPage/debugPageFiles.d.ts +1 -1
- package/dist/esm/node/runtime/renderPage/debugPageFiles.js +1 -1
- package/dist/esm/node/runtime/renderPage/execHookServer.js +2 -5
- package/dist/esm/node/runtime/renderPage/executeOnBeforeRenderAndDataHooks.js +1 -1
- package/dist/esm/node/runtime/renderPage/executeOnRenderHtmlHook.js +5 -5
- package/dist/esm/node/runtime/renderPage/getEarlyHints.js +1 -1
- package/dist/esm/node/runtime/renderPage/getHttpResponseBody.js +2 -2
- package/dist/esm/node/runtime/renderPage/getPageAssets/getManifestEntry.js +1 -1
- package/dist/esm/node/runtime/renderPage/getPageAssets/retrieveAssetsProd.js +1 -1
- package/dist/esm/node/runtime/renderPage/getPageAssets.js +2 -2
- package/dist/esm/node/runtime/renderPage/handleErrorWithoutErrorPage.js +1 -1
- package/dist/esm/node/runtime/renderPage/handlePageContextRequestUrl.js +1 -1
- package/dist/esm/node/runtime/renderPage/isFontFallback.js +3 -3
- package/dist/esm/node/runtime/renderPage/isNewError.d.ts +2 -0
- package/dist/esm/node/runtime/renderPage/isNewError.js +2 -1
- package/dist/esm/node/runtime/renderPage/loadPageConfigsLazyServerSide.js +11 -11
- package/dist/esm/node/runtime/renderPage/log404/index.js +5 -9
- package/dist/esm/node/runtime/renderPage/logErrorHint/errors.d.ts +1 -1
- package/dist/esm/node/runtime/renderPage/logErrorHint/errors.js +1 -1
- package/dist/esm/node/runtime/renderPage/logErrorHint.js +18 -18
- package/dist/esm/node/runtime/renderPage/loggerProd.d.ts +1 -1
- package/dist/esm/node/runtime/renderPage/loggerProd.js +3 -3
- package/dist/esm/node/runtime/renderPage/preparePageContextForPublicUsageServer.js +1 -1
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.js +2 -2
- package/dist/esm/node/runtime/renderPage/resolveRedirects.d.ts +2 -0
- package/dist/esm/node/runtime/renderPage/resolveRedirects.js +24 -6
- package/dist/esm/node/runtime/renderPage.d.ts +0 -11
- package/dist/esm/node/runtime/renderPage.js +20 -37
- package/dist/esm/node/runtime/universal-middleware.js +2 -2
- package/dist/esm/node/runtime/utils.d.ts +1 -1
- package/dist/esm/node/runtime/utils.js +1 -1
- package/dist/esm/node/runtime-dev/createDevMiddleware.js +3 -3
- package/dist/esm/node/shared/extractAssetsQuery.js +1 -1
- package/dist/esm/node/shared/getVikeConfigError.d.ts +13 -0
- package/dist/esm/node/shared/getVikeConfigError.js +20 -0
- package/dist/esm/node/shared/resolveBase.js +1 -1
- package/dist/esm/node/shared/utils.d.ts +1 -0
- package/dist/esm/node/shared/utils.js +1 -0
- package/dist/esm/node/shared/virtualFiles/virtualFilePageConfigLazy.js +2 -2
- package/dist/esm/node/vite/index.js +2 -2
- package/dist/esm/node/vite/plugins/pluginBaseUrls.js +3 -3
- package/dist/esm/node/vite/plugins/pluginBuild/handleAssetsManifest.d.ts +3 -2
- package/dist/esm/node/vite/plugins/pluginBuild/handleAssetsManifest.js +14 -12
- package/dist/esm/node/vite/plugins/pluginBuild/pluginAutoFullBuild.js +10 -10
- package/dist/esm/node/vite/plugins/pluginBuild/pluginBuildApp.js +10 -10
- package/dist/esm/node/vite/plugins/pluginBuild/pluginBuildConfig.js +12 -12
- package/dist/esm/node/vite/plugins/pluginBuild/pluginBuildEntry.d.ts +1 -2
- package/dist/esm/node/vite/plugins/pluginBuild/pluginBuildEntry.js +11 -12
- package/dist/esm/node/vite/plugins/pluginBuild/pluginDistFileNames.js +11 -9
- package/dist/esm/node/vite/plugins/pluginBuild/pluginDistPackageJsonFile.js +2 -2
- package/dist/esm/node/vite/plugins/pluginBuild/pluginModuleBanner.js +3 -3
- package/dist/esm/node/vite/plugins/pluginBuild/pluginSuppressRollupWarning.js +3 -3
- package/dist/esm/node/vite/plugins/pluginBuild.js +1 -1
- package/dist/esm/node/vite/plugins/pluginCommon/assertResolveAlias.js +2 -2
- package/dist/esm/node/vite/plugins/pluginCommon.js +14 -14
- package/dist/esm/node/vite/plugins/pluginDev/determineFsAllowList.js +1 -1
- package/dist/esm/node/vite/plugins/pluginDev/determineOptimizeDeps.js +5 -5
- package/dist/esm/node/vite/plugins/pluginDev.js +8 -8
- package/dist/esm/node/vite/plugins/pluginEnvVars.js +5 -5
- package/dist/esm/node/vite/plugins/pluginExtractAssets.js +8 -8
- package/dist/esm/node/vite/plugins/pluginExtractExportNames.js +3 -3
- package/dist/esm/node/vite/plugins/pluginFileEnv.js +4 -4
- package/dist/esm/node/vite/plugins/pluginPreview.js +5 -5
- package/dist/esm/node/vite/plugins/pluginReplaceConstants.js +3 -3
- package/dist/esm/node/vite/plugins/pluginSetGlobalContext.js +7 -7
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/getVirtualFileEntry.js +11 -11
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/getVirtualFilePageConfigLazy.js +13 -3
- package/dist/esm/node/vite/plugins/pluginVirtualFiles.js +3 -3
- package/dist/esm/node/vite/plugins/pluginWorkaroundCssModuleHmr.js +1 -1
- package/dist/esm/node/vite/plugins/pluginWorkaroundVite6HmrRegression.js +2 -2
- package/dist/esm/node/vite/shared/addSsrMiddleware.js +3 -3
- package/dist/esm/node/vite/shared/findPageFiles.js +1 -1
- package/dist/esm/node/vite/shared/getFilePath.d.ts +5 -5
- package/dist/esm/node/vite/shared/getFilePath.js +22 -22
- package/dist/esm/node/vite/shared/getHttpRequestAsyncStore.js +4 -4
- package/dist/esm/node/vite/shared/getOutDirs.js +2 -2
- package/dist/esm/node/vite/shared/getViteConfigRuntime.js +3 -3
- package/dist/esm/node/vite/shared/isAsset.js +1 -1
- package/dist/esm/node/vite/shared/isViteCliCall.js +1 -1
- package/dist/esm/node/vite/shared/isViteServerBuild.js +2 -2
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errBabelReact.js +1 -1
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errBabelSolid.js +1 -1
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errEsbuild.js +5 -5
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errMdx1.js +3 -3
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errMdx2.js +10 -10
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errPostcss.js +2 -2
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errSwc.js +2 -2
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errSwcBig.js +2 -2
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueCss.js +2 -2
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueHtml.js +1 -1
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet/fixture-errors/errVueJavascript.js +1 -1
- package/dist/esm/node/vite/shared/loggerNotProd/errorWithCodeSnippet.js +4 -4
- package/dist/esm/node/vite/shared/loggerNotProd.js +3 -3
- package/dist/esm/node/vite/shared/resolveClientEntriesDev.js +3 -3
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/assertExtensions.js +1 -1
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/configDefinitionsBuiltIn.js +50 -50
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/crawlPlusFiles/ignorePatternsBuiltIn.js +1 -1
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/crawlPlusFiles.js +10 -10
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/filesystemRouting.js +14 -5
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/getPlusFilesAll.js +4 -4
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/loadFileAtConfigTime.js +1 -1
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/pointerImports.js +5 -5
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/resolvePointerImport.js +6 -6
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/transpileAndExecuteFile.js +14 -14
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal.d.ts +2 -2
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal.js +52 -52
- package/dist/esm/node/vite/utils.d.ts +0 -6
- package/dist/esm/node/vite/utils.js +2 -7
- package/dist/esm/shared/assertHookReturnedObject.js +1 -1
- package/dist/esm/shared/assertPageContextProvidedByUser.d.ts +1 -1
- package/dist/esm/shared/assertPageContextProvidedByUser.js +2 -2
- package/dist/esm/shared/createGlobalContextShared.d.ts +2 -0
- package/dist/esm/shared/createGlobalContextShared.js +28 -20
- package/dist/esm/shared/createPageContextShared.js +1 -1
- package/dist/esm/shared/getPageContextRequestUrl.js +1 -1
- package/dist/esm/shared/getPageContextUrlComputed.js +5 -5
- package/dist/esm/shared/getPageFiles/analyzePageClientSide/analyzeExports.d.ts +1 -1
- package/dist/esm/shared/getPageFiles/analyzePageClientSide/analyzeExports.js +3 -3
- package/dist/esm/shared/getPageFiles/analyzePageClientSide/determineClientEntry.d.ts +1 -1
- package/dist/esm/shared/getPageFiles/analyzePageClientSide/determineClientEntry.js +1 -1
- package/dist/esm/shared/getPageFiles/analyzePageClientSide.js +3 -3
- package/dist/esm/shared/getPageFiles/fileTypes.js +1 -1
- package/dist/esm/shared/getPageFiles/getAllPageIdFiles.js +2 -2
- package/dist/esm/shared/getPageFiles/getPageFileObject.js +1 -1
- package/dist/esm/shared/getProxyForPublicUsage.js +2 -2
- package/dist/esm/shared/hooks/execHook.js +3 -3
- package/dist/esm/shared/hooks/getHook.js +4 -4
- package/dist/esm/shared/modifyUrl.js +1 -1
- package/dist/esm/shared/modifyUrlSameOrigin.js +1 -1
- package/dist/esm/shared/page-configs/assertPlusFileExport.js +2 -2
- package/dist/esm/shared/page-configs/getConfigValueBuildTime.js +4 -4
- package/dist/esm/shared/page-configs/resolveVikeConfigPublic.d.ts +2 -2
- package/dist/esm/shared/page-configs/resolveVikeConfigPublic.js +22 -22
- package/dist/esm/shared/page-configs/serialize/parsePageConfigs.js +3 -3
- package/dist/esm/shared/page-configs/serialize/serializeConfigValues.js +11 -11
- package/dist/esm/shared/preparePageContextForPublicUsage.js +4 -4
- package/dist/esm/shared/route/abort.js +8 -8
- package/dist/esm/shared/route/debug.js +1 -1
- package/dist/esm/shared/route/deduceRouteStringFromFilesystemPath.js +1 -1
- package/dist/esm/shared/route/executeOnBeforeRouteHook.js +5 -5
- package/dist/esm/shared/route/index.js +6 -6
- package/dist/esm/shared/route/loadPageRoutes.js +8 -8
- package/dist/esm/shared/route/resolvePrecedence.d.ts +2 -2
- package/dist/esm/shared/route/resolvePrecedence.js +2 -2
- package/dist/esm/shared/route/resolveRoute.js +1 -1
- package/dist/esm/shared/route/resolveRouteFunction.js +2 -2
- package/dist/esm/shared/utils.d.ts +1 -0
- package/dist/esm/shared/utils.js +1 -0
- package/dist/esm/types/Config.d.ts +6 -0
- package/dist/esm/types/FilePath.d.ts +1 -1
- package/dist/esm/types/PageConfig.d.ts +1 -1
- package/dist/esm/types/PageContext.d.ts +2 -2
- package/dist/esm/types/index-dreprecated.d.ts +1 -1
- package/dist/esm/types/index.d.ts +3 -3
- 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 +9 -9
- package/dist/esm/utils/assertKeys.js +1 -1
- package/dist/esm/utils/assertSetup.js +1 -1
- package/dist/esm/utils/assertSingleInstance.js +5 -5
- package/dist/esm/utils/catchInfiniteLoop.js +1 -1
- package/dist/esm/utils/debug.js +1 -1
- package/dist/esm/utils/findFile.js +2 -2
- package/dist/esm/utils/findPackageJson.js +2 -2
- package/dist/esm/utils/formatHintLog.js +1 -1
- package/dist/esm/utils/freezePartial.js +1 -1
- package/dist/esm/utils/genPromise.d.ts +1 -1
- package/dist/esm/utils/genPromise.js +2 -2
- package/dist/esm/utils/getMostSimilar.js +1 -1
- package/dist/esm/utils/injectRollupInputs.js +2 -2
- package/dist/esm/utils/isFilePathAbsoluteFilesystem.js +1 -1
- package/dist/esm/utils/objectAssignSafe.js +1 -1
- package/dist/esm/utils/pLimit.js +4 -4
- package/dist/esm/utils/parseNpmPackage.js +2 -2
- package/dist/esm/utils/parseUrl.js +3 -3
- package/dist/esm/utils/path.js +1 -1
- package/dist/esm/utils/preservePropertyGetters.js +1 -1
- package/dist/esm/utils/removeFileExtension.d.ts +1 -0
- package/dist/esm/utils/{removeFileExtention.js → removeFileExtension.js} +1 -1
- package/dist/esm/utils/requireResolve.d.ts +3 -3
- package/dist/esm/utils/requireResolve.js +10 -10
- package/dist/esm/utils/rollupSourceMap.js +2 -2
- package/dist/esm/utils/stripAnsi.js +1 -1
- package/dist/esm/utils/styleFileRE.js +1 -0
- package/dist/esm/utils/trimWithAnsi.js +1 -1
- package/package.json +2 -2
- package/dist/esm/utils/removeFileExtention.d.ts +0 -1
|
@@ -15,7 +15,7 @@ function pluginBuildApp() {
|
|
|
15
15
|
return;
|
|
16
16
|
return {
|
|
17
17
|
builder: {
|
|
18
|
-
// Can be
|
|
18
|
+
// Can be overridden by another plugin e.g vike-vercel https://github.com/vikejs/vike/pull/2184#issuecomment-2659425195
|
|
19
19
|
async buildApp(builder) {
|
|
20
20
|
assert(builder.environments.client);
|
|
21
21
|
assert(builder.environments.ssr);
|
|
@@ -25,26 +25,26 @@ function pluginBuildApp() {
|
|
|
25
25
|
runPrerender_forceExit();
|
|
26
26
|
assert(false);
|
|
27
27
|
}
|
|
28
|
-
}
|
|
28
|
+
},
|
|
29
29
|
},
|
|
30
30
|
environments: {
|
|
31
31
|
ssr: {
|
|
32
32
|
consumer: 'server',
|
|
33
33
|
build: {
|
|
34
34
|
outDir: resolveOutDir(config, true),
|
|
35
|
-
ssr: true
|
|
36
|
-
}
|
|
35
|
+
ssr: true,
|
|
36
|
+
},
|
|
37
37
|
},
|
|
38
38
|
client: {
|
|
39
39
|
consumer: 'client',
|
|
40
40
|
build: {
|
|
41
41
|
copyPublicDir: true,
|
|
42
|
-
ssr: false
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
42
|
+
ssr: false,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
46
|
};
|
|
47
|
-
}
|
|
48
|
-
}
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
49
|
];
|
|
50
50
|
}
|
|
@@ -2,7 +2,7 @@ export { pluginBuildConfig };
|
|
|
2
2
|
export { assertRollupInput };
|
|
3
3
|
export { analyzeClientEntries };
|
|
4
4
|
export { manifestTempFile };
|
|
5
|
-
import { assert, addOnBeforeLogHook,
|
|
5
|
+
import { assert, addOnBeforeLogHook, removeFileExtension, unique, assertUsage, injectRollupInputs, normalizeRollupInput, onSetupBuild, assertIsImportPathNpmPackage, requireResolveVikeDistFile, } from '../../utils.js';
|
|
6
6
|
import { getVikeConfigInternal } from '../../shared/resolveVikeConfigInternal.js';
|
|
7
7
|
import { findPageFiles } from '../../shared/findPageFiles.js';
|
|
8
8
|
import { getVirtualFileIdPageConfigLazy } from '../../../shared/virtualFiles/virtualFilePageConfigLazy.js';
|
|
@@ -12,7 +12,7 @@ import { getFilePathResolved } from '../../shared/getFilePath.js';
|
|
|
12
12
|
import { getConfigValueBuildTime } from '../../../../shared/page-configs/getConfigValueBuildTime.js';
|
|
13
13
|
import { isViteServerBuild } from '../../shared/isViteServerBuild.js';
|
|
14
14
|
import { resolveOutDir } from '../../shared/getOutDirs.js';
|
|
15
|
-
import { handleAssetsManifest_assertUsageCssCodeSplit, handleAssetsManifest_getBuildConfig } from './handleAssetsManifest.js';
|
|
15
|
+
import { handleAssetsManifest_assertUsageCssCodeSplit, handleAssetsManifest_getBuildConfig, } from './handleAssetsManifest.js';
|
|
16
16
|
import { resolveIncludeAssetsImportedByServer } from '../../../runtime/renderPage/getPageAssets.js';
|
|
17
17
|
const manifestTempFile = '_temp_manifest.json';
|
|
18
18
|
function pluginBuildConfig() {
|
|
@@ -33,7 +33,7 @@ function pluginBuildConfig() {
|
|
|
33
33
|
config.build.rollupOptions.input = injectRollupInputs(entries, config);
|
|
34
34
|
addLogHook();
|
|
35
35
|
handleAssetsManifest_assertUsageCssCodeSplit(config);
|
|
36
|
-
}
|
|
36
|
+
},
|
|
37
37
|
},
|
|
38
38
|
config: {
|
|
39
39
|
order: 'post',
|
|
@@ -42,15 +42,15 @@ function pluginBuildConfig() {
|
|
|
42
42
|
return {
|
|
43
43
|
build: {
|
|
44
44
|
outDir: resolveOutDir(config),
|
|
45
|
-
...(await handleAssetsManifest_getBuildConfig(config))
|
|
46
|
-
}
|
|
45
|
+
...(await handleAssetsManifest_getBuildConfig(config)),
|
|
46
|
+
},
|
|
47
47
|
};
|
|
48
|
-
}
|
|
48
|
+
},
|
|
49
49
|
},
|
|
50
50
|
buildStart() {
|
|
51
51
|
onSetupBuild();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
54
|
];
|
|
55
55
|
}
|
|
56
56
|
async function getEntries(config) {
|
|
@@ -64,7 +64,7 @@ async function getEntries(config) {
|
|
|
64
64
|
const entries = {
|
|
65
65
|
...pageFileEntries,
|
|
66
66
|
// Ensure Rollup generates a bundle per page: https://github.com/vikejs/vike/issues/349#issuecomment-1166247275
|
|
67
|
-
...pageEntries
|
|
67
|
+
...pageEntries,
|
|
68
68
|
};
|
|
69
69
|
return entries;
|
|
70
70
|
}
|
|
@@ -76,7 +76,7 @@ async function getEntries(config) {
|
|
|
76
76
|
}
|
|
77
77
|
const entries = {
|
|
78
78
|
...clientEntries,
|
|
79
|
-
...pageFileEntries
|
|
79
|
+
...pageFileEntries,
|
|
80
80
|
};
|
|
81
81
|
const clientRoutingEntry = requireResolveVikeDistFile('dist/esm/client/runtime-client-routing/entry.js');
|
|
82
82
|
const serverRoutingEntry = requireResolveVikeDistFile('dist/esm/client/runtime-server-routing/entry.js');
|
|
@@ -162,7 +162,7 @@ function getEntryFromClientEntry(clientEntry, config, addExtractAssetsQuery) {
|
|
|
162
162
|
assert(filePathAbsoluteUserRootDir.startsWith('/'));
|
|
163
163
|
const filePath = getFilePathResolved({
|
|
164
164
|
filePathAbsoluteUserRootDir,
|
|
165
|
-
userRootDir: config.root
|
|
165
|
+
userRootDir: config.root,
|
|
166
166
|
});
|
|
167
167
|
let entryTarget = filePath.filePathAbsoluteFilesystem;
|
|
168
168
|
if (addExtractAssetsQuery)
|
|
@@ -170,7 +170,7 @@ function getEntryFromClientEntry(clientEntry, config, addExtractAssetsQuery) {
|
|
|
170
170
|
let entryName = filePathAbsoluteUserRootDir;
|
|
171
171
|
if (addExtractAssetsQuery)
|
|
172
172
|
entryName = extractAssetsAddQuery(entryName);
|
|
173
|
-
entryName =
|
|
173
|
+
entryName = removeFileExtension(entryName);
|
|
174
174
|
entryName = prependEntriesDir(entryName);
|
|
175
175
|
return { entryName, entryTarget };
|
|
176
176
|
}
|
|
@@ -2,6 +2,5 @@ export { pluginBuildEntry };
|
|
|
2
2
|
export { set_macro_ASSETS_MANIFEST };
|
|
3
3
|
import type { Plugin, Rollup } from 'vite';
|
|
4
4
|
type Bundle = Rollup.OutputBundle;
|
|
5
|
-
type Options = Rollup.NormalizedOutputOptions;
|
|
6
5
|
declare function pluginBuildEntry(): Plugin[];
|
|
7
|
-
declare function set_macro_ASSETS_MANIFEST(
|
|
6
|
+
declare function set_macro_ASSETS_MANIFEST(assetsJsonFilePath: string | undefined, bundle: Bundle, outDir: string): Promise<boolean>;
|
|
@@ -3,8 +3,8 @@ export { set_macro_ASSETS_MANIFEST };
|
|
|
3
3
|
import { serverProductionEntryPlugin } from '@brillout/vite-plugin-server-entry/plugin';
|
|
4
4
|
import { virtualFileIdEntryServer } from '../../../shared/virtualFiles/virtualFileEntry.js';
|
|
5
5
|
import { assert, PROJECT_VERSION, requireResolveVikeDistFile } from '../../utils.js';
|
|
6
|
-
import fs from 'fs/promises';
|
|
7
|
-
import path from 'path';
|
|
6
|
+
import fs from 'node:fs/promises';
|
|
7
|
+
import path from 'node:path';
|
|
8
8
|
import { isUsingClientRouter } from '../pluginExtractExportNames.js';
|
|
9
9
|
import { assertBuildInfo } from '../../../runtime/globalContext.js';
|
|
10
10
|
import { getOutDirs } from '../../shared/getOutDirs.js';
|
|
@@ -19,14 +19,14 @@ function pluginBuildEntry() {
|
|
|
19
19
|
enforce: 'post',
|
|
20
20
|
async configResolved(config_) {
|
|
21
21
|
config = config_;
|
|
22
|
-
}
|
|
22
|
+
},
|
|
23
23
|
},
|
|
24
24
|
...serverProductionEntryPlugin({
|
|
25
25
|
getServerProductionEntry: () => {
|
|
26
26
|
return getServerProductionEntryCode(config);
|
|
27
27
|
},
|
|
28
|
-
libraryName: 'Vike'
|
|
29
|
-
})
|
|
28
|
+
libraryName: 'Vike',
|
|
29
|
+
}),
|
|
30
30
|
];
|
|
31
31
|
}
|
|
32
32
|
function getServerProductionEntryCode(config) {
|
|
@@ -34,7 +34,7 @@ function getServerProductionEntryCode(config) {
|
|
|
34
34
|
const buildInfo = {
|
|
35
35
|
versionAtBuildTime: PROJECT_VERSION,
|
|
36
36
|
usesClientRouter: isUsingClientRouter(), // TODO/v1-release: remove
|
|
37
|
-
viteConfigRuntime: getViteConfigRuntime(config)
|
|
37
|
+
viteConfigRuntime: getViteConfigRuntime(config),
|
|
38
38
|
};
|
|
39
39
|
assertBuildInfo(buildInfo);
|
|
40
40
|
// After the old design is removed, let's maybe simplify and move everything into a single virtual module
|
|
@@ -52,14 +52,13 @@ function getServerProductionEntryCode(config) {
|
|
|
52
52
|
` buildInfo,`,
|
|
53
53
|
' });',
|
|
54
54
|
` }`,
|
|
55
|
-
''
|
|
55
|
+
'',
|
|
56
56
|
].join('\n');
|
|
57
57
|
return importerCode;
|
|
58
58
|
}
|
|
59
59
|
// Set the value of the ASSETS_MANIFEST constant inside dist/server/entry.js (or dist/server/index.js)
|
|
60
|
-
async function set_macro_ASSETS_MANIFEST(
|
|
61
|
-
|
|
62
|
-
assert(dir);
|
|
60
|
+
async function set_macro_ASSETS_MANIFEST(assetsJsonFilePath, bundle, outDir) {
|
|
61
|
+
assert(outDir);
|
|
63
62
|
const chunkPath = find_ASSETS_MANIFEST(bundle);
|
|
64
63
|
// Some server builds don't contain __VITE_ASSETS_MANIFEST__ such as dist/rsc/ from vike-react-rsc
|
|
65
64
|
if (!chunkPath) {
|
|
@@ -67,10 +66,10 @@ async function set_macro_ASSETS_MANIFEST(options, bundle, assetsJsonFilePath) {
|
|
|
67
66
|
return noop;
|
|
68
67
|
}
|
|
69
68
|
assert(assetsJsonFilePath);
|
|
70
|
-
const chunkFilePath = path.join(
|
|
69
|
+
const chunkFilePath = path.join(outDir, chunkPath);
|
|
71
70
|
const [assetsJsonString, chunkFileContent] = await Promise.all([
|
|
72
71
|
await fs.readFile(assetsJsonFilePath, 'utf8'),
|
|
73
|
-
await fs.readFile(chunkFilePath, 'utf8')
|
|
72
|
+
await fs.readFile(chunkFilePath, 'utf8'),
|
|
74
73
|
]);
|
|
75
74
|
const serverEntryFileContentPatched = chunkFileContent.replace(ASSETS_MANIFEST, assetsJsonString);
|
|
76
75
|
assert(serverEntryFileContentPatched !== chunkFileContent);
|
|
@@ -3,8 +3,8 @@ export { pluginDistFileNames };
|
|
|
3
3
|
// - https://github.com/vikejs/vike/commit/11a4c49e5403aa7c37c8020c462b499425b41854
|
|
4
4
|
// - Blocker: https://github.com/rollup/rollup/issues/4724
|
|
5
5
|
import { assertPosixPath, assert, assertUsage, isArray, isCallable } from '../../utils.js';
|
|
6
|
-
import path from 'path';
|
|
7
|
-
import crypto from 'crypto';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import crypto from 'node:crypto';
|
|
8
8
|
import { getAssetsDir } from '../../shared/getAssetsDir.js';
|
|
9
9
|
import { assertModuleId, getModuleFilePathAbsolute } from '../../shared/getFilePath.js';
|
|
10
10
|
function pluginDistFileNames() {
|
|
@@ -14,7 +14,7 @@ function pluginDistFileNames() {
|
|
|
14
14
|
enforce: 'post',
|
|
15
15
|
configResolved(config) {
|
|
16
16
|
const rollupOutputs = getRollupOutputs(config);
|
|
17
|
-
// We need to support multiple outputs: @vite/plugin-legacy adds an
|
|
17
|
+
// We need to support multiple outputs: @vite/plugin-legacy adds an output, see https://github.com/vikejs/vike/issues/477#issuecomment-1406434802
|
|
18
18
|
rollupOutputs.forEach((rollupOutput) => {
|
|
19
19
|
if (!('entryFileNames' in rollupOutput)) {
|
|
20
20
|
rollupOutput.entryFileNames = (chunkInfo) => getEntryFileName(chunkInfo, config, true);
|
|
@@ -24,6 +24,8 @@ function pluginDistFileNames() {
|
|
|
24
24
|
}
|
|
25
25
|
if (!('assetFileNames' in rollupOutput)) {
|
|
26
26
|
rollupOutput.assetFileNames = (chunkInfo) => getAssetFileName(chunkInfo, config);
|
|
27
|
+
rollupOutput.assetFileNames.isTheOneSetByVike = true;
|
|
28
|
+
assert(rollupOutput.assetFileNames.isTheOneSetByVike);
|
|
27
29
|
}
|
|
28
30
|
else {
|
|
29
31
|
// If a user needs this:
|
|
@@ -31,7 +33,7 @@ function pluginDistFileNames() {
|
|
|
31
33
|
// - It's needed for getHash() of handleAssetsManifest()
|
|
32
34
|
// - Asset URLs should always contain a hash: it's paramount for caching assets.
|
|
33
35
|
// - If rollupOutput.assetFileNames is a function then use a wrapper function to apply the assertUsage()
|
|
34
|
-
assertUsage(
|
|
36
|
+
assertUsage(rollupOutput.assetFileNames.isTheOneSetByVike, "Setting Vite's configuration build.rollupOptions.output.assetFileNames is currently forbidden. Reach out if you need to use it.");
|
|
35
37
|
}
|
|
36
38
|
{
|
|
37
39
|
const manualChunksOriginal = rollupOutput.manualChunks;
|
|
@@ -92,7 +94,7 @@ function pluginDistFileNames() {
|
|
|
92
94
|
};
|
|
93
95
|
}
|
|
94
96
|
});
|
|
95
|
-
}
|
|
97
|
+
},
|
|
96
98
|
};
|
|
97
99
|
}
|
|
98
100
|
function getIdHash(id) {
|
|
@@ -147,7 +149,7 @@ function getEntryFileName(chunkInfo, config, isEntry) {
|
|
|
147
149
|
return `${name}.${isEntry ? 'mjs' : 'js'}`;
|
|
148
150
|
}
|
|
149
151
|
}
|
|
150
|
-
function
|
|
152
|
+
function removePathSeparators(name) {
|
|
151
153
|
assertPosixPath(name);
|
|
152
154
|
assert(!name.startsWith('/'));
|
|
153
155
|
const entryDir = 'entries/';
|
|
@@ -167,9 +169,9 @@ function clean(name, removePathSep, fixGlob) {
|
|
|
167
169
|
if (fixGlob) {
|
|
168
170
|
name = workaroundGlob(name);
|
|
169
171
|
}
|
|
170
|
-
name =
|
|
172
|
+
name = replaceNonLatinCharacters(name);
|
|
171
173
|
if (removePathSep) {
|
|
172
|
-
name =
|
|
174
|
+
name = removePathSeparators(name);
|
|
173
175
|
}
|
|
174
176
|
name = removeLeadingUnderscoreInFilename(name);
|
|
175
177
|
name = removeUnderscoreDoublets(name);
|
|
@@ -189,7 +191,7 @@ function removeUnderscoreDoublets(name) {
|
|
|
189
191
|
name = name.split(/__+/).join('_');
|
|
190
192
|
return name;
|
|
191
193
|
}
|
|
192
|
-
function
|
|
194
|
+
function replaceNonLatinCharacters(name) {
|
|
193
195
|
name = name.split('+').join('');
|
|
194
196
|
name = name.replace(/[^a-zA-Z0-9\/\._]/g, '-');
|
|
195
197
|
return name;
|
|
@@ -34,9 +34,9 @@ function pluginModuleBanner() {
|
|
|
34
34
|
magicString.prepend(`/*! ${id} [vike:pluginModuleBanner] */\n`);
|
|
35
35
|
return {
|
|
36
36
|
code: magicString.toString(),
|
|
37
|
-
map: magicString.generateMap({ hires: true, source: id })
|
|
37
|
+
map: magicString.generateMap({ hires: true, source: id }),
|
|
38
38
|
};
|
|
39
|
-
}
|
|
40
|
-
}
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
41
|
};
|
|
42
42
|
}
|
|
@@ -23,14 +23,14 @@ function pluginSuppressRollupWarning() {
|
|
|
23
23
|
warn(warning);
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
}
|
|
26
|
+
},
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
/** Suppress warning about Rollup removing the React Server Components `"use client";` directives */
|
|
30
30
|
function suppressUseClientDirective(warning) {
|
|
31
31
|
return warning.code === 'MODULE_LEVEL_DIRECTIVE' && warning.message.includes('"use client"');
|
|
32
32
|
}
|
|
33
|
-
/** Suppress warning about generating
|
|
33
|
+
/** Suppress warning about generating empty chunks in dist/ */
|
|
34
34
|
function suppressEmptyBundle(warning) {
|
|
35
35
|
return warning.code === 'EMPTY_BUNDLE';
|
|
36
36
|
}
|
|
@@ -38,7 +38,7 @@ function suppressEmptyBundle(warning) {
|
|
|
38
38
|
function suppressUnusedImport(warning) {
|
|
39
39
|
if (warning.code !== 'UNUSED_EXTERNAL_IMPORT')
|
|
40
40
|
return false;
|
|
41
|
-
// I guess it's expected that JSX contains
|
|
41
|
+
// I guess it's expected that JSX contains unused `import React from 'react'`
|
|
42
42
|
if (warning.exporter === 'react' && warning.names?.includes('default')) {
|
|
43
43
|
warning.names = warning.names.filter((n) => n !== 'default');
|
|
44
44
|
if (warning.names.length === 0)
|
|
@@ -20,7 +20,7 @@ function assertResolveAlias(config) {
|
|
|
20
20
|
const errPrefix = config.configFile || 'Your Vite configuration';
|
|
21
21
|
const errSuffix1 = 'see https://vike.dev/path-aliases#vite';
|
|
22
22
|
const deprecation = 'which will be deprecated in the next major release';
|
|
23
|
-
const errSuffix2 = `${deprecation}, use a string
|
|
23
|
+
const errSuffix2 = `${deprecation}, use a string instead and ${errSuffix1}`;
|
|
24
24
|
aliases.forEach((alias) => {
|
|
25
25
|
const { customResolver, find } = alias;
|
|
26
26
|
{
|
|
@@ -40,7 +40,7 @@ function assertResolveAlias(config) {
|
|
|
40
40
|
{
|
|
41
41
|
const msg = `${errPrefix} defines resolve.alias with a regular expression ${errSuffix2}`;
|
|
42
42
|
assertWarning(false, msg, {
|
|
43
|
-
onlyOnce: true
|
|
43
|
+
onlyOnce: true,
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { pluginCommon };
|
|
2
|
-
import { assert, assertUsage, assertWarning, findPackageJson, hasProp, isDevCheck, isDocker, isObject, isVitest } from '../utils.js';
|
|
2
|
+
import { assert, assertUsage, assertWarning, findPackageJson, hasProp, isDevCheck, isDocker, isObject, isVitest, } from '../utils.js';
|
|
3
3
|
import { assertRollupInput } from './pluginBuild/pluginBuildConfig.js';
|
|
4
4
|
import { installRequireShim_setUserRootDir } from '@brillout/require-shim';
|
|
5
5
|
import pc from '@brillout/picocolors';
|
|
6
|
-
import path from 'path';
|
|
6
|
+
import path from 'node:path';
|
|
7
7
|
import { assertResolveAlias } from './pluginCommon/assertResolveAlias.js';
|
|
8
8
|
import { isViteCliCall } from '../shared/isViteCliCall.js';
|
|
9
9
|
import { isVikeCliOrApi } from '../../api/context.js';
|
|
@@ -33,11 +33,11 @@ function pluginCommon(vikeVitePluginOptions) {
|
|
|
33
33
|
_rootResolvedEarly: rootResolvedEarly,
|
|
34
34
|
// TODO/v1-release: remove https://github.com/vikejs/vike/issues/2122
|
|
35
35
|
configVikePromise: Promise.resolve({
|
|
36
|
-
prerender: vikeConfig.prerenderContext.isPrerenderingEnabled
|
|
37
|
-
})
|
|
36
|
+
prerender: vikeConfig.prerenderContext.isPrerenderingEnabled,
|
|
37
|
+
}),
|
|
38
38
|
};
|
|
39
|
-
}
|
|
40
|
-
}
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
name: pluginName,
|
|
@@ -45,7 +45,7 @@ function pluginCommon(vikeVitePluginOptions) {
|
|
|
45
45
|
assertViteRoot(config._rootResolvedEarly, config);
|
|
46
46
|
assertSingleInstance(config);
|
|
47
47
|
installRequireShim_setUserRootDir(config.root);
|
|
48
|
-
}
|
|
48
|
+
},
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
name: `${pluginName}:post`,
|
|
@@ -63,7 +63,7 @@ function pluginCommon(vikeVitePluginOptions) {
|
|
|
63
63
|
assertVikeCliOrApi(config);
|
|
64
64
|
temp_supportOldInterface(config);
|
|
65
65
|
await emitServerEntryOnlyIfNeeded(config);
|
|
66
|
-
}
|
|
66
|
+
},
|
|
67
67
|
},
|
|
68
68
|
config: {
|
|
69
69
|
order: 'post',
|
|
@@ -87,9 +87,9 @@ function pluginCommon(vikeVitePluginOptions) {
|
|
|
87
87
|
setDefault('host', true, configFromUser, configFromVike);
|
|
88
88
|
}
|
|
89
89
|
return configFromVike;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
93
|
];
|
|
94
94
|
}
|
|
95
95
|
// Override Vite's default value without overriding user settings
|
|
@@ -139,7 +139,7 @@ function assertVikeCliOrApi(config) {
|
|
|
139
139
|
if (isViteCliCall()) {
|
|
140
140
|
assert(!isVitest());
|
|
141
141
|
assertWarning(false, `Vite's CLI is deprecated ${pc.underline('https://vike.dev/migration/cli')}`, {
|
|
142
|
-
onlyOnce: true
|
|
142
|
+
onlyOnce: true,
|
|
143
143
|
});
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
@@ -149,12 +149,12 @@ function assertVikeCliOrApi(config) {
|
|
|
149
149
|
}
|
|
150
150
|
if (config.server.middlewareMode) {
|
|
151
151
|
assertWarning(false, `${pc.cyan('vite.createServer()')} is deprecated ${pc.underline('https://vike.dev/migration/cli#api')}`, {
|
|
152
|
-
onlyOnce: true
|
|
152
|
+
onlyOnce: true,
|
|
153
153
|
});
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
156
|
assertWarning(false, `Vite's JavaScript API is deprecated ${pc.underline('https://vike.dev/migration/cli#api')}`, {
|
|
157
|
-
onlyOnce: true
|
|
157
|
+
onlyOnce: true,
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
// TODO/v1-release: remove https://github.com/vikejs/vike/issues/2122
|
|
@@ -2,7 +2,7 @@ export { determineFsAllowList };
|
|
|
2
2
|
import { searchForWorkspaceRoot } from 'vite';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { assert, assertPosixPath, getVikeNodeModulesRoot } from '../../utils.js';
|
|
5
|
-
import { fileURLToPath } from 'url';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
6
|
// @ts-ignore import.meta.url is shimmed at dist/cjs by dist-cjs-fixup.js.
|
|
7
7
|
const importMetaUrl = import.meta.url;
|
|
8
8
|
assertPosixPath(importMetaUrl);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { determineOptimizeDeps };
|
|
2
2
|
import { findPageFiles } from '../../shared/findPageFiles.js';
|
|
3
|
-
import { assert, assertIsImportPathNpmPackage, createDebugger, getNpmPackageName, isArray, unique } from '../../utils.js';
|
|
4
|
-
import { getVikeConfigInternal,
|
|
3
|
+
import { assert, assertIsImportPathNpmPackage, createDebugger, getNpmPackageName, isArray, unique, } from '../../utils.js';
|
|
4
|
+
import { getVikeConfigInternal, isOverridden } from '../../shared/resolveVikeConfigInternal.js';
|
|
5
5
|
import { analyzeClientEntries } from '../pluginBuild/pluginBuildConfig.js';
|
|
6
|
-
import { virtualFileIdEntryClientCR, virtualFileIdEntryClientSR } from '../../../shared/virtualFiles/virtualFileEntry.js';
|
|
6
|
+
import { virtualFileIdEntryClientCR, virtualFileIdEntryClientSR, } from '../../../shared/virtualFiles/virtualFileEntry.js';
|
|
7
7
|
import { getFilePathResolved } from '../../shared/getFilePath.js';
|
|
8
8
|
const debug = createDebugger('vike:optimizeDeps');
|
|
9
9
|
async function determineOptimizeDeps(config) {
|
|
@@ -26,7 +26,7 @@ async function determineOptimizeDeps(config) {
|
|
|
26
26
|
if (debug.isActivated)
|
|
27
27
|
debug('config.optimizeDeps', {
|
|
28
28
|
'config.optimizeDeps.entries': config.optimizeDeps.entries,
|
|
29
|
-
'config.optimizeDeps.include': config.optimizeDeps.include
|
|
29
|
+
'config.optimizeDeps.include': config.optimizeDeps.include,
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
async function getPageDeps(config, pageConfigs) {
|
|
@@ -47,7 +47,7 @@ async function getPageDeps(config, pageConfigs) {
|
|
|
47
47
|
pageConfigs.forEach((pageConfig) => {
|
|
48
48
|
Object.entries(pageConfig.configValueSources).forEach(([configName, sources]) => {
|
|
49
49
|
sources
|
|
50
|
-
.filter((source) => !
|
|
50
|
+
.filter((source) => !isOverridden(source, configName, pageConfig))
|
|
51
51
|
.forEach((configValueSource) => {
|
|
52
52
|
if (!configValueSource.valueIsLoadedWithImport && !configValueSource.valueIsFilePath)
|
|
53
53
|
return;
|
|
@@ -51,9 +51,9 @@ function pluginDev() {
|
|
|
51
51
|
// // ../../node_modules/.pnpm/react-streaming@0.3.16_react-dom@18.2.0_react@18.2.0/node_modules/react-streaming/dist/esm/client/useAsync.js
|
|
52
52
|
// import { parse as parse2 } from "@brillout/json-serializer/parse";
|
|
53
53
|
// ```
|
|
54
|
-
'react-streaming'
|
|
55
|
-
]
|
|
56
|
-
}
|
|
54
|
+
'react-streaming',
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
57
|
};
|
|
58
58
|
},
|
|
59
59
|
async configResolved(config_) {
|
|
@@ -65,7 +65,7 @@ function pluginDev() {
|
|
|
65
65
|
improveViteLogs(config);
|
|
66
66
|
}
|
|
67
67
|
logDockerHint(config.server.host);
|
|
68
|
-
}
|
|
68
|
+
},
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
name: 'vike:pluginDev:addSsrMiddleware',
|
|
@@ -81,7 +81,7 @@ function pluginDev() {
|
|
|
81
81
|
return () => {
|
|
82
82
|
addSsrMiddleware(server.middlewares, config, false, null);
|
|
83
83
|
};
|
|
84
|
-
}
|
|
84
|
+
},
|
|
85
85
|
},
|
|
86
86
|
// Setting `configResolved.clearScreen = false` doesn't work
|
|
87
87
|
config: {
|
|
@@ -90,9 +90,9 @@ function pluginDev() {
|
|
|
90
90
|
if (isErrorDebug()) {
|
|
91
91
|
return { clearScreen: false };
|
|
92
92
|
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
96
|
];
|
|
97
97
|
}
|
|
98
98
|
function logDockerHint(configHost) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { pluginEnvVars };
|
|
2
2
|
import MagicString from 'magic-string';
|
|
3
3
|
import { loadEnv } from 'vite';
|
|
4
|
-
import { assert, assertPosixPath, assertUsage, assertWarning, escapeRegex, isArray, isNotNullish, lowerFirst } from '../utils.js';
|
|
4
|
+
import { assert, assertPosixPath, assertUsage, assertWarning, escapeRegex, isArray, isNotNullish, lowerFirst, } from '../utils.js';
|
|
5
5
|
import { getModuleFilePathAbsolute } from '../shared/getFilePath.js';
|
|
6
6
|
import { normalizeId } from '../shared/normalizeId.js';
|
|
7
7
|
import { isViteServerBuild_safe } from '../shared/isViteServerBuild.js';
|
|
@@ -9,11 +9,11 @@ import { applyRegExpWithMagicString } from '../shared/applyRegExWithMagicString.
|
|
|
9
9
|
// TODO/enventually:
|
|
10
10
|
// - Make import.meta.env work inside +config.js
|
|
11
11
|
// - 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
|
|
12
|
-
// - Or stop using Vite's `mode`
|
|
12
|
+
// - 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`.)
|
|
13
13
|
const PUBLIC_ENV_PREFIX = 'PUBLIC_ENV__';
|
|
14
14
|
const PUBLIC_ENV_ALLOWLIST = [
|
|
15
15
|
// https://github.com/vikejs/vike/issues/1724
|
|
16
|
-
'STORYBOOK'
|
|
16
|
+
'STORYBOOK',
|
|
17
17
|
];
|
|
18
18
|
function pluginEnvVars() {
|
|
19
19
|
let envsAll;
|
|
@@ -82,8 +82,8 @@ function pluginEnvVars() {
|
|
|
82
82
|
return null;
|
|
83
83
|
return {
|
|
84
84
|
code: magicString.toString(),
|
|
85
|
-
map: magicString.generateMap({ hires: true, source: id })
|
|
85
|
+
map: magicString.generateMap({ hires: true, source: id }),
|
|
86
86
|
};
|
|
87
|
-
}
|
|
87
|
+
},
|
|
88
88
|
};
|
|
89
89
|
}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
// Workaround to make client-side bundles include the CSS imports living in server-side-only code.
|
|
4
4
|
// - This is needed for HTML-only pages, and React Server Components.
|
|
5
5
|
// - We recommend using the debug flag to get an idea of how this plugin works: `$ DEBUG=vike:pluginExtractAssets pnpm exec vike build`. Then have a look at `dist/client/manifest.json` and see how `.page.server.js` entries have zero JavaScript but only CSS.
|
|
6
|
-
// - This
|
|
6
|
+
// - This approach supports import path aliases `vite.config.js#resolve.alias` https://vitejs.dev/config/#resolve-alias
|
|
7
7
|
export { pluginExtractAssets };
|
|
8
8
|
export { extractAssetsRE };
|
|
9
|
-
import { assert, assertPosixPath, styleFileRE, createDebugger, isScriptFile, assertUsage, rollupSourceMapRemove } from '../utils.js';
|
|
9
|
+
import { assert, assertPosixPath, styleFileRE, createDebugger, isScriptFile, assertUsage, rollupSourceMapRemove, } from '../utils.js';
|
|
10
10
|
import { resolveVirtualFileId, isVirtualFileId, getVirtualFileId } from '../../shared/virtualFiles.js';
|
|
11
11
|
import { extractAssetsAddQuery } from '../../shared/extractAssetsQuery.js';
|
|
12
12
|
import { isAsset } from '../shared/isAsset.js';
|
|
@@ -28,7 +28,7 @@ function pluginExtractAssets() {
|
|
|
28
28
|
let vikeConfig;
|
|
29
29
|
let isFixEnabled;
|
|
30
30
|
return [
|
|
31
|
-
// This plugin removes all JavaScript from server-side only code, so that only CSS imports remains. (And also
|
|
31
|
+
// This plugin removes all JavaScript from server-side only code, so that only CSS imports remains. (And also static files imports e.g. `import logoURL from './logo.svg.js'`).
|
|
32
32
|
{
|
|
33
33
|
name: 'vike:pluginExtractAssets:remove-javaScript',
|
|
34
34
|
// In dev, things just work. (Because Vite's module graph erroneously conflates the Vite server-side importees with the client-side importees.)
|
|
@@ -52,7 +52,7 @@ function pluginExtractAssets() {
|
|
|
52
52
|
const code = moduleNames.map((moduleName) => `import '${moduleName}';`).join('\n');
|
|
53
53
|
debugTransformResult(id, code, importStatements);
|
|
54
54
|
return rollupSourceMapRemove(code);
|
|
55
|
-
}
|
|
55
|
+
},
|
|
56
56
|
},
|
|
57
57
|
// This plugin appends `?extractAssets` to module IDs
|
|
58
58
|
{
|
|
@@ -116,7 +116,7 @@ function pluginExtractAssets() {
|
|
|
116
116
|
return emptyModule(file, importer);
|
|
117
117
|
}
|
|
118
118
|
return appendExtractAssetsQuery(file, importer);
|
|
119
|
-
}
|
|
119
|
+
},
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
name: 'vike:pluginExtractAssets-3',
|
|
@@ -133,7 +133,7 @@ function pluginExtractAssets() {
|
|
|
133
133
|
if (debug.isActivated) {
|
|
134
134
|
return { logLevel: 'silent' };
|
|
135
135
|
}
|
|
136
|
-
}
|
|
136
|
+
},
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
139
|
name: 'vike:pluginExtractAssets-4',
|
|
@@ -145,8 +145,8 @@ function pluginExtractAssets() {
|
|
|
145
145
|
// https://github.com/vikejs/vike/issues/1060
|
|
146
146
|
assertUsage(!config.plugins.find((p) => p.name === 'vite-tsconfig-paths'), 'vite-tsconfig-paths not supported, remove it and use vite.config.js#resolve.alias instead');
|
|
147
147
|
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
150
|
];
|
|
151
151
|
}
|
|
152
152
|
function emptyModule(file, importer) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { pluginExtractExportNames };
|
|
2
2
|
export { isUsingClientRouter };
|
|
3
3
|
export { extractExportNamesRE };
|
|
4
|
-
import { assert, getFileExtension, createDebugger, getGlobalObject, assertUsage, rollupSourceMapRemove } from '../utils.js';
|
|
4
|
+
import { assert, getFileExtension, createDebugger, getGlobalObject, assertUsage, rollupSourceMapRemove, } from '../utils.js';
|
|
5
5
|
import { getExportNames } from '../shared/parseEsModule.js';
|
|
6
6
|
import { normalizeId } from '../shared/normalizeId.js';
|
|
7
7
|
import { isViteServerBuild_options } from '../shared/isViteServerBuild.js';
|
|
@@ -29,7 +29,7 @@ function pluginExtractExportNames() {
|
|
|
29
29
|
if (debug.isActivated) {
|
|
30
30
|
return { logLevel: 'silent' };
|
|
31
31
|
}
|
|
32
|
-
}
|
|
32
|
+
},
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
async function getExtractExportNamesCode(src, isClientSide, isProduction, id) {
|
|
@@ -51,7 +51,7 @@ function getCode(exportNames, wildcardReExports, isClientSide, isProduction, id)
|
|
|
51
51
|
code += '\n';
|
|
52
52
|
code += `export const exportNames = [${[
|
|
53
53
|
...exportNames.map((n) => JSON.stringify(n)),
|
|
54
|
-
...reExportVarNames.map((varName) => `...${varName}`)
|
|
54
|
+
...reExportVarNames.map((varName) => `...${varName}`),
|
|
55
55
|
].join(', ')}];`;
|
|
56
56
|
code = injectHmr(code, isClientSide, isProduction);
|
|
57
57
|
return code;
|