@taujs/server 0.2.3 → 0.2.4
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/build.d.ts +2 -2
- package/dist/build.js +5 -5
- package/dist/index.d.ts +4 -6
- package/package.json +1 -1
package/dist/build.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ type Config = {
|
|
|
5
5
|
entryPoint: string;
|
|
6
6
|
plugins?: PluginOption[];
|
|
7
7
|
};
|
|
8
|
-
declare function taujsBuild({
|
|
9
|
-
|
|
8
|
+
declare function taujsBuild({ configs, projectRoot, clientBaseDir, isSSRBuild, }: {
|
|
9
|
+
configs: Config[];
|
|
10
10
|
projectRoot: string;
|
|
11
11
|
clientBaseDir: string;
|
|
12
12
|
isSSRBuild?: boolean;
|
package/dist/build.js
CHANGED
|
@@ -589,7 +589,7 @@ var SSRServer = (0, import_fastify_plugin.default)(
|
|
|
589
589
|
|
|
590
590
|
// src/build.ts
|
|
591
591
|
async function taujsBuild({
|
|
592
|
-
|
|
592
|
+
configs,
|
|
593
593
|
projectRoot,
|
|
594
594
|
clientBaseDir,
|
|
595
595
|
isSSRBuild = process.env.BUILD_MODE === "ssr"
|
|
@@ -603,10 +603,10 @@ async function taujsBuild({
|
|
|
603
603
|
console.error("Error deleting dist directory:", err);
|
|
604
604
|
}
|
|
605
605
|
};
|
|
606
|
-
const processedConfigs = processConfigs(
|
|
606
|
+
const processedConfigs = processConfigs(configs, clientBaseDir, TEMPLATE);
|
|
607
607
|
if (!isSSRBuild) await deleteDist();
|
|
608
|
-
for (const
|
|
609
|
-
const { appId, entryPoint, clientRoot, entryClient, entryServer, htmlTemplate, plugins = [] } =
|
|
608
|
+
for (const config of processedConfigs) {
|
|
609
|
+
const { appId, entryPoint, clientRoot, entryClient, entryServer, htmlTemplate, plugins = [] } = config;
|
|
610
610
|
const outDir = path3.resolve(projectRoot, `dist/client/${entryPoint}`);
|
|
611
611
|
const root = entryPoint ? path3.resolve(clientBaseDir, entryPoint) : clientBaseDir;
|
|
612
612
|
const server = path3.resolve(clientRoot, `${entryServer}.tsx`);
|
|
@@ -632,7 +632,7 @@ async function taujsBuild({
|
|
|
632
632
|
scss: { api: "modern-compiler" }
|
|
633
633
|
}
|
|
634
634
|
},
|
|
635
|
-
plugins: [...
|
|
635
|
+
plugins: [...config.plugins ?? [], nodePolyfills({ include: ["fs", "stream"] })],
|
|
636
636
|
publicDir: "public",
|
|
637
637
|
resolve: {
|
|
638
638
|
alias: {
|
package/dist/index.d.ts
CHANGED
|
@@ -47,11 +47,9 @@ type SSRServerOptions = {
|
|
|
47
47
|
serviceRegistry: ServiceRegistry;
|
|
48
48
|
isDebug?: boolean;
|
|
49
49
|
};
|
|
50
|
-
type
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
54
|
-
};
|
|
50
|
+
type ServiceMethod = (params: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
51
|
+
type NamedService = Record<string, ServiceMethod>;
|
|
52
|
+
type ServiceRegistry = Record<string, NamedService>;
|
|
55
53
|
type RenderCallbacks = {
|
|
56
54
|
onHead: (headContent: string) => void;
|
|
57
55
|
onFinish: (initialDataResolved: unknown) => void;
|
|
@@ -112,4 +110,4 @@ interface InitialRouteParams extends Record<string, unknown> {
|
|
|
112
110
|
type RouteParams = InitialRouteParams & Record<string, unknown>;
|
|
113
111
|
type RoutePathsAndAttributes<Params = {}> = Omit<Route<Params>, 'element'>;
|
|
114
112
|
|
|
115
|
-
export { type Config, type FetchConfig, type InitialRouteParams, type Manifest, type ManifestEntry, type ProcessedConfig, type RenderCallbacks, type RenderModule, type RenderSSR, type RenderStream, type Route, type RouteAttributes, type RouteParams, type RoutePathsAndAttributes, type SSRManifest, SSRServer, type SSRServerOptions, type ServiceRegistry, TEMPLATE, createMaps, processConfigs };
|
|
113
|
+
export { type Config, type FetchConfig, type InitialRouteParams, type Manifest, type ManifestEntry, type NamedService, type ProcessedConfig, type RenderCallbacks, type RenderModule, type RenderSSR, type RenderStream, type Route, type RouteAttributes, type RouteParams, type RoutePathsAndAttributes, type SSRManifest, SSRServer, type SSRServerOptions, type ServiceMethod, type ServiceRegistry, TEMPLATE, createMaps, processConfigs };
|