vite-plugin-react-server 0.3.10 → 0.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -1
- package/dist/index.d.ts +3 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/package.json +16 -14
- package/dist/plugin/assertServerCondition.d.ts +5 -1
- package/dist/plugin/assertServerCondition.d.ts.map +1 -1
- package/dist/plugin/assertServerCondition.js +1 -3
- package/dist/plugin/checkFilesExist.d.ts +2 -2
- package/dist/plugin/checkFilesExist.d.ts.map +1 -1
- package/dist/plugin/checkFilesExist.js +43 -58
- package/dist/plugin/checkFilesExist.js.map +1 -1
- package/dist/plugin/collect-css-manifest.d.ts.map +1 -1
- package/dist/plugin/collect-css-manifest.js +5 -0
- package/dist/plugin/collect-css-manifest.js.map +1 -1
- package/dist/plugin/components.js +10 -15
- package/dist/plugin/config/createModuleIdGenerator.d.ts +11 -0
- package/dist/plugin/config/createModuleIdGenerator.d.ts.map +1 -0
- package/dist/plugin/config/createModuleIdGenerator.js +44 -0
- package/dist/plugin/config/createModuleIdGenerator.js.map +1 -0
- package/dist/plugin/config/defaults.d.ts +27 -24
- package/dist/plugin/config/defaults.d.ts.map +1 -1
- package/dist/plugin/config/defaults.js +26 -31
- package/dist/plugin/config/defaults.js.map +1 -1
- package/dist/plugin/config/getPaths.js +1 -1
- package/dist/plugin/config/resolveOptions.d.ts +1 -1
- package/dist/plugin/config/resolveOptions.d.ts.map +1 -1
- package/dist/plugin/config/resolveOptions.js +223 -16
- package/dist/plugin/config/resolveOptions.js.map +1 -1
- package/dist/plugin/config/resolvePages.d.ts +2 -0
- package/dist/plugin/config/resolvePages.d.ts.map +1 -1
- package/dist/plugin/config/resolvePages.js.map +1 -1
- package/dist/plugin/config/resolveUserConfig.d.ts +2 -2
- package/dist/plugin/config/resolveUserConfig.d.ts.map +1 -1
- package/dist/plugin/config/resolveUserConfig.js +149 -50
- package/dist/plugin/config/resolveUserConfig.js.map +1 -1
- package/dist/plugin/helpers/getBundleManifest.d.ts +25 -0
- package/dist/plugin/helpers/getBundleManifest.d.ts.map +1 -0
- package/dist/plugin/helpers/getBundleManifest.js +72 -0
- package/dist/plugin/helpers/getBundleManifest.js.map +1 -0
- package/dist/plugin/helpers/inputNormalizer.d.ts +14 -1
- package/dist/plugin/helpers/inputNormalizer.d.ts.map +1 -1
- package/dist/plugin/helpers/inputNormalizer.js +128 -16
- package/dist/plugin/helpers/inputNormalizer.js.map +1 -1
- package/dist/plugin/helpers/tryManifest.d.ts +3 -1
- package/dist/plugin/helpers/tryManifest.d.ts.map +1 -1
- package/dist/plugin/helpers/tryManifest.js +1 -1
- package/dist/plugin/helpers/tryManifest.js.map +1 -1
- package/dist/plugin/loader/createBuildLoader.d.ts +6 -2
- package/dist/plugin/loader/createBuildLoader.d.ts.map +1 -1
- package/dist/plugin/loader/createBuildLoader.js +37 -9
- package/dist/plugin/loader/createBuildLoader.js.map +1 -1
- package/dist/plugin/loader/createPageLoader.d.ts.map +1 -1
- package/dist/plugin/loader/createPageLoader.js +0 -7
- package/dist/plugin/loader/css-loader.d.ts +16 -0
- package/dist/plugin/loader/css-loader.d.ts.map +1 -0
- package/dist/plugin/loader/css-loader.js +70 -0
- package/dist/plugin/loader/css-loader.js.map +1 -0
- package/dist/plugin/loader/react-loader.d.ts +17 -0
- package/dist/plugin/loader/react-loader.d.ts.map +1 -0
- package/dist/plugin/loader/react-loader.js +647 -0
- package/dist/plugin/loader/react-loader.js.map +1 -0
- package/dist/plugin/loader/rsc/messageHandler.d.ts +2 -0
- package/dist/plugin/loader/rsc/messageHandler.d.ts.map +1 -0
- package/dist/plugin/loader/rsc/messageHandler.js +1 -0
- package/dist/plugin/loader/rsc/rsc-worker.development.d.ts +2 -0
- package/dist/plugin/loader/rsc/rsc-worker.development.d.ts.map +1 -0
- package/dist/plugin/loader/rsc/rsc-worker.development.js +1 -0
- package/dist/plugin/plugin.d.ts +0 -1
- package/dist/plugin/plugin.d.ts.map +1 -1
- package/dist/plugin/plugin.js +2 -1
- package/dist/plugin/preserver/plugin.d.ts.map +1 -1
- package/dist/plugin/preserver/plugin.js +3 -2
- package/dist/plugin/preserver/plugin.js.map +1 -1
- package/dist/plugin/react-client/index.d.ts +2 -1
- package/dist/plugin/react-client/index.d.ts.map +1 -1
- package/dist/plugin/react-client/index.js +19 -1
- package/dist/plugin/react-client/index.js.map +1 -0
- package/dist/plugin/react-client/plugin.d.ts +2 -2
- package/dist/plugin/react-client/plugin.d.ts.map +1 -1
- package/dist/plugin/react-client/plugin.js +283 -10
- package/dist/plugin/react-client/plugin.js.map +1 -1
- package/dist/plugin/react-server/createHandler.d.ts +2 -2
- package/dist/plugin/react-server/createHandler.d.ts.map +1 -1
- package/dist/plugin/react-server/createHandler.js +15 -9
- package/dist/plugin/react-server/createHandler.js.map +1 -1
- package/dist/plugin/react-server/createRscStream.d.ts +15 -3
- package/dist/plugin/react-server/createRscStream.d.ts.map +1 -1
- package/dist/plugin/react-server/createRscStream.js +53 -36
- package/dist/plugin/react-server/createRscStream.js.map +1 -1
- package/dist/plugin/react-server/createSsrHandler.d.ts +2 -2
- package/dist/plugin/react-server/createSsrHandler.d.ts.map +1 -1
- package/dist/plugin/react-server/createSsrHandler.js +5 -12
- package/dist/plugin/react-server/index.js +18 -9
- package/dist/plugin/react-server/index.js.map +1 -0
- package/dist/plugin/react-server/plugin.d.ts.map +1 -1
- package/dist/plugin/react-server/plugin.js +147 -137
- package/dist/plugin/react-server/plugin.js.map +1 -1
- package/dist/plugin/transformer/plugin.d.ts +2 -1
- package/dist/plugin/transformer/plugin.d.ts.map +1 -1
- package/dist/plugin/transformer/plugin.js +68 -75
- package/dist/plugin/transformer/plugin.js.map +1 -1
- package/dist/plugin/transformer/types.d.ts +4 -0
- package/dist/plugin/transformer/types.d.ts.map +1 -1
- package/dist/plugin/types.d.ts +56 -20
- package/dist/plugin/types.d.ts.map +1 -1
- package/dist/plugin/utils/logger.d.ts +9 -0
- package/dist/plugin/utils/logger.d.ts.map +1 -0
- package/dist/plugin/utils/logger.js +68 -0
- package/dist/plugin/utils/logger.js.map +1 -0
- package/dist/plugin/worker/createWorker.d.ts +1 -0
- package/dist/plugin/worker/createWorker.d.ts.map +1 -1
- package/dist/plugin/worker/createWorker.js +23 -36
- package/dist/plugin/worker/createWorker.js.map +1 -1
- package/dist/plugin/worker/html/html-worker.production.js +5 -1
- package/dist/plugin/worker/html/html-worker.production.js.map +1 -1
- package/dist/plugin/worker/html/messageHandler.d.ts.map +1 -1
- package/dist/plugin/worker/html/messageHandler.js +33 -28
- package/dist/plugin/worker/html/messageHandler.js.map +1 -1
- package/dist/plugin/worker/html/plugin.d.ts.map +1 -1
- package/dist/plugin/worker/html/plugin.js +10 -5
- package/dist/plugin/worker/html/renderPages.d.ts +7 -6
- package/dist/plugin/worker/html/renderPages.d.ts.map +1 -1
- package/dist/plugin/worker/html/renderPages.js +147 -93
- package/dist/plugin/worker/html/renderPages.js.map +1 -1
- package/dist/plugin/worker/loader.d.ts +1 -11
- package/dist/plugin/worker/loader.d.ts.map +1 -1
- package/dist/plugin/worker/loader.js +2 -2
- package/dist/plugin/worker/loader.js.map +1 -1
- package/dist/plugin/worker/plugin.d.ts +10 -1
- package/dist/plugin/worker/plugin.d.ts.map +1 -1
- package/dist/plugin/worker/plugin.js +10 -1
- package/dist/plugin/worker/rsc/index.d.ts +1 -3
- package/dist/plugin/worker/rsc/index.d.ts.map +1 -1
- package/dist/plugin/worker/rsc/index.js +1 -9
- package/dist/plugin/worker/rsc/index.js.map +1 -1
- package/dist/plugin/worker/rsc/messageHandler.d.ts +3 -0
- package/dist/plugin/worker/rsc/messageHandler.d.ts.map +1 -0
- package/dist/plugin/worker/rsc/messageHandler.js +107 -0
- package/dist/plugin/worker/rsc/messageHandler.js.map +1 -0
- package/dist/plugin/worker/rsc/plugin.d.ts.map +1 -1
- package/dist/plugin/worker/rsc/plugin.js +74 -80
- package/dist/plugin/worker/rsc/rsc-worker.development.d.ts +32 -0
- package/dist/plugin/worker/rsc/rsc-worker.development.d.ts.map +1 -0
- package/dist/plugin/worker/rsc/rsc-worker.development.js +43 -0
- package/dist/plugin/worker/rsc/rsc-worker.development.js.map +1 -0
- package/dist/plugin/worker/rsc/rsc-worker.js +4 -106
- package/dist/plugin/worker/rsc/rsc-worker.production.d.ts +2 -0
- package/dist/plugin/worker/rsc/rsc-worker.production.d.ts.map +1 -0
- package/dist/plugin/worker/rsc/rsc-worker.production.js +14 -0
- package/dist/plugin/worker/rsc/rsc-worker.production.js.map +1 -0
- package/dist/plugin/worker/rsc/state.d.ts +11 -0
- package/dist/plugin/worker/rsc/state.d.ts.map +1 -0
- package/dist/plugin/worker/rsc/state.js +12 -0
- package/dist/plugin/worker/rsc/state.js.map +1 -0
- package/dist/plugin/worker/types.d.ts +62 -35
- package/dist/plugin/worker/types.d.ts.map +1 -1
- package/dist/server.d.ts +1 -3
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +1 -3
- package/dist/server.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -14
- package/plugin/assertServerCondition.ts +2 -3
- package/plugin/checkFilesExist.ts +46 -66
- package/plugin/collect-css-manifest.ts +5 -1
- package/plugin/config/createModuleIdGenerator.ts +52 -0
- package/plugin/config/defaults.ts +27 -20
- package/plugin/config/resolveOptions.ts +311 -25
- package/plugin/config/resolvePages.ts +1 -1
- package/plugin/config/resolveUserConfig.ts +195 -61
- package/plugin/helpers/getBundleManifest.ts +113 -0
- package/plugin/helpers/inputNormalizer.ts +186 -25
- package/plugin/helpers/tryManifest.ts +3 -1
- package/plugin/loader/createBuildLoader.ts +50 -9
- package/plugin/loader/createPageLoader.ts +1 -7
- package/plugin/loader/css-loader.ts +96 -0
- package/plugin/loader/react-loader.ts +945 -0
- package/plugin/loader/rsc/messageHandler.tsx +1 -0
- package/plugin/loader/rsc/rsc-worker.development.ts +1 -0
- package/plugin/plugin.ts +2 -1
- package/plugin/preserver/plugin.ts +2 -1
- package/plugin/react-client/index.ts +12 -1
- package/plugin/react-client/plugin.ts +351 -11
- package/plugin/react-server/createHandler.ts +16 -18
- package/plugin/react-server/createRscStream.ts +75 -42
- package/plugin/react-server/createSsrHandler.ts +7 -26
- package/plugin/react-server/plugin.ts +192 -155
- package/plugin/transformer/plugin.ts +70 -104
- package/plugin/transformer/types.ts +4 -0
- package/plugin/types/global.d.ts +8 -0
- package/plugin/types.ts +120 -64
- package/plugin/utils/logger.ts +52 -0
- package/plugin/worker/createWorker.ts +43 -44
- package/plugin/worker/html/html-worker.production.tsx +7 -2
- package/plugin/worker/html/messageHandler.ts +42 -35
- package/plugin/worker/html/plugin.ts +15 -11
- package/plugin/worker/html/renderPages.ts +177 -123
- package/plugin/worker/loader.ts +4 -13
- package/plugin/worker/plugin.ts +10 -1
- package/plugin/worker/rsc/index.ts +4 -13
- package/plugin/worker/rsc/messageHandler.tsx +143 -0
- package/plugin/worker/rsc/plugin.ts +38 -37
- package/plugin/worker/rsc/rsc-worker.development.ts +107 -0
- package/plugin/worker/rsc/rsc-worker.production.ts +13 -0
- package/plugin/worker/rsc/rsc-worker.tsx +5 -128
- package/plugin/worker/rsc/state.ts +37 -0
- package/plugin/worker/types.ts +83 -38
- package/scripts/check-react-version.mjs +17 -7
- package/scripts/react+0.0.0-experimental-b3a95caf-20250113.patch +143 -4170
- package/scripts/react-dom+0.0.0-experimental-b3a95caf-20250113.patch +14271 -90079
- package/dist/node_modules/magic-string/dist/magic-string.es.js +0 -1283
- package/dist/node_modules/magic-string/dist/magic-string.es.js.map +0 -1
- package/dist/plugin/build/createClientBuildConfig.d.ts +0 -3
- package/dist/plugin/build/createClientBuildConfig.d.ts.map +0 -1
- package/dist/plugin/build/createClientBuildConfig.js +0 -14
- package/dist/plugin/build/createServerBuildConfig.d.ts +0 -12
- package/dist/plugin/build/createServerBuildConfig.d.ts.map +0 -1
- package/dist/plugin/build/createServerBuildConfig.js +0 -40
- package/dist/plugin/build/createSharedBuildConfig.d.ts +0 -5
- package/dist/plugin/build/createSharedBuildConfig.d.ts.map +0 -1
- package/dist/plugin/build/createSharedBuildConfig.js +0 -28
- package/dist/plugin/build/mergeInputs.d.ts +0 -9
- package/dist/plugin/build/mergeInputs.d.ts.map +0 -1
- package/dist/plugin/build/mergeInputs.js +0 -56
- package/dist/plugin/components.js.map +0 -1
- package/dist/plugin/config/moduleIdDefault.d.ts +0 -8
- package/dist/plugin/config/moduleIdDefault.d.ts.map +0 -1
- package/dist/plugin/config/moduleIdDefault.js +0 -23
- package/dist/plugin/config/moduleIdDefault.js.map +0 -1
- package/dist/plugin/helpers/createClientInputNormalizer.d.ts +0 -8
- package/dist/plugin/helpers/createClientInputNormalizer.d.ts.map +0 -1
- package/dist/plugin/helpers/createClientInputNormalizer.js +0 -35
- package/dist/plugin/helpers/createServerInputNormalizer.d.ts +0 -9
- package/dist/plugin/helpers/createServerInputNormalizer.d.ts.map +0 -1
- package/dist/plugin/helpers/createServerInputNormalizer.js +0 -37
- package/dist/plugin/helpers/createStaticInputNormalizer.d.ts +0 -7
- package/dist/plugin/helpers/createStaticInputNormalizer.d.ts.map +0 -1
- package/dist/plugin/helpers/createStaticInputNormalizer.js +0 -18
- package/dist/plugin/helpers/getModuleManifest.d.ts +0 -12
- package/dist/plugin/helpers/getModuleManifest.d.ts.map +0 -1
- package/dist/plugin/helpers/getModuleManifest.js +0 -24
- package/dist/plugin/helpers/getModuleManifest.js.map +0 -1
- package/dist/plugin/helpers/inputNormalizerWorker.d.ts +0 -11
- package/dist/plugin/helpers/inputNormalizerWorker.d.ts.map +0 -1
- package/dist/plugin/helpers/inputNormalizerWorker.js +0 -30
- package/dist/plugin/helpers/normalizedRelativePath.d.ts +0 -11
- package/dist/plugin/helpers/normalizedRelativePath.d.ts.map +0 -1
- package/dist/plugin/helpers/normalizedRelativePath.js +0 -36
- package/dist/plugin/helpers/resolveFilePath.d.ts +0 -13
- package/dist/plugin/helpers/resolveFilePath.d.ts.map +0 -1
- package/dist/plugin/helpers/resolveFilePath.js +0 -74
- package/dist/plugin/helpers/resolveWorkerModule.d.ts +0 -6
- package/dist/plugin/helpers/resolveWorkerModule.d.ts.map +0 -1
- package/dist/plugin/helpers/resolveWorkerModule.js +0 -24
- package/dist/plugin/helpers/validateModuleBase.d.ts +0 -3
- package/dist/plugin/helpers/validateModuleBase.d.ts.map +0 -1
- package/dist/plugin/helpers/validateModuleBase.js +0 -16
- package/dist/plugin/helpers/validateResolvedConfig.d.ts +0 -3
- package/dist/plugin/helpers/validateResolvedConfig.d.ts.map +0 -1
- package/dist/plugin/helpers/validateResolvedConfig.js +0 -17
- package/dist/plugin/react-server/createDevMiddleware.d.ts +0 -8
- package/dist/plugin/react-server/createDevMiddleware.d.ts.map +0 -1
- package/dist/plugin/react-server/createDevMiddleware.js +0 -68
- package/dist/plugin/react-server/createDevServer.d.ts +0 -4
- package/dist/plugin/react-server/createDevServer.d.ts.map +0 -1
- package/dist/plugin/react-server/createDevServer.js +0 -4
- package/dist/plugin/react-server/createReactNodeStreamer.d.ts +0 -10
- package/dist/plugin/react-server/createReactNodeStreamer.d.ts.map +0 -1
- package/dist/plugin/react-server/createReactNodeStreamer.js +0 -7
- package/dist/plugin/transformer/transformer-client-components.d.ts +0 -21
- package/dist/plugin/transformer/transformer-client-components.d.ts.map +0 -1
- package/dist/plugin/transformer/transformer-client-components.js +0 -61
- package/dist/plugin/transformer/transformer-client-components.js.map +0 -1
- package/dist/plugin/transformer/transformer-server-actions.d.ts +0 -29
- package/dist/plugin/transformer/transformer-server-actions.d.ts.map +0 -1
- package/dist/plugin/transformer/transformer-server-actions.js +0 -76
- package/dist/plugin/transformer/transformer-server-actions.js.map +0 -1
- package/dist/plugin/worker/rsc/createRscStream.d.ts +0 -5
- package/dist/plugin/worker/rsc/createRscStream.d.ts.map +0 -1
- package/dist/plugin/worker/rsc/createRscStream.js +0 -39
- package/dist/plugin/worker/rsc/createRscStream.js.map +0 -1
- package/dist/plugin/worker/rsc/development.d.ts +0 -5
- package/dist/plugin/worker/rsc/development.d.ts.map +0 -1
- package/dist/plugin/worker/rsc/development.js +0 -13
- package/dist/plugin/worker/rsc/development.js.map +0 -1
- package/dist/plugin/worker/rsc/plugin.js.map +0 -1
- package/dist/plugin/worker/rsc/production.d.ts +0 -5
- package/dist/plugin/worker/rsc/production.d.ts.map +0 -1
- package/dist/plugin/worker/rsc/production.js +0 -13
- package/dist/plugin/worker/rsc/production.js.map +0 -1
- package/plugin/build/createClientBuildConfig.ts +0 -21
- package/plugin/build/createServerBuildConfig.ts +0 -66
- package/plugin/build/createSharedBuildConfig.ts +0 -35
- package/plugin/build/mergeInputs.ts +0 -58
- package/plugin/config/moduleIdDefault.ts +0 -23
- package/plugin/helpers/createClientInputNormalizer.ts +0 -48
- package/plugin/helpers/createServerInputNormalizer.ts +0 -52
- package/plugin/helpers/createStaticInputNormalizer.ts +0 -26
- package/plugin/helpers/getModuleManifest.ts +0 -31
- package/plugin/helpers/inputNormalizerWorker.ts +0 -47
- package/plugin/helpers/normalizedRelativePath.ts +0 -59
- package/plugin/helpers/resolveFilePath.ts +0 -108
- package/plugin/helpers/resolveWorkerModule.ts +0 -41
- package/plugin/helpers/validateModuleBase.ts +0 -30
- package/plugin/helpers/validateResolvedConfig.ts +0 -21
- package/plugin/react-server/createDevMiddleware.ts +0 -91
- package/plugin/react-server/createDevServer.ts +0 -9
- package/plugin/react-server/createReactNodeStreamer.ts +0 -26
- package/plugin/transformer/transformer-client-components.ts +0 -94
- package/plugin/transformer/transformer-server-actions.ts +0 -110
- package/plugin/worker/rsc/createRscStream.ts +0 -42
- package/plugin/worker/rsc/development.ts +0 -6
- package/plugin/worker/rsc/production.ts +0 -6
- package/scripts/react-server-dom-esm+0.0.1.patch +0 -24775
package/dist/client.d.ts
CHANGED
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAGvE,mBAAmB,mBAAmB,CAAC"}
|
package/dist/client.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { StreamPluginOptions } from './plugin/types.js';
|
|
2
|
-
export declare const viteReactServer: (options: StreamPluginOptions) => Promise<import("vite").Plugin<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}> | (() => void)>;
|
|
6
|
-
export declare const viteReactClient: (options: StreamPluginOptions) => Promise<import("vite").Plugin<any> | (() => void)>;
|
|
7
|
-
export declare const viteReactStream: (options: StreamPluginOptions) => Promise<import("vite").Plugin<any> | (() => void)>;
|
|
2
|
+
export declare const viteReactServer: (options: StreamPluginOptions) => Promise<import("vite").Plugin<any>[] | (() => void)>;
|
|
3
|
+
export declare const viteReactClient: (options: StreamPluginOptions) => Promise<import("vite").Plugin<any>[] | (() => void)>;
|
|
4
|
+
export declare const viteReactStream: (options: StreamPluginOptions) => Promise<import("vite").Plugin<any>[] | (() => void)>;
|
|
8
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAI7D,eAAO,MAAM,eAAe,YAAmB,mBAAmB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAI7D,eAAO,MAAM,eAAe,YAAmB,mBAAmB,yDAOjE,CAAA;AAED,eAAO,MAAM,eAAe,YAAmB,mBAAmB,yDAOjE,CAAA;AAED,eAAO,MAAM,eAAe,YAAa,mBAAmB,yDAM3D,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ const viteReactServer = async (options) => {
|
|
|
10
10
|
};
|
|
11
11
|
} else {
|
|
12
12
|
const module = await import('./server.js');
|
|
13
|
-
return module.
|
|
13
|
+
return module.vitePluginReactServer(options);
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
const viteReactClient = async (options) => {
|
|
@@ -19,7 +19,7 @@ const viteReactClient = async (options) => {
|
|
|
19
19
|
};
|
|
20
20
|
} else {
|
|
21
21
|
const module = await import('./client.js');
|
|
22
|
-
return module.
|
|
22
|
+
return module.vitePluginReactClient(options);
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
const viteReactStream = (options) => {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../index.ts"],"sourcesContent":["\"use strict\";\n\nimport type { StreamPluginOptions } from './plugin/types.js';\n\nconst isServer = process.env['NODE_OPTIONS']?.match(/--conditions[= ]react-server/)\n\nexport const viteReactServer = async (options: StreamPluginOptions)=>{\n if(!isServer){\n return ()=>{}\n } else {\n const module = await import('./server.js')\n return module.
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../index.ts"],"sourcesContent":["\"use strict\";\n\nimport type { StreamPluginOptions } from './plugin/types.js';\n\nconst isServer = process.env['NODE_OPTIONS']?.match(/--conditions[= ]react-server/)\n\nexport const viteReactServer = async (options: StreamPluginOptions)=>{\n if(!isServer){\n return ()=>{}\n } else {\n const module = await import('./server.js')\n return module.vitePluginReactServer(options)\n }\n}\n\nexport const viteReactClient = async (options: StreamPluginOptions)=>{\n if(isServer){\n return ()=>{}\n } else {\n const module = await import('./client.js')\n return module.vitePluginReactClient(options)\n }\n}\n\nexport const viteReactStream = (options: StreamPluginOptions)=>{\n if(isServer){\n return viteReactClient(options)\n } else {\n return viteReactServer(options)\n }\n}"],"names":[],"mappings":";;;;;AAIA,MAAM,WAAW,OAAQ,CAAA,GAAA,CAAI,cAAc,CAAA,EAAG,MAAM,8BAA8B,CAAA;AAErE,MAAA,eAAA,GAAkB,OAAO,OAA+B,KAAA;AACnE,EAAA,IAAG,CAAC,QAAS,EAAA;AACX,IAAA,OAAO,MAAI;AAAA,KAAC;AAAA,GACP,MAAA;AACL,IAAM,MAAA,MAAA,GAAS,MAAM,OAAO,aAAa,CAAA;AACzC,IAAO,OAAA,MAAA,CAAO,sBAAsB,OAAO,CAAA;AAAA;AAE/C;AAEa,MAAA,eAAA,GAAkB,OAAO,OAA+B,KAAA;AACnE,EAAA,IAAG,QAAS,EAAA;AACR,IAAA,OAAO,MAAI;AAAA,KAAC;AAAA,GACT,MAAA;AACL,IAAM,MAAA,MAAA,GAAS,MAAM,OAAO,aAAa,CAAA;AACzC,IAAO,OAAA,MAAA,CAAO,sBAAsB,OAAO,CAAA;AAAA;AAE/C;AAEa,MAAA,eAAA,GAAkB,CAAC,OAA+B,KAAA;AAC7D,EAAA,IAAG,QAAS,EAAA;AACV,IAAA,OAAO,gBAAgB,OAAO,CAAA;AAAA,GACzB,MAAA;AACL,IAAA,OAAO,gBAAgB,OAAO,CAAA;AAAA;AAElC;;;;"}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-react-server",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.12",
|
|
4
4
|
"description": "Vite plugin for React Server Components (RSC)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/plugin/index.js",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"./loader": "./dist/plugin/worker/loader.js",
|
|
25
25
|
"./package.json": "./package.json",
|
|
26
26
|
"./patch": "./scripts/patch.mjs",
|
|
27
|
-
"./check-react-version": "./scripts/check-react-version.mjs"
|
|
27
|
+
"./check-react-version": "./scripts/check-react-version.mjs",
|
|
28
|
+
"./css-loader": "./dist/plugin/loader/css-loader.js"
|
|
28
29
|
},
|
|
29
30
|
"typesVersions": {
|
|
30
31
|
"*": {
|
|
@@ -61,14 +62,12 @@
|
|
|
61
62
|
"test": "npm run build && npm run test:client && NODE_ENV=development npm run test:server",
|
|
62
63
|
"test:coverage": "vitest run --coverage",
|
|
63
64
|
"test:ui": "vitest --ui",
|
|
65
|
+
"experimental:clean-install": "npm install react-server-dom-esm react@experimental react-dom@experimental",
|
|
64
66
|
"experimental:copy": "cp -r ./oss-experimental/* ./node_modules/",
|
|
65
|
-
"experimental:patch": "npx patch-package react-server-dom-esm --exclude 'nothing'
|
|
67
|
+
"experimental:patch": "npx patch-package react-server-dom-esm react react-dom --exclude 'nothing'",
|
|
66
68
|
"experimental:move-patches": "mv patches/* ./scripts/",
|
|
67
|
-
"experimental:setup": "rm -rf patches/* && npm
|
|
68
|
-
"
|
|
69
|
-
"postinstall": "npm install react-server-dom-esm && node scripts/check-react-version.mjs && patch-package",
|
|
70
|
-
"start": "cd template; NODE_OPTIONS='--conditions react-server' npx vite",
|
|
71
|
-
"template:build": "cd template && NODE_OPTIONS='--conditions react-server' npx vite build"
|
|
69
|
+
"experimental:setup": "rm -rf patches/* && npm run experimental:clean-install && npm run experimental:copy && npm run experimental:patch && npm run experimental:move-patches && node scripts/check-react-version.mjs",
|
|
70
|
+
"postinstall": "npm install react-server-dom-esm && node scripts/check-react-version.mjs && patch-package"
|
|
72
71
|
},
|
|
73
72
|
"keywords": [
|
|
74
73
|
"vite",
|
|
@@ -80,7 +79,7 @@
|
|
|
80
79
|
"author": "Nico Brinkkemper",
|
|
81
80
|
"license": "MIT",
|
|
82
81
|
"engines": {
|
|
83
|
-
"node": "^23.
|
|
82
|
+
"node": "^23.7.0"
|
|
84
83
|
},
|
|
85
84
|
"repository": {
|
|
86
85
|
"type": "git",
|
|
@@ -107,13 +106,12 @@
|
|
|
107
106
|
}
|
|
108
107
|
},
|
|
109
108
|
"devDependencies": {
|
|
110
|
-
"@types/node": "^20.17.16",
|
|
111
109
|
"@types/react": "^19.0.8",
|
|
112
110
|
"@types/react-dom": "^19.0.3",
|
|
113
111
|
"acorn-loose": "^8.3.0",
|
|
114
112
|
"patch-package": "^8.0.0",
|
|
115
|
-
"react": "^
|
|
116
|
-
"react-dom": "^
|
|
113
|
+
"react": "^0.0.0-experimental-e670e72f-20250214",
|
|
114
|
+
"react-dom": "^0.0.0-experimental-e670e72f-20250214",
|
|
117
115
|
"react-server-dom-esm": "^0.0.1",
|
|
118
116
|
"rollup": "^4.34.0",
|
|
119
117
|
"source-map": "^0.7.4",
|
|
@@ -122,9 +120,13 @@
|
|
|
122
120
|
"typescript": "^5.7.3",
|
|
123
121
|
"vite": "^6.0.11",
|
|
124
122
|
"vitest": "^3.0.4",
|
|
125
|
-
"webpack-sources": "^3.2.
|
|
123
|
+
"webpack-sources": "^3.2.3"
|
|
126
124
|
},
|
|
127
125
|
"bin": {
|
|
128
|
-
"
|
|
126
|
+
"check-react-version": "./scripts/check-react-version.mjs",
|
|
127
|
+
"patch": "./bin/patch.mjs"
|
|
128
|
+
},
|
|
129
|
+
"dependencies": {
|
|
130
|
+
"tsx": "^4.19.2"
|
|
129
131
|
}
|
|
130
132
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertServerCondition.d.ts","sourceRoot":"","sources":["../../plugin/assertServerCondition.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"assertServerCondition.d.ts","sourceRoot":"","sources":["../../plugin/assertServerCondition.ts"],"names":[],"mappings":"AAAA,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,OAAO,OAAO,EAAE,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,GAAG,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAWtH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function assertServerCondition(p) {
|
|
1
|
+
export function assertServerCondition(p) {
|
|
2
2
|
const nodeOptions = p.env['NODE_OPTIONS'];
|
|
3
3
|
if (!nodeOptions?.match(/--conditions[= ]react-server/)) {
|
|
4
4
|
if (!nodeOptions?.match(/--conditions/)) {
|
|
@@ -11,5 +11,3 @@ function assertServerCondition(p) {
|
|
|
11
11
|
return undefined;
|
|
12
12
|
}
|
|
13
13
|
;
|
|
14
|
-
assertServerCondition(process);
|
|
15
|
-
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { CheckFilesExistReturn,
|
|
2
|
-
export declare function checkFilesExist(pages: string[], options:
|
|
1
|
+
import type { CheckFilesExistReturn, ResolvedUserOptions } from "./types.js";
|
|
2
|
+
export declare function checkFilesExist(pages: string[], options: ResolvedUserOptions, root: string): Promise<CheckFilesExistReturn>;
|
|
3
3
|
//# sourceMappingURL=checkFilesExist.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkFilesExist.d.ts","sourceRoot":"","sources":["../../plugin/checkFilesExist.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"checkFilesExist.d.ts","sourceRoot":"","sources":["../../plugin/checkFilesExist.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAW7E,wBAAsB,eAAe,CACnC,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,EAAE,mBAAmB,EAC5B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,qBAAqB,CAAC,CA4ChC"}
|
|
@@ -4,74 +4,59 @@
|
|
|
4
4
|
* MIT License
|
|
5
5
|
*/
|
|
6
6
|
import { existsSync } from 'node:fs';
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
7
|
+
import { join } from 'node:path';
|
|
8
|
+
import 'vite';
|
|
9
|
+
import { createInputNormalizer } from './helpers/inputNormalizer.js';
|
|
9
10
|
|
|
11
|
+
const resolveFileOption = (pageOrProps) => {
|
|
12
|
+
if (typeof pageOrProps === "string") {
|
|
13
|
+
return () => pageOrProps;
|
|
14
|
+
}
|
|
15
|
+
return pageOrProps;
|
|
16
|
+
};
|
|
10
17
|
async function checkFilesExist(pages, options, root) {
|
|
18
|
+
if (!root || root === "") {
|
|
19
|
+
throw new Error("Root not found");
|
|
20
|
+
}
|
|
11
21
|
const errors = [];
|
|
12
22
|
const pageSet = /* @__PURE__ */ new Set();
|
|
13
|
-
const pageMap = /* @__PURE__ */ new Map();
|
|
14
|
-
const toKey = (path) => {
|
|
15
|
-
return relative(root, resolve(root, path)).replace(/\\/g, "/").replace(DEFAULT_CONFIG.FILE_REGEX, "").replace(/^\.\//, "");
|
|
16
|
-
};
|
|
17
|
-
if (typeof options.Page === "string") {
|
|
18
|
-
const pagePath = options.Page;
|
|
19
|
-
const fullPagePath = resolve(root, pagePath);
|
|
20
|
-
const key = toKey(pagePath);
|
|
21
|
-
pageMap.set(key, pagePath);
|
|
22
|
-
if (!pageSet.has(key)) {
|
|
23
|
-
if (!existsSync(fullPagePath)) {
|
|
24
|
-
errors.push(`Page file not found: ${pagePath}, ${fullPagePath}`);
|
|
25
|
-
}
|
|
26
|
-
pageSet.add(pagePath.replace(/^\//, ""));
|
|
27
|
-
}
|
|
28
|
-
} else if (typeof options.Page === "function" && pages) {
|
|
29
|
-
for (const page of pages) {
|
|
30
|
-
const pagePath = options.Page(page);
|
|
31
|
-
const fullPagePath = resolve(root, pagePath);
|
|
32
|
-
const key = toKey(pagePath);
|
|
33
|
-
pageMap.set(key, pagePath);
|
|
34
|
-
if (pageSet.has(key)) {
|
|
35
|
-
continue;
|
|
36
|
-
}
|
|
37
|
-
if (!existsSync(fullPagePath)) {
|
|
38
|
-
errors.push(`Page file not found: ${pagePath}, ${fullPagePath}`);
|
|
39
|
-
}
|
|
40
|
-
pageSet.add(pagePath);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
23
|
const propsSet = /* @__PURE__ */ new Set();
|
|
24
|
+
const pageMap = /* @__PURE__ */ new Map();
|
|
44
25
|
const propsMap = /* @__PURE__ */ new Map();
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
26
|
+
const urlMap = /* @__PURE__ */ new Map();
|
|
27
|
+
const normalizer = createInputNormalizer({
|
|
28
|
+
root,
|
|
29
|
+
preserveModulesRoot: options.build.preserveModulesRoot === true ? options.moduleBase : undefined,
|
|
30
|
+
removeExtension: true
|
|
31
|
+
});
|
|
32
|
+
const pageFn = resolveFileOption(options.Page);
|
|
33
|
+
const propsFn = resolveFileOption(options.props);
|
|
34
|
+
for (const page of pages) {
|
|
35
|
+
const pagePath = pageFn(page);
|
|
36
|
+
const propsPath = propsFn(page);
|
|
37
|
+
const [pageKey, pageValue] = normalizer(pagePath);
|
|
38
|
+
const [propsKey, propsValue] = normalizer(propsPath);
|
|
39
|
+
try {
|
|
40
|
+
if (!existsSync(join(root, pageValue))) {
|
|
41
|
+
errors.push(
|
|
42
|
+
`Page file not found: ${pagePath}, ${join(root, pagePath)}`
|
|
43
|
+
);
|
|
53
44
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const propsPath = options.props(page);
|
|
59
|
-
const fullPropsPath = resolve(root, propsPath);
|
|
60
|
-
const key = toKey(propsPath);
|
|
61
|
-
propsMap.set(key, propsPath);
|
|
62
|
-
if (propsSet.has(key)) {
|
|
63
|
-
continue;
|
|
64
|
-
}
|
|
65
|
-
if (!existsSync(fullPropsPath)) {
|
|
66
|
-
errors.push(`Props file not found: ${propsPath}, ${fullPropsPath}`);
|
|
45
|
+
if (!existsSync(join(root, propsValue))) {
|
|
46
|
+
errors.push(
|
|
47
|
+
`Props file not found: ${propsPath}, ${join(root, propsPath)}`
|
|
48
|
+
);
|
|
67
49
|
}
|
|
68
|
-
|
|
50
|
+
} catch (error) {
|
|
51
|
+
errors.push(`Error checking files: ${error}`);
|
|
69
52
|
}
|
|
53
|
+
urlMap.set(page, { props: propsPath, page: pagePath });
|
|
54
|
+
pageSet.add(pagePath);
|
|
55
|
+
propsSet.add(propsPath);
|
|
56
|
+
pageMap.set(pageKey, pageValue);
|
|
57
|
+
propsMap.set(propsKey, propsValue);
|
|
70
58
|
}
|
|
71
|
-
|
|
72
|
-
console.warn("React Stream Plugin Validation:\n" + errors.join("\n"));
|
|
73
|
-
}
|
|
74
|
-
return { pageMap, pageSet, propsMap, propsSet };
|
|
59
|
+
return { pageMap, pageSet, propsMap, propsSet, urlMap, errors };
|
|
75
60
|
}
|
|
76
61
|
|
|
77
62
|
export { checkFilesExist };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkFilesExist.js","sources":["../../plugin/checkFilesExist.ts"],"sourcesContent":["import { existsSync } from \"node:fs\";\nimport {
|
|
1
|
+
{"version":3,"file":"checkFilesExist.js","sources":["../../plugin/checkFilesExist.ts"],"sourcesContent":["import { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { CheckFilesExistReturn, ResolvedUserOptions } from \"./types.js\";\nimport { normalizePath } from \"vite\";\nimport { createInputNormalizer } from \"./helpers/inputNormalizer.js\";\n\nconst resolveFileOption = (pageOrProps: string | ((url: string) => string)) => {\n if (typeof pageOrProps === \"string\") {\n return () => pageOrProps;\n }\n return pageOrProps;\n};\n\nexport async function checkFilesExist(\n pages: string[],\n options: ResolvedUserOptions,\n root: string\n): Promise<CheckFilesExistReturn> {\n if (!root || root === \"\") {\n throw new Error(\"Root not found\");\n }\n const errors: string[] = [];\n const pageSet = new Set<string>();\n const propsSet = new Set<string>();\n const pageMap = new Map<string, string>();\n const propsMap = new Map<string, string>();\n const urlMap = new Map<string, { props: string; page: string }>();\n const normalizer = createInputNormalizer({\n root,\n preserveModulesRoot: options.build.preserveModulesRoot === true ? options.moduleBase : undefined,\n removeExtension: true,\n });\n const pageFn = resolveFileOption(options.Page);\n const propsFn = resolveFileOption(options.props);\n for (const page of pages) {\n const pagePath = pageFn(page);\n const propsPath = propsFn(page);\n const [pageKey, pageValue] = normalizer(pagePath);\n const [propsKey, propsValue] = normalizer(propsPath);\n try {\n if (!existsSync(join(root, pageValue))) {\n errors.push(\n `Page file not found: ${pagePath}, ${join(root, pagePath)}`\n );\n }\n if (!existsSync(join(root, propsValue))) {\n errors.push(\n `Props file not found: ${propsPath}, ${join(root, propsPath)}`\n );\n }\n } catch (error) {\n errors.push(`Error checking files: ${error}`);\n }\n urlMap.set(page, { props: propsPath, page: pagePath });\n pageSet.add(pagePath);\n propsSet.add(propsPath);\n pageMap.set(pageKey, pageValue);\n propsMap.set(propsKey, propsValue);\n }\n\n return { pageMap, pageSet, propsMap, propsSet, urlMap, errors };\n}\n"],"names":[],"mappings":";;;;;;;;;;AAMA,MAAM,iBAAA,GAAoB,CAAC,WAAoD,KAAA;AAC7E,EAAI,IAAA,OAAO,gBAAgB,QAAU,EAAA;AACnC,IAAA,OAAO,MAAM,WAAA;AAAA;AAEf,EAAO,OAAA,WAAA;AACT,CAAA;AAEsB,eAAA,eAAA,CACpB,KACA,EAAA,OAAA,EACA,IACgC,EAAA;AAChC,EAAI,IAAA,CAAC,IAAQ,IAAA,IAAA,KAAS,EAAI,EAAA;AACxB,IAAM,MAAA,IAAI,MAAM,gBAAgB,CAAA;AAAA;AAElC,EAAA,MAAM,SAAmB,EAAC;AAC1B,EAAM,MAAA,OAAA,uBAAc,GAAY,EAAA;AAChC,EAAM,MAAA,QAAA,uBAAe,GAAY,EAAA;AACjC,EAAM,MAAA,OAAA,uBAAc,GAAoB,EAAA;AACxC,EAAM,MAAA,QAAA,uBAAe,GAAoB,EAAA;AACzC,EAAM,MAAA,MAAA,uBAAa,GAA6C,EAAA;AAChE,EAAA,MAAM,aAAa,qBAAsB,CAAA;AAAA,IACvC,IAAA;AAAA,IACA,qBAAqB,OAAQ,CAAA,KAAA,CAAM,mBAAwB,KAAA,IAAA,GAAO,QAAQ,UAAa,GAAA,SAAA;AAAA,IACvF,eAAiB,EAAA;AAAA,GAClB,CAAA;AACD,EAAM,MAAA,MAAA,GAAS,iBAAkB,CAAA,OAAA,CAAQ,IAAI,CAAA;AAC7C,EAAM,MAAA,OAAA,GAAU,iBAAkB,CAAA,OAAA,CAAQ,KAAK,CAAA;AAC/C,EAAA,KAAA,MAAW,QAAQ,KAAO,EAAA;AACxB,IAAM,MAAA,QAAA,GAAW,OAAO,IAAI,CAAA;AAC5B,IAAM,MAAA,SAAA,GAAY,QAAQ,IAAI,CAAA;AAC9B,IAAA,MAAM,CAAC,OAAA,EAAS,SAAS,CAAA,GAAI,WAAW,QAAQ,CAAA;AAChD,IAAA,MAAM,CAAC,QAAA,EAAU,UAAU,CAAA,GAAI,WAAW,SAAS,CAAA;AACnD,IAAI,IAAA;AACF,MAAA,IAAI,CAAC,UAAW,CAAA,IAAA,CAAK,IAAM,EAAA,SAAS,CAAC,CAAG,EAAA;AACtC,QAAO,MAAA,CAAA,IAAA;AAAA,UACL,wBAAwB,QAAQ,CAAA,EAAA,EAAK,IAAK,CAAA,IAAA,EAAM,QAAQ,CAAC,CAAA;AAAA,SAC3D;AAAA;AAEF,MAAA,IAAI,CAAC,UAAW,CAAA,IAAA,CAAK,IAAM,EAAA,UAAU,CAAC,CAAG,EAAA;AACvC,QAAO,MAAA,CAAA,IAAA;AAAA,UACL,yBAAyB,SAAS,CAAA,EAAA,EAAK,IAAK,CAAA,IAAA,EAAM,SAAS,CAAC,CAAA;AAAA,SAC9D;AAAA;AACF,aACO,KAAO,EAAA;AACd,MAAO,MAAA,CAAA,IAAA,CAAK,CAAyB,sBAAA,EAAA,KAAK,CAAE,CAAA,CAAA;AAAA;AAE9C,IAAA,MAAA,CAAO,IAAI,IAAM,EAAA,EAAE,OAAO,SAAW,EAAA,IAAA,EAAM,UAAU,CAAA;AACrD,IAAA,OAAA,CAAQ,IAAI,QAAQ,CAAA;AACpB,IAAA,QAAA,CAAS,IAAI,SAAS,CAAA;AACtB,IAAQ,OAAA,CAAA,GAAA,CAAI,SAAS,SAAS,CAAA;AAC9B,IAAS,QAAA,CAAA,GAAA,CAAI,UAAU,UAAU,CAAA;AAAA;AAGnC,EAAA,OAAO,EAAE,OAAS,EAAA,OAAA,EAAS,QAAU,EAAA,QAAA,EAAU,QAAQ,MAAO,EAAA;AAChE;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collect-css-manifest.d.ts","sourceRoot":"","sources":["../../plugin/collect-css-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAElD,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,gCAqB/B;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,
|
|
1
|
+
{"version":3,"file":"collect-css-manifest.d.ts","sourceRoot":"","sources":["../../plugin/collect-css-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAElD,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,gCAqB/B;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,uBAiD/B"}
|
|
@@ -35,6 +35,11 @@ function collectManifestCss(manifest, root, pagePath, onCss) {
|
|
|
35
35
|
onCss?.(id);
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
|
+
if (id.endsWith(".css.js")) {
|
|
39
|
+
cssFiles.set(id.slice(0, -3), id.slice(0, -3));
|
|
40
|
+
onCss?.(id.slice(0, -3));
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
38
43
|
const entry = manifest[id];
|
|
39
44
|
if (!entry) return;
|
|
40
45
|
if (entry.css) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collect-css-manifest.js","sources":["../../plugin/collect-css-manifest.ts"],"sourcesContent":["import type { Manifest, ModuleGraph } from 'vite';\n\nexport async function collectModuleGraphCss(\n moduleGraph: ModuleGraph,\n pagePath: string,\n onCss?: (path: string) => void\n) {\n if (!pagePath) return new Map<string, string>();\n\n const cssFiles = new Map<string, string>();\n const pageModule = await moduleGraph.getModuleByUrl(pagePath, true);\n if (!pageModule) {\n return new Map<string, string>();\n }\n const seen = new Set<string>();\n const walkModule = (mod: any) => {\n if (!mod?.id || seen.has(mod.id)) return;\n seen.add(mod.id);\n if (mod?.id?.endsWith(\".css\")) {\n cssFiles.set(mod?.url, mod?.id);\n onCss?.(mod?.url);\n }\n mod?.importedModules?.forEach((imp: any) => walkModule(imp));\n };\n walkModule(pageModule);\n return cssFiles;\n}\n\nexport function collectManifestCss(\n manifest: Manifest,\n root: string,\n pagePath: string,\n onCss?: (path: string) => void\n) {\n const relativePagePath = pagePath.startsWith(root + \"/\")\n ? pagePath.slice(root.length + 1)\n : pagePath;\n if (!relativePagePath) return new Map<string, string>();\n const cssFiles = new Map<string, string>();\n const seen = new Set<string>();\n\n const walkManifestEntry = (id: string) => {\n if (seen.has(id)) return;\n seen.add(id);\n if (id.endsWith(\".css\")) {\n cssFiles.set(id, id);\n onCss?.(id);\n return;\n }\n // Get the manifest entry\n const entry = manifest[id];\n if (!entry) return;\n\n // Add direct CSS\n if (entry.css) {\n entry.css.forEach((css: string) => {\n cssFiles.set(entry.file, css);\n onCss?.(css);\n });\n }\n\n // Walk imports recursively\n if (entry.imports) {\n entry.imports.forEach((imp: string) => walkManifestEntry(imp));\n }\n\n // Also check dynamicImports\n if (entry.dynamicImports) {\n entry.dynamicImports.forEach((imp: string) => walkManifestEntry(imp));\n }\n };\n\n if (manifest[relativePagePath]) {\n walkManifestEntry(relativePagePath);\n }\n
|
|
1
|
+
{"version":3,"file":"collect-css-manifest.js","sources":["../../plugin/collect-css-manifest.ts"],"sourcesContent":["import type { Manifest, ModuleGraph } from 'vite';\n\nexport async function collectModuleGraphCss(\n moduleGraph: ModuleGraph,\n pagePath: string,\n onCss?: (path: string) => void\n) {\n if (!pagePath) return new Map<string, string>();\n\n const cssFiles = new Map<string, string>();\n const pageModule = await moduleGraph.getModuleByUrl(pagePath, true);\n if (!pageModule) {\n return new Map<string, string>();\n }\n const seen = new Set<string>();\n const walkModule = (mod: any) => {\n if (!mod?.id || seen.has(mod.id)) return;\n seen.add(mod.id);\n if (mod?.id?.endsWith(\".css\")) {\n cssFiles.set(mod?.url, mod?.id);\n onCss?.(mod?.url);\n }\n mod?.importedModules?.forEach((imp: any) => walkModule(imp));\n };\n walkModule(pageModule);\n return cssFiles;\n}\n\nexport function collectManifestCss(\n manifest: Manifest,\n root: string,\n pagePath: string,\n onCss?: (path: string) => void\n) {\n const relativePagePath = pagePath.startsWith(root + \"/\")\n ? pagePath.slice(root.length + 1)\n : pagePath;\n if (!relativePagePath) return new Map<string, string>();\n const cssFiles = new Map<string, string>();\n const seen = new Set<string>();\n\n const walkManifestEntry = (id: string) => {\n if (seen.has(id)) return;\n seen.add(id);\n if (id.endsWith(\".css\")) {\n cssFiles.set(id, id);\n onCss?.(id);\n return;\n }\n if (id.endsWith(\".css.js\")) {\n cssFiles.set(id.slice(0, -3), id.slice(0, -3));\n onCss?.(id.slice(0, -3));\n return;\n }\n // Get the manifest entry\n const entry = manifest[id];\n if (!entry) return;\n\n // Add direct CSS\n if (entry.css) {\n entry.css.forEach((css: string) => {\n cssFiles.set(entry.file, css);\n onCss?.(css);\n });\n }\n\n // Walk imports recursively\n if (entry.imports) {\n entry.imports.forEach((imp: string) => walkManifestEntry(imp));\n }\n\n // Also check dynamicImports\n if (entry.dynamicImports) {\n entry.dynamicImports.forEach((imp: string) => walkManifestEntry(imp));\n }\n };\n\n if (manifest[relativePagePath]) {\n walkManifestEntry(relativePagePath);\n }\n return cssFiles;\n}\n"],"names":[],"mappings":";;;;;AAEsB,eAAA,qBAAA,CACpB,WACA,EAAA,QAAA,EACA,KACA,EAAA;AACA,EAAA,IAAI,CAAC,QAAA,EAAiB,uBAAA,IAAI,GAAoB,EAAA;AAE9C,EAAM,MAAA,QAAA,uBAAe,GAAoB,EAAA;AACzC,EAAA,MAAM,UAAa,GAAA,MAAM,WAAY,CAAA,cAAA,CAAe,UAAU,IAAI,CAAA;AAClE,EAAA,IAAI,CAAC,UAAY,EAAA;AACf,IAAA,2BAAW,GAAoB,EAAA;AAAA;AAEjC,EAAM,MAAA,IAAA,uBAAW,GAAY,EAAA;AAC7B,EAAM,MAAA,UAAA,GAAa,CAAC,GAAa,KAAA;AAC/B,IAAA,IAAI,CAAC,GAAK,EAAA,EAAA,IAAM,KAAK,GAAI,CAAA,GAAA,CAAI,EAAE,CAAG,EAAA;AAClC,IAAK,IAAA,CAAA,GAAA,CAAI,IAAI,EAAE,CAAA;AACf,IAAA,IAAI,GAAK,EAAA,EAAA,EAAI,QAAS,CAAA,MAAM,CAAG,EAAA;AAC7B,MAAA,QAAA,CAAS,GAAI,CAAA,GAAA,EAAK,GAAK,EAAA,GAAA,EAAK,EAAE,CAAA;AACd;AAElB,IAAA,GAAA,EAAK,iBAAiB,OAAQ,CAAA,CAAC,GAAa,KAAA,UAAA,CAAW,GAAG,CAAC,CAAA;AAAA,GAC7D;AACA,EAAA,UAAA,CAAW,UAAU,CAAA;AACrB,EAAO,OAAA,QAAA;AACT;AAEO,SAAS,kBACd,CAAA,QAAA,EACA,IACA,EAAA,QAAA,EACA,KACA,EAAA;AACA,EAAM,MAAA,gBAAA,GAAmB,QAAS,CAAA,UAAA,CAAW,IAAO,GAAA,GAAG,CACnD,GAAA,QAAA,CAAS,KAAM,CAAA,IAAA,CAAK,MAAS,GAAA,CAAC,CAC9B,GAAA,QAAA;AACJ,EAAA,IAAI,CAAC,gBAAA,EAAyB,uBAAA,IAAI,GAAoB,EAAA;AACtD,EAAM,MAAA,QAAA,uBAAe,GAAoB,EAAA;AACzC,EAAM,MAAA,IAAA,uBAAW,GAAY,EAAA;AAE7B,EAAM,MAAA,iBAAA,GAAoB,CAAC,EAAe,KAAA;AACxC,IAAI,IAAA,IAAA,CAAK,GAAI,CAAA,EAAE,CAAG,EAAA;AAClB,IAAA,IAAA,CAAK,IAAI,EAAE,CAAA;AACX,IAAI,IAAA,EAAA,CAAG,QAAS,CAAA,MAAM,CAAG,EAAA;AACvB,MAAS,QAAA,CAAA,GAAA,CAAI,IAAI,EAAE,CAAA;AACnB,MAAA,KAAA,GAAQ,EAAE,CAAA;AACV,MAAA;AAAA;AAEF,IAAI,IAAA,EAAA,CAAG,QAAS,CAAA,SAAS,CAAG,EAAA;AAC1B,MAAS,QAAA,CAAA,GAAA,CAAI,EAAG,CAAA,KAAA,CAAM,CAAG,EAAA,EAAE,GAAG,EAAG,CAAA,KAAA,CAAM,CAAG,EAAA,EAAE,CAAC,CAAA;AAC7C,MAAA,KAAA,GAAQ,EAAG,CAAA,KAAA,CAAM,CAAG,EAAA,EAAE,CAAC,CAAA;AACvB,MAAA;AAAA;AAGF,IAAM,MAAA,KAAA,GAAQ,SAAS,EAAE,CAAA;AACzB,IAAA,IAAI,CAAC,KAAO,EAAA;AAGZ,IAAA,IAAI,MAAM,GAAK,EAAA;AACb,MAAM,KAAA,CAAA,GAAA,CAAI,OAAQ,CAAA,CAAC,GAAgB,KAAA;AACjC,QAAS,QAAA,CAAA,GAAA,CAAI,KAAM,CAAA,IAAA,EAAM,GAAG,CAAA;AAC5B,QAAA,KAAA,GAAQ,GAAG,CAAA;AAAA,OACZ,CAAA;AAAA;AAIH,IAAA,IAAI,MAAM,OAAS,EAAA;AACjB,MAAA,KAAA,CAAM,QAAQ,OAAQ,CAAA,CAAC,GAAgB,KAAA,iBAAA,CAAkB,GAAG,CAAC,CAAA;AAAA;AAI/D,IAAA,IAAI,MAAM,cAAgB,EAAA;AACxB,MAAA,KAAA,CAAM,eAAe,OAAQ,CAAA,CAAC,GAAgB,KAAA,iBAAA,CAAkB,GAAG,CAAC,CAAA;AAAA;AACtE,GACF;AAEA,EAAI,IAAA,QAAA,CAAS,gBAAgB,CAAG,EAAA;AAC9B,IAAA,iBAAA,CAAkB,gBAAgB,CAAA;AAAA;AAEpC,EAAO,OAAA,QAAA;AACT;;;;"}
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
+
import { createElement } from 'react';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* MIT License
|
|
3
|
+
* A component that emits <link> tags for CSS files during streaming.
|
|
4
|
+
* The high precedence ensures they bubble up to the document head.
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
precedence: "high"
|
|
14
|
-
});
|
|
6
|
+
export function CssCollector({ url, moduleBasePath }) {
|
|
7
|
+
return createElement('link', {
|
|
8
|
+
key: url,
|
|
9
|
+
rel: 'stylesheet',
|
|
10
|
+
href: url,
|
|
11
|
+
precedence: 'high'
|
|
12
|
+
});
|
|
15
13
|
}
|
|
16
|
-
|
|
17
|
-
export { CssCollector };
|
|
18
|
-
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const createModuleIdGenerator: ({ inputRoot, client, server, moduleBase, isProduction, preserveModulesRoot, imports, removeExtension }: {
|
|
2
|
+
isProduction: boolean;
|
|
3
|
+
inputRoot: string;
|
|
4
|
+
client: string;
|
|
5
|
+
server: string;
|
|
6
|
+
moduleBase: string;
|
|
7
|
+
preserveModulesRoot: boolean;
|
|
8
|
+
removeExtension: ((path: string) => boolean) | string | RegExp;
|
|
9
|
+
imports: Record<string, string>;
|
|
10
|
+
}) => (moduleIdPath: string, ssr?: boolean) => string;
|
|
11
|
+
//# sourceMappingURL=createModuleIdGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createModuleIdGenerator.d.ts","sourceRoot":"","sources":["../../../plugin/config/createModuleIdGenerator.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,2GASjC;IACD,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,eAAe,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/D,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC,oBAMuB,MAAM,0BAyB7B,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vite-plugin-react-server
|
|
3
|
+
* Copyright (c) Nico Brinkkemper
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
import { createInputNormalizer } from '../helpers/inputNormalizer.js';
|
|
7
|
+
|
|
8
|
+
const createModuleIdGenerator = ({
|
|
9
|
+
inputRoot,
|
|
10
|
+
client,
|
|
11
|
+
server,
|
|
12
|
+
moduleBase,
|
|
13
|
+
isProduction,
|
|
14
|
+
preserveModulesRoot,
|
|
15
|
+
imports,
|
|
16
|
+
removeExtension
|
|
17
|
+
}) => {
|
|
18
|
+
const normalizer = createInputNormalizer({
|
|
19
|
+
root: inputRoot,
|
|
20
|
+
removeExtension,
|
|
21
|
+
preserveModulesRoot: preserveModulesRoot === true ? moduleBase : undefined
|
|
22
|
+
});
|
|
23
|
+
return (moduleIdPath, ssr = isProduction) => {
|
|
24
|
+
const [moduleId, modulePath] = normalizer(moduleIdPath);
|
|
25
|
+
const key = preserveModulesRoot ? `${moduleBase}/${moduleId}` : moduleId;
|
|
26
|
+
const hasImports = key in imports;
|
|
27
|
+
if (hasImports) {
|
|
28
|
+
const mappedImport = imports[key];
|
|
29
|
+
const noRoot = mappedImport.startsWith(inputRoot) ? mappedImport.slice(inputRoot.length + 1) : mappedImport;
|
|
30
|
+
const noModuleBase = preserveModulesRoot ? noRoot.startsWith(moduleBase) ? noRoot.slice(moduleBase.length) : noRoot : noRoot;
|
|
31
|
+
return noModuleBase;
|
|
32
|
+
} else if (ssr && isProduction) {
|
|
33
|
+
const availableImports = Object.keys(imports).length > 0 ? Object.keys(imports).join(", ") : "none";
|
|
34
|
+
throw new Error(
|
|
35
|
+
`${availableImports === "none" ? "No imports." : `Module ID ${key}, ${modulePath} is not in imports. Available imports: ${availableImports}`}`
|
|
36
|
+
);
|
|
37
|
+
} else {
|
|
38
|
+
return moduleId;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { createModuleIdGenerator };
|
|
44
|
+
//# sourceMappingURL=createModuleIdGenerator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createModuleIdGenerator.js","sources":["../../../plugin/config/createModuleIdGenerator.ts"],"sourcesContent":["import { createInputNormalizer } from \"../helpers/inputNormalizer.js\";\n\nexport const createModuleIdGenerator = ({\n inputRoot,\n client,\n server,\n moduleBase,\n isProduction,\n preserveModulesRoot,\n imports,\n removeExtension\n}: {\n isProduction: boolean;\n inputRoot: string;\n client: string;\n server: string;\n moduleBase: string;\n preserveModulesRoot: boolean;\n removeExtension: ((path: string) => boolean) | string | RegExp;\n imports: Record<string, string>;\n}) => {\n const normalizer = createInputNormalizer({\n root: inputRoot,\n removeExtension: removeExtension,\n preserveModulesRoot: preserveModulesRoot === true ? moduleBase : undefined,\n });\n return (moduleIdPath: string, ssr = isProduction) => {\n const [moduleId, modulePath] = normalizer(moduleIdPath);\n const key = preserveModulesRoot ? `${moduleBase}/${moduleId}` : moduleId;\n const hasImports = key in imports;\n\n if (hasImports) {\n // Return the actual file path from the manifest\n const mappedImport = imports[key];\n const noRoot = mappedImport.startsWith(inputRoot) ? mappedImport.slice(inputRoot.length +1) : mappedImport;\n const noModuleBase = preserveModulesRoot ? noRoot.startsWith(moduleBase) ? noRoot.slice(moduleBase.length) : noRoot : noRoot;\n return noModuleBase;\n } else if (ssr && isProduction) {\n // Only throw in production SSR builds\n const availableImports =\n Object.keys(imports).length > 0\n ? Object.keys(imports).join(\", \")\n : \"none\";\n throw new Error(\n `${availableImports === \"none\" ? \"No imports.\" : `Module ID ${key}, ${modulePath} is not in imports. Available imports: ${availableImports}`}`\n );\n } else {\n // For development or non-SSR builds, use the module ID\n return moduleId;\n }\n };\n};\n"],"names":[],"mappings":";;;;;;;AAEO,MAAM,0BAA0B,CAAC;AAAA,EACtC,SAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,UAAA;AAAA,EACA,YAAA;AAAA,EACA,mBAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CASM,KAAA;AACJ,EAAA,MAAM,aAAa,qBAAsB,CAAA;AAAA,IACvC,IAAM,EAAA,SAAA;AAAA,IACN,eAAA;AAAA,IACA,mBAAA,EAAqB,mBAAwB,KAAA,IAAA,GAAO,UAAa,GAAA;AAAA,GAClE,CAAA;AACD,EAAO,OAAA,CAAC,YAAsB,EAAA,GAAA,GAAM,YAAiB,KAAA;AACnD,IAAA,MAAM,CAAC,QAAA,EAAU,UAAU,CAAA,GAAI,WAAW,YAAY,CAAA;AACtD,IAAA,MAAM,MAAM,mBAAsB,GAAA,CAAA,EAAG,UAAU,CAAA,CAAA,EAAI,QAAQ,CAAK,CAAA,GAAA,QAAA;AAChE,IAAA,MAAM,aAAa,GAAO,IAAA,OAAA;AAE1B,IAAA,IAAI,UAAY,EAAA;AAEd,MAAM,MAAA,YAAA,GAAe,QAAQ,GAAG,CAAA;AAChC,MAAM,MAAA,MAAA,GAAS,YAAa,CAAA,UAAA,CAAW,SAAS,CAAA,GAAI,aAAa,KAAM,CAAA,SAAA,CAAU,MAAQ,GAAA,CAAC,CAAI,GAAA,YAAA;AAC9F,MAAM,MAAA,YAAA,GAAe,mBAAsB,GAAA,MAAA,CAAO,UAAW,CAAA,UAAU,CAAI,GAAA,MAAA,CAAO,KAAM,CAAA,UAAA,CAAW,MAAM,CAAA,GAAI,MAAS,GAAA,MAAA;AACtH,MAAO,OAAA,YAAA;AAAA,KACT,MAAA,IAAW,OAAO,YAAc,EAAA;AAE9B,MAAA,MAAM,gBACJ,GAAA,MAAA,CAAO,IAAK,CAAA,OAAO,CAAE,CAAA,MAAA,GAAS,CAC1B,GAAA,MAAA,CAAO,IAAK,CAAA,OAAO,CAAE,CAAA,IAAA,CAAK,IAAI,CAC9B,GAAA,MAAA;AACN,MAAA,MAAM,IAAI,KAAA;AAAA,QACR,CAAA,EAAG,gBAAqB,KAAA,MAAA,GAAS,aAAgB,GAAA,CAAA,UAAA,EAAa,GAAG,CAAK,EAAA,EAAA,UAAU,CAA0C,uCAAA,EAAA,gBAAgB,CAAE,CAAA,CAAA;AAAA,OAC9I;AAAA,KACK,MAAA;AAEL,MAAO,OAAA,QAAA;AAAA;AACT,GACF;AACF;;;;"}
|
|
@@ -5,14 +5,14 @@ export declare const DEFAULT_CONFIG: {
|
|
|
5
5
|
readonly MODULE_BASE: "src";
|
|
6
6
|
readonly MODULE_BASE_PATH: "/src";
|
|
7
7
|
readonly MODULE_BASE_URL: "/src";
|
|
8
|
-
readonly PAGE: "
|
|
9
|
-
readonly PROPS: "
|
|
10
|
-
readonly CLIENT_ENTRY: "
|
|
11
|
-
readonly SERVER_ENTRY: "
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
-
readonly HTML_WORKER_PATH: "worker/html/html-worker.js";
|
|
15
|
-
readonly RSC_WORKER_PATH: "worker/rsc/rsc-worker.js";
|
|
8
|
+
readonly PAGE: "src/page/page.tsx";
|
|
9
|
+
readonly PROPS: "src/page/props.ts";
|
|
10
|
+
readonly CLIENT_ENTRY: "src/client.tsx";
|
|
11
|
+
readonly SERVER_ENTRY: "src/server.tsx";
|
|
12
|
+
readonly PAGE_EXPORT_NAME: "Page";
|
|
13
|
+
readonly PROPS_EXPORT_NAME: "props";
|
|
14
|
+
readonly HTML_WORKER_PATH: "worker/html/html-worker.production.js" | "worker/html/html-worker.development.js";
|
|
15
|
+
readonly RSC_WORKER_PATH: "worker/rsc/rsc-worker.production.js" | "worker/rsc/rsc-worker.development.js";
|
|
16
16
|
readonly LOADER_PATH: "worker/loader.js";
|
|
17
17
|
readonly RSC_EXTENSION: ".rsc";
|
|
18
18
|
readonly HTML: ({ children }: {
|
|
@@ -20,8 +20,6 @@ export declare const DEFAULT_CONFIG: {
|
|
|
20
20
|
}) => any;
|
|
21
21
|
readonly COLLECT_CSS: true;
|
|
22
22
|
readonly COLLECT_ASSETS: true;
|
|
23
|
-
readonly PAGE_PATTERN: "/src/page/**/*.page.tsx";
|
|
24
|
-
readonly PROPS_PATTERN: "/src/page/**/*.props.ts";
|
|
25
23
|
readonly DEV_PORT: 5173;
|
|
26
24
|
readonly PREVIEW_PORT: 4173;
|
|
27
25
|
readonly DEV_HOST: "localhost";
|
|
@@ -29,23 +27,28 @@ export declare const DEFAULT_CONFIG: {
|
|
|
29
27
|
readonly ENV_PREFIX: "VITE_";
|
|
30
28
|
readonly BUILD: {
|
|
31
29
|
readonly pages: () => string[];
|
|
32
|
-
readonly client: "
|
|
33
|
-
readonly server: "
|
|
34
|
-
readonly static: "
|
|
30
|
+
readonly client: "client";
|
|
31
|
+
readonly server: "server";
|
|
32
|
+
readonly static: "static";
|
|
33
|
+
readonly api: "api";
|
|
34
|
+
readonly outDir: "dist";
|
|
35
|
+
readonly assetsDir: "assets";
|
|
36
|
+
readonly hash: "hash";
|
|
37
|
+
readonly preserveModulesRoot: true;
|
|
35
38
|
};
|
|
36
39
|
readonly MODULE_BASE_EXCEPTIONS: string[];
|
|
37
40
|
readonly AUTO_DISCOVER: {
|
|
38
|
-
readonly
|
|
39
|
-
readonly
|
|
40
|
-
readonly
|
|
41
|
-
readonly
|
|
41
|
+
readonly modulePattern: (n: string) => boolean;
|
|
42
|
+
readonly pagePattern: (n: string) => boolean;
|
|
43
|
+
readonly propsPattern: (n: string) => boolean;
|
|
44
|
+
readonly clientComponents: (n: string) => boolean;
|
|
45
|
+
readonly serverFunctions: (n: string) => boolean;
|
|
46
|
+
readonly cssPattern: (n: string) => boolean;
|
|
47
|
+
readonly cssModulePattern: (n: string) => boolean;
|
|
48
|
+
readonly vendorPattern: (n: string) => boolean;
|
|
49
|
+
readonly htmlPattern: (n: string) => boolean;
|
|
50
|
+
readonly jsonPattern: (n: string) => boolean;
|
|
42
51
|
};
|
|
43
|
-
readonly MODULE_ID: (
|
|
44
|
-
isProduction: boolean;
|
|
45
|
-
projectRoot: string;
|
|
46
|
-
output: {
|
|
47
|
-
dir: string;
|
|
48
|
-
};
|
|
49
|
-
}) => (moduleId: string) => string;
|
|
52
|
+
readonly MODULE_ID: (id: string) => string;
|
|
50
53
|
};
|
|
51
54
|
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../plugin/config/defaults.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../plugin/config/defaults.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;kCAiBJ;QAAE,QAAQ,EAAE,GAAG,CAAA;KAAE;;;;;;;;;;;;;;;;;;;qCAmBR,MAAM,EAAE;;oCAEjB,MAAM;kCACR,MAAM;mCACL,MAAM;uCACF,MAAM;sCACP,MAAM;iCACX,MAAM;uCACA,MAAM;oCACT,MAAM;kCACR,MAAM;kCACN,MAAM;;6BAET,MAAM;CACd,CAAC"}
|