@modern-js/prod-server 2.56.1 → 2.57.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/dist/cjs/apply.js +6 -9
- package/dist/esm/apply.js +7 -12
- package/dist/esm-node/apply.js +7 -10
- package/dist/types/types.d.ts +2 -2
- package/package.json +8 -8
package/dist/cjs/apply.js
CHANGED
|
@@ -53,19 +53,16 @@ async function applyPlugins(serverBase, options, nodeServer) {
|
|
|
53
53
|
nodeServer
|
|
54
54
|
})
|
|
55
55
|
] : [],
|
|
56
|
-
(0, import_server_core.
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
...(0, import_server_core.createDefaultPlugins)({
|
|
57
|
+
cacheConfig,
|
|
58
|
+
staticGenerate: options.staticGenerate,
|
|
59
|
+
logger: getLogger()
|
|
60
|
+
}),
|
|
59
61
|
...options.plugins || [],
|
|
60
|
-
(0, import_server_core.processedByPlugin)(),
|
|
61
|
-
(0, import_server_core.logPlugin)(),
|
|
62
62
|
(0, import_node.injectResourcePlugin)(),
|
|
63
63
|
(0, import_node.serverStaticPlugin)(),
|
|
64
64
|
(0, import_server_core.faviconPlugin)(),
|
|
65
|
-
(0, import_server_core.renderPlugin)(
|
|
66
|
-
staticGenerate: options.staticGenerate,
|
|
67
|
-
cacheConfig
|
|
68
|
-
})
|
|
65
|
+
(0, import_server_core.renderPlugin)()
|
|
69
66
|
];
|
|
70
67
|
serverBase.addPlugins(plugins);
|
|
71
68
|
}
|
package/dist/esm/apply.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
2
2
|
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
3
3
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
4
|
-
import { ErrorDigest, createErrorHtml,
|
|
4
|
+
import { ErrorDigest, createErrorHtml, onError, renderPlugin, createDefaultPlugins, faviconPlugin } from "@modern-js/server-core";
|
|
5
5
|
import { serverStaticPlugin, injectResourcePlugin, loadCacheConfig, injectNodeSeverPlugin } from "@modern-js/server-core/node";
|
|
6
6
|
import { createLogger, isProd } from "@modern-js/utils";
|
|
7
7
|
function getLogger() {
|
|
@@ -37,20 +37,15 @@ function _applyPlugins() {
|
|
|
37
37
|
injectNodeSeverPlugin({
|
|
38
38
|
nodeServer
|
|
39
39
|
})
|
|
40
|
-
] : []).concat(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
processedByPlugin(),
|
|
46
|
-
logPlugin(),
|
|
40
|
+
] : []).concat(_to_consumable_array(createDefaultPlugins({
|
|
41
|
+
cacheConfig,
|
|
42
|
+
staticGenerate: options.staticGenerate,
|
|
43
|
+
logger: getLogger()
|
|
44
|
+
})), _to_consumable_array(options.plugins || []), [
|
|
47
45
|
injectResourcePlugin(),
|
|
48
46
|
serverStaticPlugin(),
|
|
49
47
|
faviconPlugin(),
|
|
50
|
-
renderPlugin(
|
|
51
|
-
staticGenerate: options.staticGenerate,
|
|
52
|
-
cacheConfig
|
|
53
|
-
})
|
|
48
|
+
renderPlugin()
|
|
54
49
|
]);
|
|
55
50
|
serverBase.addPlugins(plugins);
|
|
56
51
|
return [
|
package/dist/esm-node/apply.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorDigest, createErrorHtml,
|
|
1
|
+
import { ErrorDigest, createErrorHtml, onError, renderPlugin, createDefaultPlugins, faviconPlugin } from "@modern-js/server-core";
|
|
2
2
|
import { serverStaticPlugin, injectResourcePlugin, loadCacheConfig, injectNodeSeverPlugin } from "@modern-js/server-core/node";
|
|
3
3
|
import { createLogger, isProd } from "@modern-js/utils";
|
|
4
4
|
function getLogger() {
|
|
@@ -30,19 +30,16 @@ async function applyPlugins(serverBase, options, nodeServer) {
|
|
|
30
30
|
nodeServer
|
|
31
31
|
})
|
|
32
32
|
] : [],
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
...createDefaultPlugins({
|
|
34
|
+
cacheConfig,
|
|
35
|
+
staticGenerate: options.staticGenerate,
|
|
36
|
+
logger: getLogger()
|
|
37
|
+
}),
|
|
36
38
|
...options.plugins || [],
|
|
37
|
-
processedByPlugin(),
|
|
38
|
-
logPlugin(),
|
|
39
39
|
injectResourcePlugin(),
|
|
40
40
|
serverStaticPlugin(),
|
|
41
41
|
faviconPlugin(),
|
|
42
|
-
renderPlugin(
|
|
43
|
-
staticGenerate: options.staticGenerate,
|
|
44
|
-
cacheConfig
|
|
45
|
-
})
|
|
42
|
+
renderPlugin()
|
|
46
43
|
];
|
|
47
44
|
serverBase.addPlugins(plugins);
|
|
48
45
|
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ServerBaseOptions,
|
|
1
|
+
import { ServerBaseOptions, CreateDefaultPluginsOptions, ServerPlugin } from '@modern-js/server-core';
|
|
2
2
|
import { Reporter } from '@modern-js/types';
|
|
3
3
|
import { Logger } from '@modern-js/utils';
|
|
4
4
|
interface ProdServerExtraOptions {
|
|
@@ -8,7 +8,7 @@ interface ProdServerExtraOptions {
|
|
|
8
8
|
serverConfigPath?: string;
|
|
9
9
|
plugins?: ServerPlugin[];
|
|
10
10
|
}
|
|
11
|
-
export type ProdServerOptions = Exclude<ServerBaseOptions, 'serverConfig'> & ProdServerExtraOptions &
|
|
11
|
+
export type ProdServerOptions = Exclude<ServerBaseOptions, 'serverConfig'> & ProdServerExtraOptions & CreateDefaultPluginsOptions;
|
|
12
12
|
export type BaseEnv = {
|
|
13
13
|
Variables: {
|
|
14
14
|
logger: Logger;
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.
|
|
18
|
+
"version": "2.57.0",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"source-map-support": "0.5.21",
|
|
44
44
|
"@swc/helpers": "0.5.3",
|
|
45
|
-
"@modern-js/server-core": "2.
|
|
46
|
-
"@modern-js/
|
|
47
|
-
"@modern-js/utils": "2.
|
|
45
|
+
"@modern-js/server-core": "2.57.0",
|
|
46
|
+
"@modern-js/utils": "2.57.0",
|
|
47
|
+
"@modern-js/runtime-utils": "2.57.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/merge-deep": "^3.0.0",
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
"tsx": "^3.12.7",
|
|
59
59
|
"@types/jest": "^29",
|
|
60
60
|
"typescript": "~5.0.4",
|
|
61
|
-
"@scripts/build": "2.
|
|
62
|
-
"@modern-js/
|
|
63
|
-
"@
|
|
64
|
-
"@
|
|
61
|
+
"@scripts/build": "2.57.0",
|
|
62
|
+
"@modern-js/types": "2.57.0",
|
|
63
|
+
"@scripts/jest-config": "2.57.0",
|
|
64
|
+
"@modern-js/eslint-config": "2.57.0"
|
|
65
65
|
},
|
|
66
66
|
"sideEffects": [],
|
|
67
67
|
"engines": {
|