@modern-js/plugin-ssg 3.9.0 → 3.9.2

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.
@@ -62,7 +62,7 @@ function makeRoute(baseRoute, route, headers = {}) {
62
62
  headers,
63
63
  output: external_path_default().join(entryPath, `..${'/' === route ? '' : route}`)
64
64
  };
65
- return {
65
+ else return {
66
66
  ...baseRoute,
67
67
  urlPath: external_normalize_path_default()(`${urlPath}${route.url}`) || '/',
68
68
  headers: {
@@ -136,7 +136,7 @@ const standardOptions = (ssgOptions, entrypoints, routes, server, ssgByEntries)=
136
136
  opt[entry.entryName] = ssgOptions;
137
137
  return opt;
138
138
  }, {});
139
- if ('object' == typeof ssgOptions) {
139
+ else if ('object' == typeof ssgOptions) {
140
140
  const isSingle = (0, utils_namespaceObject.isSingleEntry)(entrypoints);
141
141
  if (isSingle) return {
142
142
  main: ssgOptions
@@ -145,8 +145,7 @@ const standardOptions = (ssgOptions, entrypoints, routes, server, ssgByEntries)=
145
145
  opt[entry.entryName] = ssgOptions;
146
146
  return opt;
147
147
  }, {});
148
- }
149
- if ('function' == typeof ssgOptions) {
148
+ } else if ('function' == typeof ssgOptions) {
150
149
  const intermediateOptions = {};
151
150
  for (const entrypoint of entrypoints){
152
151
  const { entryName } = entrypoint;
@@ -18,7 +18,7 @@ function makeRoute(baseRoute, route, headers = {}) {
18
18
  headers,
19
19
  output: path.join(entryPath, `..${'/' === route ? '' : route}`)
20
20
  };
21
- return {
21
+ else return {
22
22
  ...baseRoute,
23
23
  urlPath: normalize_path(`${urlPath}${route.url}`) || '/',
24
24
  headers: {
@@ -83,7 +83,7 @@ const standardOptions = (ssgOptions, entrypoints, routes, server, ssgByEntries)=
83
83
  opt[entry.entryName] = ssgOptions;
84
84
  return opt;
85
85
  }, {});
86
- if ('object' == typeof ssgOptions) {
86
+ else if ('object' == typeof ssgOptions) {
87
87
  const isSingle = isSingleEntry(entrypoints);
88
88
  if (isSingle) return {
89
89
  main: ssgOptions
@@ -92,8 +92,7 @@ const standardOptions = (ssgOptions, entrypoints, routes, server, ssgByEntries)=
92
92
  opt[entry.entryName] = ssgOptions;
93
93
  return opt;
94
94
  }, {});
95
- }
96
- if ('function' == typeof ssgOptions) {
95
+ } else if ('function' == typeof ssgOptions) {
97
96
  const intermediateOptions = {};
98
97
  for (const entrypoint of entrypoints){
99
98
  const { entryName } = entrypoint;
@@ -19,7 +19,7 @@ function makeRoute(baseRoute, route, headers = {}) {
19
19
  headers,
20
20
  output: path.join(entryPath, `..${'/' === route ? '' : route}`)
21
21
  };
22
- return {
22
+ else return {
23
23
  ...baseRoute,
24
24
  urlPath: normalize_path(`${urlPath}${route.url}`) || '/',
25
25
  headers: {
@@ -85,7 +85,7 @@ const standardOptions = (ssgOptions, entrypoints, routes, server, ssgByEntries)=
85
85
  opt[entry.entryName] = ssgOptions;
86
86
  return opt;
87
87
  }, {});
88
- if ('object' == typeof ssgOptions) {
88
+ else if ('object' == typeof ssgOptions) {
89
89
  const isSingle = isSingleEntry(entrypoints);
90
90
  if (isSingle) return {
91
91
  main: ssgOptions
@@ -94,8 +94,7 @@ const standardOptions = (ssgOptions, entrypoints, routes, server, ssgByEntries)=
94
94
  opt[entry.entryName] = ssgOptions;
95
95
  return opt;
96
96
  }, {});
97
- }
98
- if ('function' == typeof ssgOptions) {
97
+ } else if ('function' == typeof ssgOptions) {
99
98
  const intermediateOptions = {};
100
99
  for (const entrypoint of entrypoints){
101
100
  const { entryName } = entrypoint;
@@ -1,5 +1,5 @@
1
1
  import type { ServerRoute as ModernRoute } from '@modern-js/types';
2
- import type { compile } from '../server/prerender';
3
- import type { SSGRouteOptions, SsgRoute } from '../types';
2
+ import type { compile } from '../server/prerender.js';
3
+ import type { SSGRouteOptions, SsgRoute } from '../types.js';
4
4
  export declare function makeRender(ssgRoutes: SsgRoute[], render: ReturnType<typeof compile>, port: number): Promise<string>[];
5
5
  export declare function makeRoute(baseRoute: ModernRoute, route: string | SSGRouteOptions, headers?: Record<string, any>): SsgRoute;
@@ -1,2 +1,2 @@
1
- import type { SsgRoute } from '../types';
1
+ import type { SsgRoute } from '../types.js';
2
2
  export declare function writeHtmlFile(htmlAry: string[], ssgRoutes: SsgRoute[], baseDir: string): void;
@@ -1,4 +1,4 @@
1
1
  import type { ServerRoute as ModernRoute } from '@modern-js/types';
2
- import type { SsgRoute } from '../types';
2
+ import type { SsgRoute } from '../types.js';
3
3
  export declare function exist(route: ModernRoute, pageRoutes: ModernRoute[]): number;
4
4
  export declare function replaceRoute(ssgRoutes: SsgRoute[], pageRoutes: ModernRoute[]): ModernRoute[];
@@ -1,6 +1,6 @@
1
1
  import type { ServerUserConfig } from '@modern-js/app-tools';
2
2
  import type { ServerRoute as ModernRoute } from '@modern-js/types';
3
- import type { AgreedRoute, EntryPoint, SSGConfig, SSGMultiEntryOptions, SsgRoute } from '../types';
3
+ import type { AgreedRoute, EntryPoint, SSGConfig, SSGMultiEntryOptions, SsgRoute } from '../types.js';
4
4
  export declare function formatOutput(filename: string): string;
5
5
  export declare function formatPath(str: string): string;
6
6
  export declare function isDynamicUrl(url: string): boolean;
@@ -1,4 +1,4 @@
1
1
  import type { AppNormalizedConfig, AppToolsContext } from '@modern-js/app-tools';
2
2
  import type { ServerRoute as ModernRoute } from '@modern-js/types';
3
- import type { SsgRoute } from '../types';
3
+ import type { SsgRoute } from '../types.js';
4
4
  export declare const createServer: (appContext: AppToolsContext, ssgRoutes: SsgRoute[], pageRoutes: ModernRoute[], apiRoutes: ModernRoute[], options: AppNormalizedConfig) => Promise<string[]>;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.9.0",
18
+ "version": "3.9.2",
19
19
  "types": "./dist/types/index.d.ts",
20
20
  "main": "./dist/cjs/index.js",
21
21
  "typesVersions": {
@@ -47,8 +47,8 @@
47
47
  "@swc/helpers": "^0.5.17",
48
48
  "node-mocks-http": "^1.17.2",
49
49
  "normalize-path": "3.0.0",
50
- "@modern-js/prod-server": "3.9.0",
51
- "@modern-js/utils": "3.9.0"
50
+ "@modern-js/prod-server": "3.9.2",
51
+ "@modern-js/utils": "3.9.2"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "react-router-dom": ">=7.13.1"
@@ -59,15 +59,15 @@
59
59
  }
60
60
  },
61
61
  "devDependencies": {
62
- "@rslib/core": "0.23.2",
62
+ "@rslib/core": "1.0.0",
63
63
  "@types/node": "^20",
64
64
  "react": "^19.2.8",
65
65
  "react-dom": "^19.2.8",
66
66
  "react-router-dom": "^7.13.1",
67
67
  "typescript": "^5",
68
+ "@modern-js/app-tools": "3.9.2",
68
69
  "@modern-js/rslib": "2.68.10",
69
- "@modern-js/app-tools": "3.9.0",
70
- "@modern-js/types": "3.9.0",
70
+ "@modern-js/types": "3.9.2",
71
71
  "@scripts/rstest-config": "2.66.0"
72
72
  },
73
73
  "sideEffects": false,