vite-plugin-react-server 1.1.19 → 1.2.0-alpha.0
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 +102 -395
- package/dist/_virtual/dynamic-import-helper.js +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +5 -2
- package/dist/index.js +1 -1
- package/dist/package.json +58 -25
- package/dist/plugin/components/{css-collector-elements.d.ts → css.d.ts} +2 -2
- package/dist/plugin/components/css.d.ts.map +1 -0
- package/dist/plugin/components/css.js +33 -0
- package/dist/plugin/components/html.d.ts +1 -1
- package/dist/plugin/components/html.d.ts.map +1 -1
- package/dist/plugin/components/html.js +5 -5
- package/dist/plugin/components/index.d.ts +3 -3
- package/dist/plugin/components/index.d.ts.map +1 -1
- package/dist/plugin/components/index.js +9 -3
- package/dist/plugin/components/root.d.ts +7 -0
- package/dist/plugin/components/root.d.ts.map +1 -0
- package/dist/plugin/components/root.js +18 -0
- package/dist/plugin/config/autoDiscover/createGlobAutoDiscover.js +1 -1
- package/dist/plugin/config/autoDiscover/customWorkerFiles.js +1 -1
- package/dist/plugin/config/autoDiscover/pageAndPropFiles.js +1 -1
- package/dist/plugin/config/autoDiscover/resolveAutoDiscover.d.ts +5 -4
- package/dist/plugin/config/autoDiscover/resolveAutoDiscover.d.ts.map +1 -1
- package/dist/plugin/config/autoDiscover/resolveAutoDiscover.js +26 -7
- package/dist/plugin/config/autoDiscover/resolveBuildPages.d.ts +25 -2
- package/dist/plugin/config/autoDiscover/resolveBuildPages.d.ts.map +1 -1
- package/dist/plugin/config/autoDiscover/resolveBuildPages.js +84 -5
- package/dist/plugin/config/createModuleID.d.ts +3 -6
- package/dist/plugin/config/createModuleID.d.ts.map +1 -1
- package/dist/plugin/config/createModuleID.js +42 -32
- package/dist/plugin/config/defaults.d.ts +199 -121
- package/dist/plugin/config/defaults.d.ts.map +1 -1
- package/dist/plugin/config/defaults.js +155 -89
- package/dist/plugin/config/extMap.d.ts +6 -2
- package/dist/plugin/config/extMap.d.ts.map +1 -1
- package/dist/plugin/config/extMap.js +38 -48
- package/dist/plugin/config/flightBindings.d.ts +4 -0
- package/dist/plugin/config/flightBindings.d.ts.map +1 -0
- package/dist/plugin/config/flightBindings.js +215 -0
- package/dist/plugin/config/getCondition.d.ts +2 -0
- package/dist/plugin/config/getCondition.d.ts.map +1 -1
- package/dist/plugin/config/getCondition.js +4 -2
- package/dist/plugin/config/getPaths.js +1 -1
- package/dist/plugin/config/index.d.ts +17 -4
- package/dist/plugin/config/index.d.ts.map +1 -1
- package/dist/plugin/config/index.js +29 -7
- package/dist/plugin/config/interpolatePattern.d.ts +13 -0
- package/dist/plugin/config/interpolatePattern.d.ts.map +1 -0
- package/dist/plugin/config/interpolatePattern.js +13 -0
- package/dist/plugin/config/mimeTypes.js +1 -1
- package/dist/plugin/config/parsePattern.d.ts +25 -0
- package/dist/plugin/config/parsePattern.d.ts.map +1 -0
- package/dist/plugin/config/parsePattern.js +30 -0
- package/dist/plugin/config/resolveAllowedDirectives.d.ts +26 -0
- package/dist/plugin/config/resolveAllowedDirectives.d.ts.map +1 -0
- package/dist/plugin/config/resolveAllowedDirectives.js +35 -0
- package/dist/plugin/config/resolveDirectiveMatcher.d.ts +25 -0
- package/dist/plugin/config/resolveDirectiveMatcher.d.ts.map +1 -0
- package/dist/plugin/config/resolveDirectiveMatcher.js +33 -0
- package/dist/plugin/config/resolveEnv.d.ts.map +1 -1
- package/dist/plugin/config/resolveEnv.js +14 -4
- package/dist/plugin/config/resolveOptions.d.ts +13 -3
- package/dist/plugin/config/resolveOptions.d.ts.map +1 -1
- package/dist/plugin/config/resolveOptions.js +228 -206
- package/dist/plugin/config/resolvePages.js +1 -1
- package/dist/plugin/config/resolvePatternWithValues.d.ts +39 -0
- package/dist/plugin/config/resolvePatternWithValues.d.ts.map +1 -0
- package/dist/plugin/config/resolvePatternWithValues.js +36 -0
- package/dist/plugin/config/resolveRegExp.d.ts +29 -0
- package/dist/plugin/config/resolveRegExp.d.ts.map +1 -0
- package/dist/plugin/config/resolveRegExp.js +39 -0
- package/dist/plugin/config/resolveUrlOption.d.ts +37 -6
- package/dist/plugin/config/resolveUrlOption.d.ts.map +1 -1
- package/dist/plugin/config/resolveUrlOption.js +42 -12
- package/dist/plugin/config/resolveUserConfig.d.ts +5 -4
- package/dist/plugin/config/resolveUserConfig.d.ts.map +1 -1
- package/dist/plugin/config/resolveUserConfig.js +86 -40
- package/dist/plugin/env/plugin.d.ts +6 -0
- package/dist/plugin/env/plugin.d.ts.map +1 -1
- package/dist/plugin/env/plugin.js +111 -93
- package/dist/plugin/error/directiveError.d.ts +13 -0
- package/dist/plugin/error/directiveError.d.ts.map +1 -0
- package/dist/plugin/error/directiveError.js +21 -0
- package/dist/plugin/error/enhanceError.d.ts +14 -0
- package/dist/plugin/error/enhanceError.d.ts.map +1 -0
- package/dist/plugin/error/enhanceError.js +24 -0
- package/dist/plugin/error/index.d.ts +4 -0
- package/dist/plugin/error/index.d.ts.map +1 -0
- package/dist/plugin/error/index.js +9 -0
- package/dist/plugin/error/logError.d.ts +3 -0
- package/dist/plugin/error/logError.d.ts.map +1 -0
- package/dist/plugin/error/logError.js +47 -0
- package/dist/plugin/error/serializeError.d.ts +7 -0
- package/dist/plugin/error/serializeError.d.ts.map +1 -0
- package/dist/plugin/error/serializeError.js +37 -0
- package/dist/plugin/error/toError.d.ts +1 -8
- package/dist/plugin/error/toError.d.ts.map +1 -1
- package/dist/plugin/error/toError.js +62 -34
- package/dist/plugin/file-preserver/plugin.js +93 -105
- package/dist/plugin/getNodeEnv.d.ts +11 -0
- package/dist/plugin/getNodeEnv.d.ts.map +1 -0
- package/dist/plugin/getNodeEnv.js +17 -0
- package/dist/plugin/helpers/cleanObject.d.ts.map +1 -1
- package/dist/plugin/helpers/cleanObject.js +2 -1
- package/dist/plugin/helpers/collectManifestCss.js +1 -1
- package/dist/plugin/helpers/collectViteModuleGraphCss.d.ts +6 -4
- package/dist/plugin/helpers/collectViteModuleGraphCss.d.ts.map +1 -1
- package/dist/plugin/helpers/collectViteModuleGraphCss.js +15 -9
- package/dist/plugin/helpers/createCssProps.d.ts +3 -4
- package/dist/plugin/helpers/createCssProps.d.ts.map +1 -1
- package/dist/plugin/helpers/createCssProps.js +16 -4
- package/dist/plugin/helpers/createEventHandler.d.ts +2 -2
- package/dist/plugin/helpers/createEventHandler.d.ts.map +1 -1
- package/dist/plugin/helpers/createEventHandler.js +1 -1
- package/dist/plugin/helpers/createHandler.d.ts +10 -8
- package/dist/plugin/helpers/createHandler.d.ts.map +1 -1
- package/dist/plugin/helpers/createHandler.js +11 -5
- package/dist/plugin/helpers/createRscStream.d.ts +18 -5
- package/dist/plugin/helpers/createRscStream.d.ts.map +1 -1
- package/dist/plugin/helpers/createRscStream.js +48 -14
- package/dist/plugin/helpers/formatMetrics.d.ts +1 -5
- package/dist/plugin/helpers/formatMetrics.d.ts.map +1 -1
- package/dist/plugin/helpers/formatMetrics.js +2 -39
- package/dist/plugin/helpers/getBundleManifest.d.ts.map +1 -1
- package/dist/plugin/helpers/getBundleManifest.js +9 -2
- package/dist/plugin/helpers/getRouteFiles.d.ts +30 -2
- package/dist/plugin/helpers/getRouteFiles.d.ts.map +1 -1
- package/dist/plugin/helpers/getRouteFiles.js +70 -7
- package/dist/plugin/helpers/handleServerAction.d.ts +8 -7
- package/dist/plugin/helpers/handleServerAction.d.ts.map +1 -1
- package/dist/plugin/helpers/handleServerAction.js +5 -2
- package/dist/plugin/helpers/hydrateUserOptions.d.ts +9 -0
- package/dist/plugin/helpers/hydrateUserOptions.d.ts.map +1 -0
- package/dist/plugin/helpers/hydrateUserOptions.js +22 -0
- package/dist/plugin/helpers/index.d.ts +2 -0
- package/dist/plugin/helpers/index.d.ts.map +1 -1
- package/dist/plugin/helpers/index.js +31 -31
- package/dist/plugin/helpers/inputNormalizer.d.ts +1 -1
- package/dist/plugin/helpers/inputNormalizer.d.ts.map +1 -1
- package/dist/plugin/helpers/inputNormalizer.js +33 -20
- package/dist/plugin/helpers/metrics.d.ts +4 -10
- package/dist/plugin/helpers/metrics.d.ts.map +1 -1
- package/dist/plugin/helpers/metrics.js +3 -59
- package/dist/plugin/helpers/moduleRefs.js +1 -1
- package/dist/plugin/helpers/moduleResolver.d.ts +24 -2
- package/dist/plugin/helpers/moduleResolver.d.ts.map +1 -1
- package/dist/plugin/helpers/moduleResolver.js +61 -22
- package/dist/plugin/helpers/requestInfo.d.ts +28 -1
- package/dist/plugin/helpers/requestInfo.d.ts.map +1 -1
- package/dist/plugin/helpers/requestInfo.js +43 -30
- package/dist/plugin/helpers/requestToRoute.d.ts +1 -1
- package/dist/plugin/helpers/requestToRoute.d.ts.map +1 -1
- package/dist/plugin/helpers/requestToRoute.js +17 -9
- package/dist/plugin/helpers/resolveComponent.d.ts +57 -0
- package/dist/plugin/helpers/resolveComponent.d.ts.map +1 -0
- package/dist/plugin/helpers/resolveComponent.js +71 -0
- package/dist/plugin/helpers/resolveComponents.d.ts +27 -0
- package/dist/plugin/helpers/resolveComponents.d.ts.map +1 -0
- package/dist/plugin/helpers/resolveComponents.js +137 -0
- package/dist/plugin/helpers/resolvePage.d.ts +15 -11
- package/dist/plugin/helpers/resolvePage.d.ts.map +1 -1
- package/dist/plugin/helpers/resolvePage.js +11 -7
- package/dist/plugin/helpers/resolvePageAndProps.d.ts +3 -10
- package/dist/plugin/helpers/resolvePageAndProps.d.ts.map +1 -1
- package/dist/plugin/helpers/resolvePageAndProps.js +28 -18
- package/dist/plugin/helpers/resolveProps.d.ts +13 -7
- package/dist/plugin/helpers/resolveProps.d.ts.map +1 -1
- package/dist/plugin/helpers/resolveProps.js +55 -25
- package/dist/plugin/helpers/resolveUserComponents.d.ts +33 -0
- package/dist/plugin/helpers/resolveUserComponents.d.ts.map +1 -0
- package/dist/plugin/helpers/resolveUserComponents.js +163 -0
- package/dist/plugin/helpers/serializeUserOptions.d.ts +7 -7
- package/dist/plugin/helpers/serializeUserOptions.d.ts.map +1 -1
- package/dist/plugin/helpers/serializeUserOptions.js +127 -42
- package/dist/plugin/helpers/stashReturnValue.d.ts +2 -1
- package/dist/plugin/helpers/stashReturnValue.d.ts.map +1 -1
- package/dist/plugin/helpers/stashReturnValue.js +6 -3
- package/dist/plugin/helpers/tryManifest.d.ts +1 -2
- package/dist/plugin/helpers/tryManifest.d.ts.map +1 -1
- package/dist/plugin/helpers/tryManifest.js +1 -1
- package/dist/plugin/loader/createDefaultLoader.d.ts +19 -8
- package/dist/plugin/loader/createDefaultLoader.d.ts.map +1 -1
- package/dist/plugin/loader/createDefaultLoader.js +69 -107
- package/dist/plugin/loader/createTransformer.d.ts +6 -0
- package/dist/plugin/loader/createTransformer.d.ts.map +1 -0
- package/dist/plugin/loader/createTransformer.js +97 -0
- package/dist/plugin/loader/{css-loader.development.d.ts → css-loader.d.ts} +6 -8
- package/dist/plugin/loader/css-loader.d.ts.map +1 -0
- package/dist/plugin/loader/css-loader.js +134 -0
- package/dist/plugin/loader/directives/addLocalExportedNames.d.ts +4 -0
- package/dist/plugin/loader/directives/addLocalExportedNames.d.ts.map +1 -0
- package/dist/plugin/loader/directives/addLocalExportedNames.js +57 -0
- package/dist/plugin/loader/directives/analyzeDirectives.d.ts +9 -0
- package/dist/plugin/loader/directives/analyzeDirectives.d.ts.map +1 -0
- package/dist/plugin/loader/directives/analyzeDirectives.js +221 -0
- package/dist/plugin/loader/directives/analyzeModule.d.ts +11 -0
- package/dist/plugin/loader/directives/analyzeModule.d.ts.map +1 -0
- package/dist/plugin/loader/directives/analyzeModule.js +34 -0
- package/dist/plugin/loader/directives/collectExports.d.ts +13 -0
- package/dist/plugin/loader/directives/collectExports.d.ts.map +1 -0
- package/dist/plugin/loader/directives/collectExports.js +116 -0
- package/dist/plugin/loader/directives/collectExportsFromModule.d.ts +6 -0
- package/dist/plugin/loader/directives/collectExportsFromModule.d.ts.map +1 -0
- package/dist/plugin/loader/directives/collectExportsFromModule.js +24 -0
- package/dist/plugin/loader/directives/findDirectiveMatches.d.ts +3 -0
- package/dist/plugin/loader/directives/findDirectiveMatches.d.ts.map +1 -0
- package/dist/plugin/loader/directives/findDirectiveMatches.js +46 -0
- package/dist/plugin/loader/directives/getExportedName.d.ts +3 -0
- package/dist/plugin/loader/directives/getExportedName.d.ts.map +1 -0
- package/dist/plugin/loader/directives/getExportedName.js +59 -0
- package/dist/plugin/loader/directives/getExports.d.ts +7 -0
- package/dist/plugin/loader/directives/getExports.d.ts.map +1 -0
- package/dist/plugin/loader/directives/getExports.js +28 -0
- package/dist/plugin/loader/directives/getFunctionBody.d.ts +3 -0
- package/dist/plugin/loader/directives/getFunctionBody.d.ts.map +1 -0
- package/dist/plugin/loader/directives/getFunctionBody.js +31 -0
- package/dist/plugin/loader/directives/getFunctionName.d.ts +10 -0
- package/dist/plugin/loader/directives/getFunctionName.d.ts.map +1 -0
- package/dist/plugin/loader/directives/getFunctionName.js +42 -0
- package/dist/plugin/loader/directives/getQualifiedName.d.ts +3 -0
- package/dist/plugin/loader/directives/getQualifiedName.d.ts.map +1 -0
- package/dist/plugin/loader/directives/getQualifiedName.js +65 -0
- package/dist/plugin/loader/directives/index.d.ts +14 -0
- package/dist/plugin/loader/directives/index.d.ts.map +1 -0
- package/dist/plugin/loader/directives/index.js +18 -0
- package/dist/plugin/loader/directives/processFunctionNode.d.ts +4 -0
- package/dist/plugin/loader/directives/processFunctionNode.d.ts.map +1 -0
- package/dist/plugin/loader/directives/processFunctionNode.js +86 -0
- package/dist/plugin/loader/directives/typeGuards.d.ts +37 -0
- package/dist/plugin/loader/directives/typeGuards.d.ts.map +1 -0
- package/dist/plugin/loader/directives/typeGuards.js +100 -0
- package/dist/plugin/loader/directives/types.d.ts +154 -0
- package/dist/plugin/loader/directives/types.d.ts.map +1 -0
- package/dist/plugin/loader/directives/utils.d.ts +14 -0
- package/dist/plugin/loader/directives/utils.d.ts.map +1 -0
- package/dist/plugin/loader/directives/utils.js +21 -0
- package/dist/plugin/loader/env-loader.d.ts +11 -0
- package/dist/plugin/loader/env-loader.d.ts.map +1 -0
- package/dist/plugin/loader/env-loader.js +65 -0
- package/dist/plugin/loader/index.d.ts +8 -1
- package/dist/plugin/loader/index.d.ts.map +1 -1
- package/dist/plugin/loader/index.js +13 -4
- package/dist/plugin/loader/parse.d.ts +11 -2
- package/dist/plugin/loader/parse.d.ts.map +1 -1
- package/dist/plugin/loader/parse.js +29 -6
- package/dist/plugin/loader/react-loader.d.ts +22 -1
- package/dist/plugin/loader/react-loader.d.ts.map +1 -1
- package/dist/plugin/loader/react-loader.js +169 -6
- package/dist/plugin/loader/removeDirectives.d.ts +5 -0
- package/dist/plugin/loader/removeDirectives.d.ts.map +1 -0
- package/dist/plugin/loader/removeDirectives.js +17 -0
- package/dist/plugin/loader/removeRanges.d.ts +5 -0
- package/dist/plugin/loader/removeRanges.d.ts.map +1 -0
- package/dist/plugin/loader/removeRanges.js +20 -0
- package/dist/plugin/loader/sourceMap.d.ts +16 -24
- package/dist/plugin/loader/sourceMap.d.ts.map +1 -1
- package/dist/plugin/loader/sourceMap.js +125 -97
- package/dist/plugin/loader/transformClientModule.d.ts +10 -0
- package/dist/plugin/loader/transformClientModule.d.ts.map +1 -0
- package/dist/plugin/loader/transformClientModule.js +46 -0
- package/dist/plugin/loader/transformModule.d.ts +6 -0
- package/dist/plugin/loader/transformModule.d.ts.map +1 -0
- package/dist/plugin/loader/transformModule.js +33 -0
- package/dist/plugin/loader/transformModuleIfNeeded.d.ts +12 -1
- package/dist/plugin/loader/transformModuleIfNeeded.d.ts.map +1 -1
- package/dist/plugin/loader/transformModuleIfNeeded.js +9 -20
- package/dist/plugin/loader/transformServerModule.d.ts +11 -0
- package/dist/plugin/loader/transformServerModule.d.ts.map +1 -0
- package/dist/plugin/loader/transformServerModule.js +84 -0
- package/dist/plugin/loader/transformWithAcornLoose.d.ts +12 -0
- package/dist/plugin/loader/transformWithAcornLoose.d.ts.map +1 -0
- package/dist/plugin/loader/transformWithAcornLoose.js +18 -0
- package/dist/plugin/loader/types.d.ts +59 -12
- package/dist/plugin/loader/types.d.ts.map +1 -1
- package/dist/plugin/metrics/collectStreamMetrics.d.ts +9 -0
- package/dist/plugin/metrics/collectStreamMetrics.d.ts.map +1 -0
- package/dist/plugin/metrics/collectStreamMetrics.js +35 -0
- package/dist/plugin/metrics/createRenderMetrics.d.ts +3 -0
- package/dist/plugin/metrics/createRenderMetrics.d.ts.map +1 -0
- package/dist/plugin/metrics/createRenderMetrics.js +24 -0
- package/dist/plugin/metrics/createStreamMetrics.d.ts +3 -0
- package/dist/plugin/metrics/createStreamMetrics.d.ts.map +1 -0
- package/dist/plugin/metrics/createStreamMetrics.js +19 -0
- package/dist/plugin/metrics/formatMetrics.d.ts +6 -3
- package/dist/plugin/metrics/formatMetrics.d.ts.map +1 -1
- package/dist/plugin/metrics/formatMetrics.js +5 -2
- package/dist/plugin/metrics/index.d.ts +3 -1
- package/dist/plugin/metrics/index.d.ts.map +1 -1
- package/dist/plugin/metrics/index.js +9 -1
- package/dist/plugin/metrics/types.d.ts +23 -0
- package/dist/plugin/metrics/types.d.ts.map +1 -0
- package/dist/plugin/metrics/types.js +1 -0
- package/dist/plugin/plugin.client.d.ts +23 -2
- package/dist/plugin/plugin.client.d.ts.map +1 -1
- package/dist/plugin/plugin.client.js +30 -17
- package/dist/plugin/plugin.server.d.ts +13 -2
- package/dist/plugin/plugin.server.d.ts.map +1 -1
- package/dist/plugin/plugin.server.js +7 -4
- package/dist/plugin/preserver/plugin.d.ts +2 -2
- package/dist/plugin/preserver/plugin.d.ts.map +1 -1
- package/dist/plugin/preserver/plugin.js +33 -29
- package/dist/plugin/react-client/cleanupWorkerServerAction.d.ts +11 -0
- package/dist/plugin/react-client/cleanupWorkerServerAction.d.ts.map +1 -0
- package/dist/plugin/react-client/cleanupWorkerServerAction.js +18 -0
- package/dist/plugin/react-client/configureWorkerRequestHandler.d.ts +9 -9
- package/dist/plugin/react-client/configureWorkerRequestHandler.d.ts.map +1 -1
- package/dist/plugin/react-client/configureWorkerRequestHandler.js +25 -14
- package/dist/plugin/react-client/createMessageHandlers.d.ts +1 -1
- package/dist/plugin/react-client/createMessageHandlers.d.ts.map +1 -1
- package/dist/plugin/react-client/createMessageHandlers.js +15 -3
- package/dist/plugin/react-client/createWorkerStream.d.ts +12 -10
- package/dist/plugin/react-client/createWorkerStream.d.ts.map +1 -1
- package/dist/plugin/react-client/createWorkerStream.js +27 -29
- package/dist/plugin/react-client/handleWorkerRscStream.d.ts +13 -8
- package/dist/plugin/react-client/handleWorkerRscStream.d.ts.map +1 -1
- package/dist/plugin/react-client/handleWorkerRscStream.js +59 -24
- package/dist/plugin/react-client/handleWorkerServerAction.d.ts +2 -1
- package/dist/plugin/react-client/handleWorkerServerAction.d.ts.map +1 -1
- package/dist/plugin/react-client/handleWorkerServerAction.js +43 -28
- package/dist/plugin/react-client/index.d.ts +4 -1
- package/dist/plugin/react-client/index.d.ts.map +1 -1
- package/dist/plugin/react-client/index.js +10 -1
- package/dist/plugin/react-client/plugin.d.ts +5 -3
- package/dist/plugin/react-client/plugin.d.ts.map +1 -1
- package/dist/plugin/react-client/plugin.js +9 -11
- package/dist/plugin/react-client/restartWorker.d.ts +5 -4
- package/dist/plugin/react-client/restartWorker.d.ts.map +1 -1
- package/dist/plugin/react-client/restartWorker.js +12 -10
- package/dist/plugin/react-server/configureReactServer.d.ts +5 -4
- package/dist/plugin/react-server/configureReactServer.d.ts.map +1 -1
- package/dist/plugin/react-server/configureReactServer.js +98 -43
- package/dist/plugin/react-server/handleServerAction.d.ts +3 -2
- package/dist/plugin/react-server/handleServerAction.d.ts.map +1 -1
- package/dist/plugin/react-server/handleServerAction.js +14 -20
- package/dist/plugin/react-server/plugin.d.ts +3 -4
- package/dist/plugin/react-server/plugin.d.ts.map +1 -1
- package/dist/plugin/react-server/plugin.js +14 -17
- package/dist/plugin/react-static/collectHtmlWorkerContent.d.ts +8 -6
- package/dist/plugin/react-static/collectHtmlWorkerContent.d.ts.map +1 -1
- package/dist/plugin/react-static/collectHtmlWorkerContent.js +4 -4
- package/dist/plugin/react-static/collectRscContent.d.ts +8 -6
- package/dist/plugin/react-static/collectRscContent.d.ts.map +1 -1
- package/dist/plugin/react-static/collectRscContent.js +4 -4
- package/dist/plugin/react-static/configurePreviewServer.d.ts +6 -4
- package/dist/plugin/react-static/configurePreviewServer.d.ts.map +1 -1
- package/dist/plugin/react-static/configurePreviewServer.js +38 -31
- package/dist/plugin/react-static/createBuildLoader.d.ts +5 -5
- package/dist/plugin/react-static/createBuildLoader.d.ts.map +1 -1
- package/dist/plugin/react-static/createBuildLoader.js +122 -30
- package/dist/plugin/react-static/fileWriter.js +1 -1
- package/dist/plugin/react-static/plugin.d.ts +3 -4
- package/dist/plugin/react-static/plugin.d.ts.map +1 -1
- package/dist/plugin/react-static/plugin.js +62 -47
- package/dist/plugin/react-static/renderPage.d.ts +4 -2
- package/dist/plugin/react-static/renderPage.d.ts.map +1 -1
- package/dist/plugin/react-static/renderPage.js +33 -17
- package/dist/plugin/react-static/renderPages.d.ts +4 -2
- package/dist/plugin/react-static/renderPages.d.ts.map +1 -1
- package/dist/plugin/react-static/renderPages.js +7 -6
- package/dist/plugin/react-static/renderStreams.d.ts +5 -22
- package/dist/plugin/react-static/renderStreams.d.ts.map +1 -1
- package/dist/plugin/react-static/renderStreams.js +6 -6
- package/dist/plugin/react-static/rscToHtmlStream.d.ts.map +1 -1
- package/dist/plugin/react-static/rscToHtmlStream.js +1 -1
- package/dist/plugin/react-static/temporaryReferences.js +1 -1
- package/dist/plugin/react-static/types.d.ts +0 -1
- package/dist/plugin/react-static/types.d.ts.map +1 -1
- package/dist/plugin/root.js +1 -1
- package/dist/plugin/transformer/plugin.js +1 -1
- package/dist/plugin/transformer/plugin.server.d.ts +5 -3
- package/dist/plugin/transformer/plugin.server.d.ts.map +1 -1
- package/dist/plugin/transformer/plugin.server.js +43 -44
- package/dist/plugin/types/css-tracking.d.ts +2 -2
- package/dist/plugin/types/css-tracking.d.ts.map +1 -1
- package/dist/plugin/types.d.ts +452 -192
- package/dist/plugin/types.d.ts.map +1 -1
- package/dist/plugin/types.js +2 -1
- package/dist/plugin/utils/callServer.js +1 -1
- package/dist/plugin/utils/createCallServer.d.ts +1 -1
- package/dist/plugin/utils/createCallServer.d.ts.map +1 -1
- package/dist/plugin/utils/createCallServer.js +1 -1
- package/dist/plugin/utils/createReactFetcher.d.ts +2 -3
- package/dist/plugin/utils/createReactFetcher.d.ts.map +1 -1
- package/dist/plugin/utils/createReactFetcher.js +1 -1
- package/dist/plugin/utils/env.js +1 -1
- package/dist/plugin/utils/envUrls.node.js +1 -1
- package/dist/plugin/utils/index.d.ts +1 -0
- package/dist/plugin/utils/index.d.ts.map +1 -1
- package/dist/plugin/utils/index.js +12 -5
- package/dist/plugin/utils/routeToURL.d.ts +12 -0
- package/dist/plugin/utils/routeToURL.d.ts.map +1 -0
- package/dist/plugin/utils/routeToURL.js +26 -0
- package/dist/plugin/utils/urls.d.ts.map +1 -1
- package/dist/plugin/utils/urls.js +5 -3
- package/dist/plugin/vendor/index.js +7 -1
- package/dist/plugin/vendor/vendor.client.js +1 -1
- package/dist/plugin/vendor/vendor.js +1 -1
- package/dist/plugin/vendor/vendor.server.js +1 -1
- package/dist/plugin/worker/createWorker.d.ts +31 -17
- package/dist/plugin/worker/createWorker.d.ts.map +1 -1
- package/dist/plugin/worker/createWorker.js +18 -12
- package/dist/plugin/worker/html/createHtmlWorkerRenderState.d.ts +2 -2
- package/dist/plugin/worker/html/createHtmlWorkerRenderState.d.ts.map +1 -1
- package/dist/plugin/worker/html/createHtmlWorkerRenderState.js +5 -2
- package/dist/plugin/worker/html/html-worker.development.js +3 -3
- package/dist/plugin/worker/html/html-worker.production.js +1 -1
- package/dist/plugin/worker/html/index.d.ts +1 -1
- package/dist/plugin/worker/html/index.d.ts.map +1 -1
- package/dist/plugin/worker/html/index.js +1 -1
- package/dist/plugin/worker/html/messageHandler.d.ts +1 -1
- package/dist/plugin/worker/html/messageHandler.d.ts.map +1 -1
- package/dist/plugin/worker/html/messageHandler.js +9 -11
- package/dist/plugin/worker/html/sendHtmlWorkerMessage.d.ts +3 -0
- package/dist/plugin/worker/html/sendHtmlWorkerMessage.d.ts.map +1 -0
- package/dist/plugin/worker/html/sendHtmlWorkerMessage.js +2 -0
- package/dist/plugin/worker/html/types.d.ts +20 -2
- package/dist/plugin/worker/html/types.d.ts.map +1 -1
- package/dist/plugin/worker/index.d.ts +3 -0
- package/dist/plugin/worker/index.d.ts.map +1 -0
- package/dist/plugin/worker/index.js +7 -0
- package/dist/plugin/worker/registerLoaders.js +2 -2
- package/dist/plugin/worker/rsc/handleRender.d.ts +4 -3
- package/dist/plugin/worker/rsc/handleRender.d.ts.map +1 -1
- package/dist/plugin/worker/rsc/handleRender.js +54 -32
- package/dist/plugin/worker/rsc/handlers.d.ts.map +1 -1
- package/dist/plugin/worker/rsc/handlers.js +19 -15
- package/dist/plugin/worker/rsc/index.d.ts +1 -1
- package/dist/plugin/worker/rsc/index.d.ts.map +1 -1
- package/dist/plugin/worker/rsc/index.js +1 -1
- package/dist/plugin/worker/rsc/messageHandler.d.ts +1 -1
- package/dist/plugin/worker/rsc/messageHandler.d.ts.map +1 -1
- package/dist/plugin/worker/rsc/messageHandler.js +16 -4
- package/dist/plugin/worker/rsc/rsc-worker.development.js +77 -11
- package/dist/plugin/worker/rsc/rsc-worker.production.js +1 -1
- package/dist/plugin/worker/rsc/sendRscWorkerMessage.d.ts +3 -0
- package/dist/plugin/worker/rsc/sendRscWorkerMessage.d.ts.map +1 -0
- package/dist/plugin/worker/rsc/sendRscWorkerMessage.js +11 -0
- package/dist/plugin/worker/rsc/state.js +1 -1
- package/dist/plugin/worker/rsc/types.d.ts +95 -0
- package/dist/plugin/worker/rsc/types.d.ts.map +1 -0
- package/dist/plugin/worker/rsc/types.js +1 -0
- package/dist/plugin/worker/rsc/userOptions.d.ts +1 -1
- package/dist/plugin/worker/rsc/userOptions.d.ts.map +1 -1
- package/dist/plugin/worker/rsc/userOptions.js +3 -4
- package/dist/plugin/worker/sendMessage.d.ts +3 -4
- package/dist/plugin/worker/sendMessage.d.ts.map +1 -1
- package/dist/plugin/worker/sendMessage.js +15 -5
- package/dist/plugin/worker/types.d.ts +109 -260
- package/dist/plugin/worker/types.d.ts.map +1 -1
- package/dist/server.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +58 -25
- package/plugin/components/{css-collector-elements.tsx → css.tsx} +3 -3
- package/plugin/components/html.tsx +4 -4
- package/plugin/components/index.ts +3 -3
- package/plugin/components/root.tsx +20 -0
- package/plugin/config/autoDiscover/resolveAutoDiscover.ts +173 -134
- package/plugin/config/autoDiscover/resolveBuildPages.ts +120 -7
- package/plugin/config/createModuleID.ts +60 -39
- package/plugin/config/defaults.tsx +184 -95
- package/plugin/config/extMap.ts +51 -56
- package/plugin/config/flightBindings.ts +221 -0
- package/plugin/config/getCondition.ts +6 -0
- package/plugin/config/index.ts +17 -4
- package/plugin/config/interpolatePattern.ts +19 -0
- package/plugin/config/parsePattern.ts +81 -0
- package/plugin/config/resolveAllowedDirectives.ts +59 -0
- package/plugin/config/resolveDirectiveMatcher.ts +57 -0
- package/plugin/config/resolveEnv.ts +5 -10
- package/plugin/config/resolveOptions.ts +415 -299
- package/plugin/config/resolvePatternWithValues.ts +70 -0
- package/plugin/config/resolveRegExp.ts +89 -0
- package/plugin/config/resolveUrlOption.ts +92 -20
- package/plugin/config/resolveUserConfig.ts +417 -351
- package/plugin/env/plugin.ts +71 -7
- package/plugin/error/directiveError.ts +29 -0
- package/plugin/error/enhanceError.ts +41 -0
- package/plugin/error/index.ts +3 -0
- package/plugin/error/logError.ts +45 -0
- package/plugin/error/serializeError.ts +34 -0
- package/plugin/error/toError.ts +75 -45
- package/plugin/file-preserver/plugin.ts +3 -3
- package/plugin/getNodeEnv.ts +24 -0
- package/plugin/helpers/cleanObject.ts +2 -1
- package/plugin/helpers/collectViteModuleGraphCss.ts +138 -118
- package/plugin/helpers/createCssProps.tsx +41 -20
- package/plugin/helpers/createEventHandler.ts +1 -1
- package/plugin/helpers/createHandler.ts +40 -12
- package/plugin/helpers/createRscStream.tsx +97 -35
- package/plugin/helpers/formatMetrics.ts +2 -37
- package/plugin/helpers/getBundleManifest.ts +10 -1
- package/plugin/helpers/getRouteFiles.ts +112 -8
- package/plugin/helpers/handleServerAction.ts +10 -6
- package/plugin/helpers/hydrateUserOptions.ts +23 -0
- package/plugin/helpers/index.ts +4 -0
- package/plugin/helpers/inputNormalizer.ts +44 -24
- package/plugin/helpers/metrics.ts +4 -64
- package/plugin/helpers/moduleResolver.ts +74 -19
- package/plugin/helpers/requestInfo.ts +72 -52
- package/plugin/helpers/requestToRoute.ts +38 -12
- package/plugin/helpers/resolveComponent.ts +173 -0
- package/plugin/helpers/resolveComponents.ts +185 -0
- package/plugin/helpers/resolvePage.ts +35 -29
- package/plugin/helpers/resolvePageAndProps.ts +82 -61
- package/plugin/helpers/resolveProps.ts +100 -37
- package/plugin/helpers/resolveUserComponents.ts +190 -0
- package/plugin/helpers/serializeUserOptions.ts +190 -69
- package/plugin/helpers/stashReturnValue.ts +7 -4
- package/plugin/helpers/tryManifest.ts +1 -1
- package/plugin/loader/createDefaultLoader.ts +119 -119
- package/plugin/loader/createTransformer.ts +118 -0
- package/plugin/loader/css-loader.ts +206 -0
- package/plugin/loader/directives/addLocalExportedNames.ts +78 -0
- package/plugin/loader/directives/analyzeDirectives.ts +298 -0
- package/plugin/loader/directives/analyzeModule.ts +39 -0
- package/plugin/loader/directives/collectExports.ts +181 -0
- package/plugin/loader/directives/collectExportsFromModule.ts +25 -0
- package/plugin/loader/directives/findDirectiveMatches.ts +58 -0
- package/plugin/loader/directives/getExportedName.ts +73 -0
- package/plugin/loader/directives/getExports.ts +27 -0
- package/plugin/loader/directives/getFunctionBody.ts +32 -0
- package/plugin/loader/directives/getFunctionName.ts +70 -0
- package/plugin/loader/directives/getQualifiedName.ts +76 -0
- package/plugin/loader/directives/index.ts +13 -0
- package/plugin/loader/directives/processFunctionNode.ts +97 -0
- package/plugin/loader/directives/typeGuards.ts +160 -0
- package/plugin/loader/directives/types.ts +174 -0
- package/plugin/loader/directives/utils.ts +35 -0
- package/plugin/loader/{env-loader.development.ts → env-loader.ts} +8 -22
- package/plugin/loader/index.ts +8 -6
- package/plugin/loader/parse.ts +42 -12
- package/plugin/loader/react-loader.ts +255 -4
- package/plugin/loader/removeDirectives.ts +14 -0
- package/plugin/loader/removeRanges.ts +21 -0
- package/plugin/loader/sourceMap.ts +174 -84
- package/plugin/loader/transformClientModule.ts +64 -0
- package/plugin/loader/transformModule.ts +54 -0
- package/plugin/loader/transformModuleIfNeeded.ts +40 -40
- package/plugin/loader/transformServerModule.ts +136 -0
- package/plugin/loader/transformWithAcornLoose.ts +27 -0
- package/plugin/loader/types.ts +65 -13
- package/plugin/metrics/collectStreamMetrics.ts +38 -0
- package/plugin/metrics/createRenderMetrics.ts +17 -0
- package/plugin/metrics/createStreamMetrics.ts +14 -0
- package/plugin/metrics/formatMetrics.ts +7 -3
- package/plugin/metrics/index.ts +3 -1
- package/plugin/metrics/types.ts +24 -0
- package/plugin/plugin.client.ts +39 -15
- package/plugin/plugin.server.ts +39 -18
- package/plugin/preserver/plugin.ts +42 -42
- package/plugin/react-client/cleanupWorkerServerAction.ts +33 -0
- package/plugin/react-client/configureWorkerRequestHandler.ts +212 -201
- package/plugin/react-client/createMessageHandlers.ts +17 -3
- package/plugin/react-client/createWorkerStream.ts +55 -51
- package/plugin/react-client/handleWorkerRscStream.ts +141 -61
- package/plugin/react-client/handleWorkerServerAction.ts +59 -37
- package/plugin/react-client/index.ts +4 -1
- package/plugin/react-client/plugin.ts +17 -18
- package/plugin/react-client/restartWorker.ts +75 -70
- package/plugin/react-server/configureReactServer.ts +200 -142
- package/plugin/react-server/handleServerAction.ts +156 -160
- package/plugin/react-server/plugin.ts +18 -25
- package/plugin/react-static/collectHtmlWorkerContent.ts +109 -102
- package/plugin/react-static/collectRscContent.ts +55 -51
- package/plugin/react-static/configurePreviewServer.ts +110 -100
- package/plugin/react-static/createBuildLoader.ts +157 -48
- package/plugin/react-static/plugin.ts +368 -357
- package/plugin/react-static/renderPage.ts +43 -24
- package/plugin/react-static/renderPages.ts +21 -14
- package/plugin/react-static/renderStreams.ts +13 -15
- package/plugin/react-static/rscToHtmlStream.ts +4 -6
- package/plugin/react-static/types.ts +0 -3
- package/plugin/transformer/README.md +82 -8
- package/plugin/transformer/plugin.server.ts +55 -82
- package/plugin/types/css-tracking.ts +1 -1
- package/plugin/types/global.d.ts +2 -2
- package/plugin/types/react-server-dom-esm.d.ts +12 -13
- package/plugin/types.ts +685 -309
- package/plugin/utils/createCallServer.ts +5 -5
- package/plugin/utils/createReactFetcher.ts +4 -6
- package/plugin/utils/index.ts +2 -1
- package/plugin/utils/routeToURL.ts +34 -0
- package/plugin/utils/urls.ts +9 -6
- package/plugin/worker/createWorker.ts +67 -34
- package/plugin/worker/html/README.md +10 -0
- package/plugin/worker/html/createHtmlWorkerRenderState.tsx +7 -4
- package/plugin/worker/html/html-worker.development.tsx +4 -3
- package/plugin/worker/html/index.ts +3 -1
- package/plugin/worker/html/messageHandler.tsx +10 -16
- package/plugin/worker/html/sendHtmlWorkerMessage.ts +8 -0
- package/plugin/worker/html/types.ts +67 -1
- package/plugin/worker/index.ts +2 -0
- package/plugin/worker/registerLoaders.ts +3 -3
- package/plugin/worker/rsc/README.md +203 -1
- package/plugin/worker/rsc/handleRender.ts +76 -39
- package/plugin/worker/rsc/handlers.ts +30 -22
- package/plugin/worker/rsc/index.ts +2 -0
- package/plugin/worker/rsc/messageHandler.tsx +17 -10
- package/plugin/worker/rsc/rsc-worker.development.ts +104 -17
- package/plugin/worker/rsc/sendRscWorkerMessage.ts +7 -0
- package/plugin/worker/rsc/state.ts +1 -1
- package/plugin/worker/rsc/types.ts +185 -0
- package/plugin/worker/rsc/userOptions.ts +2 -3
- package/plugin/worker/sendMessage.ts +23 -14
- package/plugin/worker/types.ts +131 -386
- package/scripts/check-react-version.mjs +3 -3
- package/scripts/fix-unused-imports.mjs +77 -0
- package/tsconfig.json +1 -1
- package/dist/_virtual/dynamic-import-helper.js.map +0 -1
- package/dist/client.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/plugin/components/css-collector-elements.d.ts.map +0 -1
- package/dist/plugin/components/css-collector-elements.js +0 -33
- package/dist/plugin/components/css-collector-elements.js.map +0 -1
- package/dist/plugin/components/css-collector.d.ts +0 -7
- package/dist/plugin/components/css-collector.d.ts.map +0 -1
- package/dist/plugin/components/css-collector.js +0 -18
- package/dist/plugin/components/css-collector.js.map +0 -1
- package/dist/plugin/components/html.js.map +0 -1
- package/dist/plugin/components.js +0 -9
- package/dist/plugin/components.js.map +0 -1
- package/dist/plugin/config/autoDiscover/createGlobAutoDiscover.js.map +0 -1
- package/dist/plugin/config/autoDiscover/customWorkerFiles.js.map +0 -1
- package/dist/plugin/config/autoDiscover/pageAndPropFiles.js.map +0 -1
- package/dist/plugin/config/autoDiscover/resolveAutoDiscover.js.map +0 -1
- package/dist/plugin/config/autoDiscover/resolveBuildPages.js.map +0 -1
- package/dist/plugin/config/defaults.js.map +0 -1
- package/dist/plugin/config/extMap.js.map +0 -1
- package/dist/plugin/config/getCondition.js.map +0 -1
- package/dist/plugin/config/getPaths.js.map +0 -1
- package/dist/plugin/config/mimeTypes.js.map +0 -1
- package/dist/plugin/config/resolveAutoDiscoverMatcher.d.ts +0 -5
- package/dist/plugin/config/resolveAutoDiscoverMatcher.d.ts.map +0 -1
- package/dist/plugin/config/resolveAutoDiscoverMatcher.js +0 -25
- package/dist/plugin/config/resolveAutoDiscoverMatcher.js.map +0 -1
- package/dist/plugin/config/resolveEnv.js.map +0 -1
- package/dist/plugin/config/resolveOptions.js.map +0 -1
- package/dist/plugin/config/resolvePages.js.map +0 -1
- package/dist/plugin/config/resolveUrlOption.js.map +0 -1
- package/dist/plugin/config/resolveUserConfig.js.map +0 -1
- package/dist/plugin/config.js +0 -17
- package/dist/plugin/config.js.map +0 -1
- package/dist/plugin/env.js +0 -79
- package/dist/plugin/env.js.map +0 -1
- package/dist/plugin/error/toError.js.map +0 -1
- package/dist/plugin/file-preserver.js +0 -96
- package/dist/plugin/file-preserver.js.map +0 -1
- package/dist/plugin/helpers/cleanObject.js.map +0 -1
- package/dist/plugin/helpers/collectManifestCss.js.map +0 -1
- package/dist/plugin/helpers/collectViteModuleGraphCss.js.map +0 -1
- package/dist/plugin/helpers/createCssProps.js.map +0 -1
- package/dist/plugin/helpers/createEventHandler.js.map +0 -1
- package/dist/plugin/helpers/createHandler.js.map +0 -1
- package/dist/plugin/helpers/createRscStream.js.map +0 -1
- package/dist/plugin/helpers/formatMetrics.js.map +0 -1
- package/dist/plugin/helpers/getBundleManifest.js.map +0 -1
- package/dist/plugin/helpers/getRouteFiles.js.map +0 -1
- package/dist/plugin/helpers/handleServerAction.js.map +0 -1
- package/dist/plugin/helpers/inputNormalizer.js.map +0 -1
- package/dist/plugin/helpers/metrics.js.map +0 -1
- package/dist/plugin/helpers/moduleRefs.js.map +0 -1
- package/dist/plugin/helpers/requestInfo.js.map +0 -1
- package/dist/plugin/helpers/requestToRoute.js.map +0 -1
- package/dist/plugin/helpers/resolvePage.js.map +0 -1
- package/dist/plugin/helpers/resolvePageAndProps.js.map +0 -1
- package/dist/plugin/helpers/resolveProps.js.map +0 -1
- package/dist/plugin/helpers/serializeUserOptions.js.map +0 -1
- package/dist/plugin/helpers/sourceMap.d.ts +0 -8
- package/dist/plugin/helpers/sourceMap.d.ts.map +0 -1
- package/dist/plugin/helpers/sourceMap.js +0 -136
- package/dist/plugin/helpers/stashReturnValue.js.map +0 -1
- package/dist/plugin/helpers/tryManifest.js.map +0 -1
- package/dist/plugin/helpers.js +0 -27
- package/dist/plugin/helpers.js.map +0 -1
- package/dist/plugin/loader/css-loader.development.d.ts.map +0 -1
- package/dist/plugin/loader/css-loader.development.js +0 -76
- package/dist/plugin/loader/css-loader.development.js.map +0 -1
- package/dist/plugin/loader/css-loader.production.d.ts +0 -31
- package/dist/plugin/loader/css-loader.production.d.ts.map +0 -1
- package/dist/plugin/loader/css-loader.production.js +0 -45
- package/dist/plugin/loader/css-loader.production.js.map +0 -1
- package/dist/plugin/loader/env-loader.development.d.ts +0 -13
- package/dist/plugin/loader/env-loader.development.d.ts.map +0 -1
- package/dist/plugin/loader/env-loader.development.js +0 -68
- package/dist/plugin/loader/handleExports.d.ts +0 -40
- package/dist/plugin/loader/handleExports.d.ts.map +0 -1
- package/dist/plugin/loader/handleExports.js +0 -209
- package/dist/plugin/loader/handleExports.js.map +0 -1
- package/dist/plugin/loader/parse.js.map +0 -1
- package/dist/plugin/loader/react-loader.client.d.ts +0 -2
- package/dist/plugin/loader/react-loader.client.d.ts.map +0 -1
- package/dist/plugin/loader/react-loader.client.js +0 -2
- package/dist/plugin/loader/react-loader.js.map +0 -1
- package/dist/plugin/loader/react-loader.server.d.ts +0 -21
- package/dist/plugin/loader/react-loader.server.d.ts.map +0 -1
- package/dist/plugin/loader/react-loader.server.js +0 -131
- package/dist/plugin/loader/transformModuleIfNeeded.js.map +0 -1
- package/dist/plugin/loader/transformModuleWithPreservedFunctions.d.ts +0 -48
- package/dist/plugin/loader/transformModuleWithPreservedFunctions.d.ts.map +0 -1
- package/dist/plugin/loader/transformModuleWithPreservedFunctions.js +0 -431
- package/dist/plugin/loader/transformModuleWithPreservedFunctions.js.map +0 -1
- package/dist/plugin/metrics/formatMetrics.js.map +0 -1
- package/dist/plugin/metrics.js +0 -7
- package/dist/plugin/metrics.js.map +0 -1
- package/dist/plugin/plugin.client.js.map +0 -1
- package/dist/plugin/plugin.server.js.map +0 -1
- package/dist/plugin/preserver/plugin.js.map +0 -1
- package/dist/plugin/react-client/configureWorkerRequestHandler.js.map +0 -1
- package/dist/plugin/react-client/createMessageHandlers.js.map +0 -1
- package/dist/plugin/react-client/createWorkerStream.js.map +0 -1
- package/dist/plugin/react-client/handleWorkerRscStream.js.map +0 -1
- package/dist/plugin/react-client/handleWorkerServerAction.js.map +0 -1
- package/dist/plugin/react-client/plugin.js.map +0 -1
- package/dist/plugin/react-client/restartWorker.js.map +0 -1
- package/dist/plugin/react-server/configureReactServer.js.map +0 -1
- package/dist/plugin/react-server/handleServerAction.js.map +0 -1
- package/dist/plugin/react-server/plugin.js.map +0 -1
- package/dist/plugin/react-static/collectHtmlWorkerContent.js.map +0 -1
- package/dist/plugin/react-static/collectRscContent.js.map +0 -1
- package/dist/plugin/react-static/configurePreviewServer.js.map +0 -1
- package/dist/plugin/react-static/createBuildLoader.js.map +0 -1
- package/dist/plugin/react-static/fileWriter.js.map +0 -1
- package/dist/plugin/react-static/plugin.js.map +0 -1
- package/dist/plugin/react-static/renderPage.js.map +0 -1
- package/dist/plugin/react-static/renderPages.js.map +0 -1
- package/dist/plugin/react-static/renderStreams.js.map +0 -1
- package/dist/plugin/react-static/rscToHtmlStream.js.map +0 -1
- package/dist/plugin/react-static/temporaryReferences.js.map +0 -1
- package/dist/plugin/root.js.map +0 -1
- package/dist/plugin/source-map/createMappingsSerializer.d.ts +0 -2
- package/dist/plugin/source-map/createMappingsSerializer.d.ts.map +0 -1
- package/dist/plugin/source-map/createMappingsSerializer.js +0 -129
- package/dist/plugin/source-map/createMappingsSerializer.js.map +0 -1
- package/dist/plugin/source-map/readMappings.d.ts +0 -2
- package/dist/plugin/source-map/readMappings.d.ts.map +0 -1
- package/dist/plugin/source-map/readMappings.js +0 -200
- package/dist/plugin/transformer/plugin.client.d.ts +0 -2
- package/dist/plugin/transformer/plugin.client.d.ts.map +0 -1
- package/dist/plugin/transformer/plugin.js.map +0 -1
- package/dist/plugin/transformer/plugin.server.js.map +0 -1
- package/dist/plugin/utils/callServer.js.map +0 -1
- package/dist/plugin/utils/createCallServer.js.map +0 -1
- package/dist/plugin/utils/createReactFetcher.js.map +0 -1
- package/dist/plugin/utils/env.js.map +0 -1
- package/dist/plugin/utils/envUrls.node.js.map +0 -1
- package/dist/plugin/utils/urls.js.map +0 -1
- package/dist/plugin/utils.js +0 -11
- package/dist/plugin/utils.js.map +0 -1
- package/dist/plugin/vendor/vendor.client.js.map +0 -1
- package/dist/plugin/vendor/vendor.js.map +0 -1
- package/dist/plugin/vendor/vendor.server.js.map +0 -1
- package/dist/plugin/vendor.js +0 -7
- package/dist/plugin/vendor.js.map +0 -1
- package/dist/plugin/worker/createWorker.js.map +0 -1
- package/dist/plugin/worker/html/createHtmlWorkerRenderState.js.map +0 -1
- package/dist/plugin/worker/html/html-worker.development.js.map +0 -1
- package/dist/plugin/worker/html/html-worker.production.js.map +0 -1
- package/dist/plugin/worker/html/index.js.map +0 -1
- package/dist/plugin/worker/html/messageHandler.js.map +0 -1
- package/dist/plugin/worker/rsc/handleRender.js.map +0 -1
- package/dist/plugin/worker/rsc/handlers.js.map +0 -1
- package/dist/plugin/worker/rsc/index.js.map +0 -1
- package/dist/plugin/worker/rsc/messageHandler.js.map +0 -1
- package/dist/plugin/worker/rsc/rsc-worker.development.js.map +0 -1
- package/dist/plugin/worker/rsc/rsc-worker.production.js.map +0 -1
- package/dist/plugin/worker/rsc/state.js.map +0 -1
- package/dist/plugin/worker/rsc/userOptions.js.map +0 -1
- package/dist/plugin/worker/sendMessage.js.map +0 -1
- package/dist/server.js.map +0 -1
- package/plugin/components/css-collector.tsx +0 -20
- package/plugin/config/resolveAutoDiscoverMatcher.ts +0 -23
- package/plugin/helpers/sourceMap.ts +0 -182
- package/plugin/loader/css-loader.development.ts +0 -135
- package/plugin/loader/css-loader.production.ts +0 -84
- package/plugin/loader/handleExports.ts +0 -309
- package/plugin/loader/react-loader.client.ts +0 -1
- package/plugin/loader/react-loader.server.ts +0 -185
- package/plugin/loader/transformModuleWithPreservedFunctions.ts +0 -596
- package/plugin/source-map/createMappingsSerializer.ts +0 -181
- package/plugin/source-map/readMappings.ts +0 -194
- package/plugin/transformer/plugin.client.ts +0 -0
- /package/dist/plugin/{transformer/plugin.client.js → loader/directives/types.js} +0 -0
|
@@ -3,16 +3,37 @@ import type { PreRenderedChunk } from "rollup";
|
|
|
3
3
|
import type {
|
|
4
4
|
StreamPluginOptions,
|
|
5
5
|
ResolvedUserOptions,
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
PageName,
|
|
7
|
+
PropsName,
|
|
8
|
+
HtmlName,
|
|
9
|
+
RootName,
|
|
8
10
|
} from "../types.js";
|
|
9
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
BASE_PATTERNS,
|
|
13
|
+
DEFAULT_CONFIG,
|
|
14
|
+
DEFAULT_LOADER_CONFIG,
|
|
15
|
+
} from "./defaults.js";
|
|
10
16
|
import { join } from "node:path";
|
|
11
17
|
import { pluginRoot } from "../root.js";
|
|
12
|
-
import { CssCollector } from "../components/css-collector.js";
|
|
13
18
|
import { createInputNormalizer } from "../helpers/inputNormalizer.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
19
|
+
import { getNodeEnv } from "../getNodeEnv.js";
|
|
20
|
+
import { resolveDirectiveMatcher } from "./resolveDirectiveMatcher.js";
|
|
21
|
+
import { resolveAllowedDirectives } from "./resolveAllowedDirectives.js";
|
|
22
|
+
import { resolveRegExp } from "./resolveRegExp.js";
|
|
23
|
+
import { parse } from "../loader/parse.js";
|
|
24
|
+
|
|
25
|
+
export type ResolveOptionsReturn =
|
|
26
|
+
| {
|
|
27
|
+
type: "success";
|
|
28
|
+
userOptions: ResolvedUserOptions;
|
|
29
|
+
error?: never;
|
|
30
|
+
}
|
|
31
|
+
| { type: "error"; error: Error; userOptions?: never };
|
|
32
|
+
|
|
33
|
+
export type ResolveOptionsFn = (
|
|
34
|
+
options: StreamPluginOptions
|
|
35
|
+
) => ResolveOptionsReturn;
|
|
36
|
+
|
|
16
37
|
// /**
|
|
17
38
|
// * Ensures a path ends with .js extension
|
|
18
39
|
// */
|
|
@@ -31,18 +52,23 @@ const handleSearchQuery = (path: string) => {
|
|
|
31
52
|
if (!searchQuery) return path;
|
|
32
53
|
const folder = path.split("/").slice(0, -1).join("/");
|
|
33
54
|
const filename = path.split("/").pop();
|
|
34
|
-
|
|
55
|
+
const fileNameExtIndex = filename?.lastIndexOf(".");
|
|
56
|
+
const fileNameWithoutExt = filename?.slice(0, fileNameExtIndex);
|
|
57
|
+
const extension = filename?.slice(fileNameExtIndex);
|
|
58
|
+
return `${folder}/${fileNameWithoutExt}.${searchQuery}.${extension}`;
|
|
35
59
|
};
|
|
36
60
|
|
|
37
61
|
/**
|
|
38
|
-
*
|
|
62
|
+
* Registers a path with an optional pattern matcher and extension.
|
|
63
|
+
* If a pattern matches and the path doesn't end with the extension, the extension is appended.
|
|
64
|
+
*
|
|
65
|
+
* @param path - The path to register
|
|
66
|
+
* @param pattern - Optional pattern matcher function that returns true if the path matches
|
|
67
|
+
* @param ext - Optional extension to append if pattern matches and path doesn't already end with it
|
|
39
68
|
*/
|
|
40
|
-
const registerPath = (
|
|
41
|
-
path
|
|
42
|
-
|
|
43
|
-
ext?: string | undefined
|
|
44
|
-
) => {
|
|
45
|
-
if (ext && !path.endsWith(ext)) {
|
|
69
|
+
const registerPath = (path: string, pattern?: RegExp, ext?: string) => {
|
|
70
|
+
// If we have a pattern and it doesn't match, or we have an extension and the path doesn't end with it, append the extension
|
|
71
|
+
if ((pattern && !pattern.test(path)) || (ext && !path.endsWith(ext))) {
|
|
46
72
|
return path + ext;
|
|
47
73
|
}
|
|
48
74
|
return path;
|
|
@@ -52,14 +78,28 @@ const registerPath = (
|
|
|
52
78
|
// Main Options Resolver
|
|
53
79
|
// ============================================================================
|
|
54
80
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
81
|
+
const stashedUserOptions: Record<string, ResolvedUserOptions | null> = {};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Resolves the user options for the plugin.
|
|
85
|
+
*
|
|
86
|
+
* @param options - The user options to resolve.
|
|
87
|
+
* @returns The resolved options.
|
|
88
|
+
*/
|
|
89
|
+
export const resolveOptions: ResolveOptionsFn = function _resolveOptions(
|
|
90
|
+
options
|
|
91
|
+
) {
|
|
92
|
+
const envId = process.env.NODE_ENV ?? "development";
|
|
93
|
+
|
|
94
|
+
// Return stashed options if available
|
|
95
|
+
if (stashedUserOptions[envId]) {
|
|
96
|
+
return {
|
|
97
|
+
type: "success",
|
|
98
|
+
userOptions: stashedUserOptions[envId] as never,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const loaderMode = options.loader?.mode ?? getNodeEnv();
|
|
63
103
|
// Module path configuration
|
|
64
104
|
const moduleBase =
|
|
65
105
|
typeof options.moduleBase === "string"
|
|
@@ -79,32 +119,21 @@ export const resolveOptions = <
|
|
|
79
119
|
process.env["VITE_PROD"] === "1";
|
|
80
120
|
const prodModuleBase = isProd && preserveModulesRoot ? moduleBase : undefined;
|
|
81
121
|
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
: Array.isArray(options.build?.pages)
|
|
92
|
-
? options.build.pages
|
|
93
|
-
: DEFAULT_CONFIG.BUILD.pages;
|
|
94
|
-
|
|
95
|
-
let client = options.build?.client ?? DEFAULT_CONFIG.BUILD.client;
|
|
96
|
-
let server = options.build?.server ?? DEFAULT_CONFIG.BUILD.server;
|
|
97
|
-
const api = options.build?.api ?? DEFAULT_CONFIG.BUILD.api;
|
|
98
|
-
const staticBuild = options.build?.static ?? DEFAULT_CONFIG.BUILD.static;
|
|
99
|
-
const outDir = options.build?.outDir ?? DEFAULT_CONFIG.BUILD.outDir;
|
|
100
|
-
const assetsDir =
|
|
101
|
-
options.build?.assetsDir ?? `${DEFAULT_CONFIG.CLIENT_ASSETS_DIR}`;
|
|
122
|
+
const client =
|
|
123
|
+
typeof options.build?.client === "string"
|
|
124
|
+
? options.build.client
|
|
125
|
+
: DEFAULT_CONFIG.BUILD.client;
|
|
126
|
+
|
|
127
|
+
const outDir =
|
|
128
|
+
typeof options.build?.outDir === "string"
|
|
129
|
+
? options.build.outDir
|
|
130
|
+
: DEFAULT_CONFIG.BUILD.outDir;
|
|
102
131
|
|
|
103
132
|
const moduleBasePath =
|
|
104
133
|
typeof options.moduleBasePath === "string"
|
|
105
134
|
? options.moduleBasePath
|
|
106
135
|
: process.env.VITE_BASE_URL ?? DEFAULT_CONFIG.MODULE_BASE_PATH;
|
|
107
|
-
|
|
136
|
+
|
|
108
137
|
const moduleBaseURL =
|
|
109
138
|
typeof options.moduleBaseURL === "string"
|
|
110
139
|
? options.moduleBaseURL
|
|
@@ -135,6 +164,46 @@ export const resolveOptions = <
|
|
|
135
164
|
typeof options.loaderPath === "string"
|
|
136
165
|
? join(projectRoot, options.loaderPath)
|
|
137
166
|
: join(pluginRoot, DEFAULT_CONFIG.LOADER_PATH);
|
|
167
|
+
|
|
168
|
+
const preserveDirectives =
|
|
169
|
+
typeof options.build?.preserveDirectives === "boolean"
|
|
170
|
+
? options.build.preserveDirectives
|
|
171
|
+
: DEFAULT_CONFIG.BUILD.preserveDirectives;
|
|
172
|
+
|
|
173
|
+
const jsExtension =
|
|
174
|
+
typeof options.build?.jsExtension === "string"
|
|
175
|
+
? options.build.jsExtension
|
|
176
|
+
: DEFAULT_CONFIG.BUILD.jsExtension;
|
|
177
|
+
const cssExtension =
|
|
178
|
+
typeof options.build?.cssExtension === "string"
|
|
179
|
+
? options.build.cssExtension
|
|
180
|
+
: DEFAULT_CONFIG.BUILD.cssExtension;
|
|
181
|
+
const cssModuleExtension =
|
|
182
|
+
typeof options.build?.cssModuleExtension === "string"
|
|
183
|
+
? options.build.cssModuleExtension
|
|
184
|
+
: DEFAULT_CONFIG.BUILD.cssModuleExtension;
|
|
185
|
+
const htmlExtension =
|
|
186
|
+
typeof options.build?.htmlExtension === "string"
|
|
187
|
+
? options.build.htmlExtension
|
|
188
|
+
: DEFAULT_CONFIG.BUILD.htmlExtension;
|
|
189
|
+
const jsonExtension =
|
|
190
|
+
typeof options.build?.jsonExtension === "string"
|
|
191
|
+
? options.build.jsonExtension
|
|
192
|
+
: DEFAULT_CONFIG.BUILD.jsonExtension;
|
|
193
|
+
const rscExtension =
|
|
194
|
+
typeof options.build?.rscExtension === "string"
|
|
195
|
+
? options.build.rscExtension
|
|
196
|
+
: DEFAULT_CONFIG.BUILD.rscExtension;
|
|
197
|
+
|
|
198
|
+
const rscOutputPath =
|
|
199
|
+
typeof options.build?.rscOutputPath === "string"
|
|
200
|
+
? options.build.rscOutputPath
|
|
201
|
+
: DEFAULT_CONFIG.BUILD.rscOutputPath;
|
|
202
|
+
const htmlOutputPath =
|
|
203
|
+
typeof options.build?.htmlOutputPath === "string"
|
|
204
|
+
? options.build.htmlOutputPath
|
|
205
|
+
: DEFAULT_CONFIG.BUILD.htmlOutputPath;
|
|
206
|
+
|
|
138
207
|
// these will never be cleaned up, because, we are resolving the user options
|
|
139
208
|
// and it's assumed they are relevant until the process stops
|
|
140
209
|
if (process.env.VITE_BASE_URL !== moduleBaseURL) {
|
|
@@ -144,113 +213,99 @@ export const resolveOptions = <
|
|
|
144
213
|
process.env.VITE_PUBLIC_ORIGIN = publicOrigin;
|
|
145
214
|
}
|
|
146
215
|
|
|
147
|
-
const
|
|
148
|
-
options.autoDiscover?.moduleExtension,
|
|
149
|
-
DEFAULT_CONFIG.AUTO_DISCOVER.moduleExtension
|
|
150
|
-
);
|
|
151
|
-
// Auto-discovery pattern matchers
|
|
152
|
-
const modulePattern = resolveAutoDiscoverMatcher(
|
|
216
|
+
const modulePattern = resolveRegExp(
|
|
153
217
|
options.autoDiscover?.modulePattern,
|
|
154
|
-
|
|
155
|
-
? (id: string) => moduleExtension(id.toLowerCase())
|
|
156
|
-
: DEFAULT_CONFIG.AUTO_DISCOVER.modulePattern
|
|
218
|
+
DEFAULT_CONFIG.AUTO_DISCOVER.modulePattern
|
|
157
219
|
);
|
|
158
220
|
|
|
159
|
-
const jsonPattern =
|
|
221
|
+
const jsonPattern = resolveRegExp(
|
|
160
222
|
options.autoDiscover?.jsonPattern,
|
|
161
223
|
DEFAULT_CONFIG.AUTO_DISCOVER.jsonPattern
|
|
162
224
|
);
|
|
163
225
|
|
|
164
|
-
const cssPattern =
|
|
226
|
+
const cssPattern = resolveRegExp(
|
|
165
227
|
options.autoDiscover?.cssPattern,
|
|
166
228
|
DEFAULT_CONFIG.AUTO_DISCOVER.cssPattern
|
|
167
229
|
);
|
|
168
230
|
|
|
169
|
-
const
|
|
231
|
+
const htmlPattern = resolveRegExp(
|
|
170
232
|
options.autoDiscover?.htmlPattern,
|
|
171
233
|
DEFAULT_CONFIG.AUTO_DISCOVER.htmlPattern
|
|
172
234
|
);
|
|
173
235
|
|
|
174
|
-
const
|
|
236
|
+
const rscPattern = resolveRegExp(
|
|
175
237
|
options.autoDiscover?.rscPattern,
|
|
176
238
|
DEFAULT_CONFIG.AUTO_DISCOVER.rscPattern
|
|
177
239
|
);
|
|
178
240
|
|
|
179
|
-
const
|
|
180
|
-
options.autoDiscover?.
|
|
181
|
-
|
|
182
|
-
? (id: string) => /(\.|\/)?client(\.|\/)?/.test(id.toLowerCase())
|
|
183
|
-
: DEFAULT_CONFIG.AUTO_DISCOVER.clientComponents
|
|
241
|
+
const clientPattern = resolveRegExp(
|
|
242
|
+
options.autoDiscover?.clientPattern,
|
|
243
|
+
DEFAULT_CONFIG.AUTO_DISCOVER.clientPattern
|
|
184
244
|
);
|
|
185
245
|
|
|
186
|
-
const
|
|
187
|
-
options.autoDiscover?.
|
|
188
|
-
|
|
189
|
-
? (id: string) => /(\.|\/)?server(\.|\/)?/.test(id.toLowerCase())
|
|
190
|
-
: DEFAULT_CONFIG.AUTO_DISCOVER.serverFunctions
|
|
246
|
+
const serverPattern = resolveRegExp(
|
|
247
|
+
options.autoDiscover?.serverPattern,
|
|
248
|
+
DEFAULT_CONFIG.AUTO_DISCOVER.serverPattern
|
|
191
249
|
);
|
|
192
250
|
|
|
193
|
-
const
|
|
194
|
-
options.autoDiscover?.
|
|
251
|
+
const nodePattern = resolveRegExp(
|
|
252
|
+
options.autoDiscover?.nodePattern,
|
|
195
253
|
DEFAULT_CONFIG.AUTO_DISCOVER.nodeOnly
|
|
196
254
|
);
|
|
197
255
|
|
|
198
|
-
const propsPattern =
|
|
256
|
+
const propsPattern = resolveRegExp(
|
|
199
257
|
options.autoDiscover?.propsPattern,
|
|
200
|
-
|
|
201
|
-
? (id: string) =>
|
|
202
|
-
moduleExtension(id.toLowerCase()) &&
|
|
203
|
-
/(\.|\/)?props(\.|\/)/.test(id.toLowerCase())
|
|
204
|
-
: DEFAULT_CONFIG.AUTO_DISCOVER.propsPattern
|
|
258
|
+
DEFAULT_CONFIG.AUTO_DISCOVER.propsPattern
|
|
205
259
|
);
|
|
206
260
|
|
|
207
|
-
const pagePattern =
|
|
261
|
+
const pagePattern = resolveRegExp(
|
|
208
262
|
options.autoDiscover?.pagePattern,
|
|
209
|
-
|
|
210
|
-
? (id: string) =>
|
|
211
|
-
moduleExtension(id.toLowerCase()) &&
|
|
212
|
-
/(\.|\/)?page(\.|\/)/.test(id.toLowerCase())
|
|
213
|
-
: DEFAULT_CONFIG.AUTO_DISCOVER.pagePattern
|
|
263
|
+
DEFAULT_CONFIG.AUTO_DISCOVER.pagePattern
|
|
214
264
|
);
|
|
215
265
|
|
|
216
|
-
const cssModulePattern =
|
|
266
|
+
const cssModulePattern = resolveRegExp(
|
|
217
267
|
options.autoDiscover?.cssModulePattern,
|
|
218
268
|
DEFAULT_CONFIG.AUTO_DISCOVER.cssModulePattern
|
|
219
269
|
);
|
|
220
270
|
|
|
221
|
-
const vendorPattern =
|
|
271
|
+
const vendorPattern = resolveRegExp(
|
|
222
272
|
options.autoDiscover?.vendorPattern,
|
|
223
273
|
DEFAULT_CONFIG.AUTO_DISCOVER.vendorPattern
|
|
224
274
|
);
|
|
225
275
|
|
|
226
|
-
const virtualPattern =
|
|
276
|
+
const virtualPattern = resolveRegExp(
|
|
227
277
|
options.autoDiscover?.virtualPattern,
|
|
228
278
|
DEFAULT_CONFIG.AUTO_DISCOVER.virtualPattern
|
|
229
279
|
);
|
|
230
280
|
|
|
231
|
-
const
|
|
232
|
-
options.autoDiscover?.
|
|
233
|
-
|
|
281
|
+
const dotPattern = resolveRegExp(
|
|
282
|
+
options.autoDiscover?.dotPattern,
|
|
283
|
+
BASE_PATTERNS.DOT_FILES
|
|
234
284
|
);
|
|
235
285
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
options.
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
286
|
+
/** Loader options */
|
|
287
|
+
const serverDirective = resolveRegExp(
|
|
288
|
+
options.loader?.serverDirective,
|
|
289
|
+
DEFAULT_LOADER_CONFIG.serverDirective
|
|
290
|
+
);
|
|
291
|
+
const clientDirective = resolveRegExp(
|
|
292
|
+
options.loader?.clientDirective,
|
|
293
|
+
DEFAULT_LOADER_CONFIG.clientDirective
|
|
294
|
+
);
|
|
295
|
+
const isServerFunctionCode = resolveDirectiveMatcher(
|
|
296
|
+
serverDirective,
|
|
297
|
+
(code: string, moduleId?: string) =>
|
|
298
|
+
code.match(serverDirective) != null ||
|
|
299
|
+
(typeof moduleId === "string" && serverPattern.test(moduleId)) ||
|
|
300
|
+
false
|
|
244
301
|
);
|
|
245
302
|
|
|
246
|
-
const isClientComponentCode =
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
false
|
|
253
|
-
: DEFAULT_CONFIG.AUTO_DISCOVER.isClientComponentCode
|
|
303
|
+
const isClientComponentCode = resolveDirectiveMatcher(
|
|
304
|
+
clientDirective,
|
|
305
|
+
(code: string, moduleId?: string) =>
|
|
306
|
+
code.match(clientDirective) != null ||
|
|
307
|
+
(typeof moduleId === "string" && clientPattern.test(moduleId)) ||
|
|
308
|
+
false
|
|
254
309
|
);
|
|
255
310
|
|
|
256
311
|
const hashOption =
|
|
@@ -272,7 +327,7 @@ export const resolveOptions = <
|
|
|
272
327
|
const hash = (n: string | null, ssr: boolean) => {
|
|
273
328
|
if (!n) return "";
|
|
274
329
|
if (ssr) return n;
|
|
275
|
-
if (hashString === "" ||
|
|
330
|
+
if (hashString === "" || new RegExp(BASE_PATTERNS.EXT.NODE).test(n)) {
|
|
276
331
|
return n;
|
|
277
332
|
}
|
|
278
333
|
const extensionIndex = n.lastIndexOf(".");
|
|
@@ -284,11 +339,6 @@ export const resolveOptions = <
|
|
|
284
339
|
return n + hashString;
|
|
285
340
|
}
|
|
286
341
|
};
|
|
287
|
-
const jsExtension = options.autoDiscover?.jsExtension ?? ".js";
|
|
288
|
-
const cssExtension = options.autoDiscover?.cssExtension ?? ".css";
|
|
289
|
-
const htmlExtension = options.autoDiscover?.htmlExtension ?? ".html";
|
|
290
|
-
const jsonExtension = options.autoDiscover?.jsonExtension ?? ".json";
|
|
291
|
-
const rscExtension = options.autoDiscover?.rscExtension ?? ".rsc";
|
|
292
342
|
|
|
293
343
|
// Output path resolution
|
|
294
344
|
const getOutputPath = (n: string | null) => {
|
|
@@ -298,59 +348,27 @@ export const resolveOptions = <
|
|
|
298
348
|
? path.slice(moduleBase.length + moduleBasePath.length)
|
|
299
349
|
: path;
|
|
300
350
|
|
|
301
|
-
if (vendorPattern(path))
|
|
302
|
-
return registerPath(
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
);
|
|
307
|
-
if (
|
|
308
|
-
return registerPath(
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
);
|
|
313
|
-
if (
|
|
314
|
-
return registerPath(path,
|
|
315
|
-
if (
|
|
316
|
-
return registerPath(
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
);
|
|
321
|
-
|
|
322
|
-
return registerPath(
|
|
323
|
-
path,
|
|
324
|
-
options.autoDiscover?.htmlPattern,
|
|
325
|
-
htmlExtension
|
|
326
|
-
);
|
|
327
|
-
if (jsonPattern(path))
|
|
328
|
-
return registerPath(
|
|
329
|
-
path,
|
|
330
|
-
options.autoDiscover?.jsonPattern,
|
|
331
|
-
jsonExtension
|
|
332
|
-
);
|
|
333
|
-
if (propsPattern(path))
|
|
334
|
-
return registerPath(
|
|
335
|
-
path,
|
|
336
|
-
options.autoDiscover?.propsPattern,
|
|
337
|
-
jsExtension
|
|
338
|
-
);
|
|
339
|
-
if (pagePattern(path))
|
|
340
|
-
return registerPath(path, options.autoDiscover?.pagePattern, jsExtension);
|
|
341
|
-
if (serverFunctions(path))
|
|
342
|
-
return registerPath(
|
|
343
|
-
path,
|
|
344
|
-
options.autoDiscover?.serverFunctions,
|
|
345
|
-
jsExtension
|
|
346
|
-
);
|
|
347
|
-
if (modulePattern(path))
|
|
348
|
-
return registerPath(
|
|
349
|
-
path,
|
|
350
|
-
options.autoDiscover?.modulePattern,
|
|
351
|
-
jsExtension
|
|
352
|
-
);
|
|
353
|
-
return registerPath(path, options.autoDiscover?.modulePattern, jsExtension);
|
|
351
|
+
if (vendorPattern.test(path))
|
|
352
|
+
return registerPath(path, vendorPattern, jsExtension);
|
|
353
|
+
if (cssModulePattern.test(path))
|
|
354
|
+
return registerPath(path, cssModulePattern, cssExtension);
|
|
355
|
+
if (cssPattern.test(path))
|
|
356
|
+
return registerPath(path, cssPattern, cssExtension);
|
|
357
|
+
if (clientPattern.test(path))
|
|
358
|
+
return registerPath(path, clientPattern, jsExtension);
|
|
359
|
+
if (htmlPattern.test(path))
|
|
360
|
+
return registerPath(path, htmlPattern, htmlExtension);
|
|
361
|
+
if (jsonPattern.test(path))
|
|
362
|
+
return registerPath(path, jsonPattern, jsonExtension);
|
|
363
|
+
if (propsPattern.test(path))
|
|
364
|
+
return registerPath(path, propsPattern, jsExtension);
|
|
365
|
+
if (pagePattern.test(path))
|
|
366
|
+
return registerPath(path, pagePattern, jsExtension);
|
|
367
|
+
if (serverPattern.test(path))
|
|
368
|
+
return registerPath(path, serverPattern, jsExtension);
|
|
369
|
+
if (modulePattern.test(path))
|
|
370
|
+
return registerPath(path, modulePattern, jsExtension);
|
|
371
|
+
return registerPath(path, modulePattern, jsExtension);
|
|
354
372
|
};
|
|
355
373
|
|
|
356
374
|
const normalizer =
|
|
@@ -360,17 +378,10 @@ export const resolveOptions = <
|
|
|
360
378
|
preserveModulesRoot: prodModuleBase,
|
|
361
379
|
removeExtension: true,
|
|
362
380
|
moduleBasePath,
|
|
381
|
+
moduleBaseURL,
|
|
363
382
|
});
|
|
364
383
|
// File naming functions
|
|
365
384
|
const entryFile = (n: PreRenderedChunk, ssr: boolean) => {
|
|
366
|
-
if (vendorPattern(n.name)) {
|
|
367
|
-
const search = n.facadeModuleId?.split("?")[1];
|
|
368
|
-
if (search) {
|
|
369
|
-
return hash(`${n.name}.${search}${jsExtension}`, ssr);
|
|
370
|
-
} else {
|
|
371
|
-
return hash(`${n.name}${jsExtension}`, ssr);
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
385
|
return hash(getOutputPath(normalizer(n.name)[0]), ssr);
|
|
375
386
|
};
|
|
376
387
|
|
|
@@ -378,152 +389,257 @@ export const resolveOptions = <
|
|
|
378
389
|
return hash(getOutputPath(normalizer(n.name)[0]), ssr);
|
|
379
390
|
};
|
|
380
391
|
|
|
381
|
-
const assetFile = (n: PreRenderedAsset, ssr
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
392
|
+
const assetFile: (n: PreRenderedAsset, ssr?: boolean) => string = (n: PreRenderedAsset, ssr = false) => {
|
|
393
|
+
if (n.names.length > 1) {
|
|
394
|
+
return n.names.map((name) => hash(name, ssr)).join(",");
|
|
395
|
+
}
|
|
396
|
+
let firstName = n.names[0];
|
|
397
|
+
|
|
398
|
+
// Clean up asset paths by removing the moduleBase from within assets directory
|
|
399
|
+
// Transform: assets/src/page/file.css -> assets/page/file.css
|
|
400
|
+
const assetsDir = build.assetsDir || "assets";
|
|
401
|
+
if (firstName.startsWith(assetsDir + "/" + moduleBase + "/")) {
|
|
402
|
+
firstName = assetsDir + "/" + firstName.slice((assetsDir + "/" + moduleBase + "/").length);
|
|
403
|
+
}
|
|
404
|
+
// Handle moduleBasePath removal
|
|
405
|
+
else if (moduleBasePath && firstName.startsWith(moduleBasePath)) {
|
|
406
|
+
firstName = firstName.slice(moduleBasePath.length);
|
|
407
|
+
} else if(moduleBaseURL && moduleBaseURL !== "/" && moduleBaseURL !== "" && firstName.startsWith(moduleBaseURL)) {
|
|
408
|
+
firstName = firstName.slice(moduleBaseURL.length);
|
|
409
|
+
}
|
|
410
|
+
// Handle direct moduleBase removal
|
|
411
|
+
else if (firstName.startsWith(moduleBase + "/")) {
|
|
412
|
+
firstName = firstName.slice(moduleBase.length + 1);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// For CSS files, make sure we preserve the .css extension and don't apply JS extension mapping
|
|
416
|
+
if (firstName.endsWith('.css')) {
|
|
417
|
+
return hash(firstName, false);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// For other assets, apply the extension mapping if needed
|
|
421
|
+
return hash(getOutputPath(firstName), false);
|
|
388
422
|
};
|
|
389
|
-
const moduleID =
|
|
390
|
-
typeof options.moduleID === "function"
|
|
391
|
-
? options.moduleID
|
|
392
|
-
: (id: string) => {
|
|
393
|
-
if (prodModuleBase && id.startsWith(prodModuleBase)) {
|
|
394
|
-
id = id.slice(prodModuleBase.length);
|
|
395
|
-
}
|
|
396
|
-
if (!id.startsWith(moduleBasePath)) {
|
|
397
|
-
id = join(moduleBasePath, id);
|
|
398
|
-
}
|
|
399
|
-
// in the case the moduleBase comes after the base path, remove it
|
|
400
|
-
if (prodModuleBase && id.startsWith("/" + prodModuleBase)) {
|
|
401
|
-
id = id.slice(prodModuleBase.length + 1);
|
|
402
|
-
}
|
|
403
|
-
// these paths will generally start with a /, simply ensure they always do
|
|
404
|
-
if (!id.startsWith("/")) {
|
|
405
|
-
id = "/" + id;
|
|
406
|
-
}
|
|
407
|
-
if (isProd) {
|
|
408
|
-
// generally it will work if we just use the .js extension for modules
|
|
409
|
-
return mapExtension(id);
|
|
410
|
-
}
|
|
411
|
-
// but for extra good development workflow, we keep the path intact
|
|
412
|
-
// not even stripping the moduleBase or ts extensions
|
|
413
|
-
return id;
|
|
414
|
-
};
|
|
415
423
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
424
|
+
/**
|
|
425
|
+
* pages
|
|
426
|
+
* assetsDir
|
|
427
|
+
* client
|
|
428
|
+
* server
|
|
429
|
+
* static
|
|
430
|
+
* api
|
|
431
|
+
* outDir
|
|
432
|
+
* hash
|
|
433
|
+
* preserveDirectives
|
|
434
|
+
* preserveModulesRoot
|
|
435
|
+
* rscOutputPath
|
|
436
|
+
* htmlOutputPath
|
|
437
|
+
* entryFile
|
|
438
|
+
* chunkFile
|
|
439
|
+
* assetFile
|
|
440
|
+
* extensionMap
|
|
441
|
+
* moduleExtension
|
|
442
|
+
* jsExtension
|
|
443
|
+
* cssExtension
|
|
444
|
+
* htmlExtension
|
|
445
|
+
* jsonExtension
|
|
446
|
+
* rscExtension
|
|
447
|
+
* cssModuleExtension
|
|
448
|
+
* nodeExtension
|
|
449
|
+
*/
|
|
422
450
|
const build = {
|
|
423
|
-
pages,
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
451
|
+
pages: options.build?.pages ?? DEFAULT_CONFIG.BUILD.pages,
|
|
452
|
+
assetsDir: options.build?.assetsDir ?? DEFAULT_CONFIG.BUILD.assetsDir,
|
|
453
|
+
client: options.build?.client ?? DEFAULT_CONFIG.BUILD.client,
|
|
454
|
+
server: options.build?.server ?? DEFAULT_CONFIG.BUILD.server,
|
|
455
|
+
static: options.build?.static ?? DEFAULT_CONFIG.BUILD.static,
|
|
456
|
+
api: options.build?.api ?? DEFAULT_CONFIG.BUILD.api,
|
|
457
|
+
preserveModulesRoot:
|
|
458
|
+
options.build?.preserveModulesRoot ??
|
|
459
|
+
DEFAULT_CONFIG.BUILD.preserveModulesRoot,
|
|
460
|
+
outDir: options.build?.outDir ?? DEFAULT_CONFIG.BUILD.outDir,
|
|
461
|
+
hash: options.build?.hash ?? DEFAULT_CONFIG.BUILD.hash,
|
|
462
|
+
extensionMap: {
|
|
463
|
+
// File extensions first (more specific patterns should come first)
|
|
464
|
+
[BASE_PATTERNS.EXT.CSS]: cssExtension,
|
|
465
|
+
[BASE_PATTERNS.EXT.JSON]: jsonExtension,
|
|
466
|
+
[BASE_PATTERNS.EXT.HTML]: htmlExtension,
|
|
467
|
+
[BASE_PATTERNS.EXT.RSC]: rscExtension,
|
|
468
|
+
// Special case for .node files
|
|
469
|
+
[BASE_PATTERNS.EXT.NODE]:
|
|
470
|
+
BASE_PATTERNS.EXT.NODE +
|
|
471
|
+
(options.build?.jsExtension ?? DEFAULT_CONFIG.BUILD.jsExtension),
|
|
472
|
+
// General module pattern last (less specific)
|
|
473
|
+
[BASE_PATTERNS.MODULE]: jsExtension,
|
|
474
|
+
...options.build?.extensionMap,
|
|
475
|
+
},
|
|
476
|
+
entryFile,
|
|
477
|
+
chunkFile,
|
|
478
|
+
assetFile,
|
|
479
|
+
preserveDirectives: preserveDirectives,
|
|
480
|
+
rscOutputPath: rscOutputPath,
|
|
481
|
+
htmlOutputPath: htmlOutputPath,
|
|
482
|
+
moduleExtension: jsExtension,
|
|
450
483
|
jsExtension: jsExtension,
|
|
451
484
|
cssExtension: cssExtension,
|
|
452
485
|
htmlExtension: htmlExtension,
|
|
453
486
|
jsonExtension: jsonExtension,
|
|
454
487
|
rscExtension: rscExtension,
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
488
|
+
cssModuleExtension: cssModuleExtension,
|
|
489
|
+
nodeExtension: DEFAULT_CONFIG.BUILD.nodeExtension,
|
|
490
|
+
} satisfies ResolvedUserOptions["build"];
|
|
491
|
+
|
|
492
|
+
// Auto-discovery configuration
|
|
493
|
+
const autoDiscover = {
|
|
494
|
+
modulePattern,
|
|
495
|
+
jsonPattern,
|
|
496
|
+
cssPattern,
|
|
497
|
+
htmlPattern,
|
|
498
|
+
rscPattern,
|
|
499
|
+
clientPattern,
|
|
500
|
+
serverPattern,
|
|
501
|
+
nodePattern,
|
|
502
|
+
propsPattern,
|
|
503
|
+
pagePattern,
|
|
504
|
+
cssModulePattern,
|
|
505
|
+
vendorPattern,
|
|
506
|
+
virtualPattern,
|
|
507
|
+
dotPattern,
|
|
508
|
+
} satisfies ResolvedUserOptions["autoDiscover"];
|
|
509
|
+
|
|
510
|
+
const allowedDirectives = resolveAllowedDirectives(
|
|
511
|
+
options.loader?.allowedDirectives ?? DEFAULT_LOADER_CONFIG.allowedDirectives
|
|
512
|
+
);
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
// Create loader configuration
|
|
516
|
+
const loader = {
|
|
517
|
+
serverDirective: resolveRegExp(
|
|
518
|
+
options.loader?.serverDirective,
|
|
519
|
+
DEFAULT_LOADER_CONFIG.serverDirective
|
|
520
|
+
),
|
|
521
|
+
clientDirective: resolveRegExp(
|
|
522
|
+
options.loader?.clientDirective,
|
|
523
|
+
DEFAULT_LOADER_CONFIG.clientDirective
|
|
524
|
+
),
|
|
525
|
+
allowedDirectives: allowedDirectives,
|
|
526
|
+
getDirectiveType:
|
|
527
|
+
options.loader?.getDirectiveType ?? options.loader?.allowedDirectives
|
|
528
|
+
? (directive: string) => {
|
|
529
|
+
if (options.loader?.allowedDirectives) {
|
|
530
|
+
if (Array.isArray(options.loader?.allowedDirectives)) {
|
|
531
|
+
return options.loader?.allowedDirectives.includes(directive)
|
|
532
|
+
? directive === "use server"
|
|
533
|
+
? "server"
|
|
534
|
+
: "client"
|
|
535
|
+
: undefined;
|
|
536
|
+
} else {
|
|
537
|
+
const config = options.loader?.allowedDirectives[directive];
|
|
538
|
+
return config
|
|
539
|
+
? directive === "use server"
|
|
540
|
+
? "server"
|
|
541
|
+
: "client"
|
|
542
|
+
: undefined;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
return undefined;
|
|
546
|
+
}
|
|
547
|
+
: DEFAULT_LOADER_CONFIG.getDirectiveType,
|
|
548
|
+
mode: loaderMode,
|
|
549
|
+
importServerPath:
|
|
550
|
+
options.loader?.importServerPath ??
|
|
551
|
+
DEFAULT_CONFIG.RSC_LOADER[loaderMode].importServerPath,
|
|
552
|
+
importClientPath:
|
|
553
|
+
options.loader?.importClientPath ??
|
|
554
|
+
DEFAULT_CONFIG.RSC_LOADER[loaderMode].importClientPath,
|
|
555
|
+
registerClientReferenceName:
|
|
556
|
+
options.loader?.registerClientReferenceName ??
|
|
557
|
+
DEFAULT_CONFIG.RSC_LOADER[loaderMode].registerClientReferenceName,
|
|
558
|
+
registerServerReferenceName:
|
|
559
|
+
options.loader?.registerServerReferenceName ??
|
|
560
|
+
DEFAULT_CONFIG.RSC_LOADER[loaderMode].registerServerReferenceName,
|
|
561
|
+
isServerFunctionCode,
|
|
562
|
+
isClientComponentCode,
|
|
563
|
+
parse: parse,
|
|
564
|
+
} satisfies ResolvedUserOptions["loader"];
|
|
565
|
+
|
|
482
566
|
const pipeableStreamOptions = options.pipeableStreamOptions
|
|
483
567
|
? options.pipeableStreamOptions
|
|
484
568
|
: {};
|
|
485
569
|
|
|
486
570
|
// Return resolved options
|
|
487
571
|
try {
|
|
572
|
+
const userOptions: ResolvedUserOptions = {
|
|
573
|
+
projectRoot,
|
|
574
|
+
moduleBase,
|
|
575
|
+
moduleBasePath,
|
|
576
|
+
moduleBaseURL,
|
|
577
|
+
moduleRootPath,
|
|
578
|
+
publicOrigin,
|
|
579
|
+
build: build,
|
|
580
|
+
verbose: options.verbose ?? DEFAULT_CONFIG.VERBOSE,
|
|
581
|
+
onMetrics: options.onMetrics ?? DEFAULT_CONFIG.ON_METRICS,
|
|
582
|
+
onEvent: options.onEvent,
|
|
583
|
+
Page: options.Page,
|
|
584
|
+
props: options.props,
|
|
585
|
+
Html: options.Html ?? DEFAULT_CONFIG.HTML,
|
|
586
|
+
Root: options.Root ?? DEFAULT_CONFIG.ROOT,
|
|
587
|
+
components: options.components,
|
|
588
|
+
normalizer: normalizer,
|
|
589
|
+
moduleID: options.moduleID, // if not provided, will be created when config hook is called
|
|
590
|
+
pageExportName:
|
|
591
|
+
options.pageExportName ?? (DEFAULT_CONFIG.PAGE_EXPORT_NAME as PageName),
|
|
592
|
+
propsExportName:
|
|
593
|
+
options.propsExportName ??
|
|
594
|
+
(DEFAULT_CONFIG.PROPS_EXPORT_NAME as PropsName),
|
|
595
|
+
htmlExportName:
|
|
596
|
+
options.htmlExportName ?? (DEFAULT_CONFIG.HTML_EXPORT_NAME as HtmlName),
|
|
597
|
+
rootExportName:
|
|
598
|
+
options.rootExportName ?? (DEFAULT_CONFIG.ROOT_EXPORT_NAME as RootName),
|
|
599
|
+
css: {
|
|
600
|
+
inlineCss: options.css?.inlineCss ?? DEFAULT_CONFIG.CSS.inlineCss,
|
|
601
|
+
inlineThreshold:
|
|
602
|
+
options.css?.inlineThreshold ?? DEFAULT_CONFIG.CSS.inlineThreshold,
|
|
603
|
+
inlinePatterns:
|
|
604
|
+
options.css?.inlinePatterns ?? DEFAULT_CONFIG.CSS.inlinePatterns,
|
|
605
|
+
linkPatterns:
|
|
606
|
+
options.css?.linkPatterns ?? DEFAULT_CONFIG.CSS.linkPatterns,
|
|
607
|
+
},
|
|
608
|
+
htmlWorkerPath: htmlWorkerPath,
|
|
609
|
+
rscWorkerPath: rscWorkerPath,
|
|
610
|
+
loaderPath: loaderPath,
|
|
611
|
+
reactLoaderPath: options.reactLoaderPath ?? DEFAULT_CONFIG.REACT_LOADER_PATH,
|
|
612
|
+
cssLoaderPath: options.cssLoaderPath ?? DEFAULT_CONFIG.CSS_LOADER_PATH,
|
|
613
|
+
envLoaderPath: options.envLoaderPath ?? DEFAULT_CONFIG.ENV_LOADER_PATH,
|
|
614
|
+
clientEntry: options.clientEntry ?? DEFAULT_CONFIG.CLIENT_ENTRY,
|
|
615
|
+
serverEntry: options.serverEntry ?? DEFAULT_CONFIG.SERVER_ENTRY,
|
|
616
|
+
autoDiscover: autoDiscover,
|
|
617
|
+
loader: loader,
|
|
618
|
+
pipeableStreamOptions,
|
|
619
|
+
rscTimeout:
|
|
620
|
+
typeof options.rscTimeout === "number"
|
|
621
|
+
? options.rscTimeout
|
|
622
|
+
: DEFAULT_CONFIG.RSC_TIMEOUT,
|
|
623
|
+
htmlWorkerStartupTimeout:
|
|
624
|
+
typeof options.htmlWorkerStartupTimeout === "number"
|
|
625
|
+
? options.htmlWorkerStartupTimeout
|
|
626
|
+
: DEFAULT_CONFIG.HTML_WORKER_STARTUP_TIMEOUT,
|
|
627
|
+
rscWorkerStartupTimeout:
|
|
628
|
+
typeof options.rscWorkerStartupTimeout === "number"
|
|
629
|
+
? options.rscWorkerStartupTimeout
|
|
630
|
+
: DEFAULT_CONFIG.RSC_WORKER_STARTUP_TIMEOUT,
|
|
631
|
+
panicThreshold:
|
|
632
|
+
typeof options.panicThreshold === "string"
|
|
633
|
+
? options.panicThreshold
|
|
634
|
+
: DEFAULT_CONFIG.PANIC_THRESHOLD,
|
|
635
|
+
};
|
|
636
|
+
|
|
637
|
+
// Stash the resolved options
|
|
638
|
+
stashedUserOptions[envId] = userOptions;
|
|
639
|
+
|
|
488
640
|
return {
|
|
489
641
|
type: "success",
|
|
490
|
-
userOptions
|
|
491
|
-
projectRoot,
|
|
492
|
-
moduleBase,
|
|
493
|
-
moduleBasePath,
|
|
494
|
-
moduleBaseURL,
|
|
495
|
-
moduleRootPath,
|
|
496
|
-
publicOrigin,
|
|
497
|
-
build: build,
|
|
498
|
-
verbose: options.verbose ?? DEFAULT_CONFIG.VERBOSE,
|
|
499
|
-
onMetrics: options.onMetrics ?? DEFAULT_CONFIG.ON_METRICS,
|
|
500
|
-
onEvent: options.onEvent,
|
|
501
|
-
Page: options.Page ?? undefined,
|
|
502
|
-
props: options.props ?? undefined,
|
|
503
|
-
Html: options.Html ?? DEFAULT_CONFIG.HTML,
|
|
504
|
-
CssCollector: options.CssCollector ?? CssCollector,
|
|
505
|
-
normalizer: normalizer,
|
|
506
|
-
moduleID: moduleID,
|
|
507
|
-
pageExportName: pageExportName,
|
|
508
|
-
propsExportName: propsExportName,
|
|
509
|
-
css: {
|
|
510
|
-
inlineCss: options.css?.inlineCss ?? DEFAULT_CONFIG.CSS.inlineCss,
|
|
511
|
-
inlineThreshold:
|
|
512
|
-
options.css?.inlineThreshold ?? DEFAULT_CONFIG.CSS.inlineThreshold,
|
|
513
|
-
inlinePatterns:
|
|
514
|
-
options.css?.inlinePatterns ?? DEFAULT_CONFIG.CSS.inlinePatterns,
|
|
515
|
-
linkPatterns:
|
|
516
|
-
options.css?.linkPatterns ?? DEFAULT_CONFIG.CSS.linkPatterns,
|
|
517
|
-
},
|
|
518
|
-
htmlWorkerPath: htmlWorkerPath,
|
|
519
|
-
rscWorkerPath: rscWorkerPath,
|
|
520
|
-
loaderPath: loaderPath,
|
|
521
|
-
clientEntry: options.clientEntry ?? DEFAULT_CONFIG.CLIENT_ENTRY,
|
|
522
|
-
serverEntry: options.serverEntry ?? DEFAULT_CONFIG.SERVER_ENTRY,
|
|
523
|
-
// moduleBaseExceptions: options.moduleBaseExceptions ?? [],
|
|
524
|
-
autoDiscover: autoDiscover,
|
|
525
|
-
pipeableStreamOptions,
|
|
526
|
-
} as ResolvedUserOptions<T, InlineCSS>,
|
|
642
|
+
userOptions,
|
|
527
643
|
};
|
|
528
644
|
} catch (error) {
|
|
529
645
|
return {
|