@modern-js/ssg-generator 3.1.29 → 3.1.30
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/index.js +23 -15
- package/package.json +7 -7
package/dist/index.js
CHANGED
@@ -113724,6 +113724,8 @@ var require_chainId = __commonJS({
|
|
113724
113724
|
YAML: "yaml",
|
113725
113725
|
/** Rule for wasm */
|
113726
113726
|
WASM: "wasm",
|
113727
|
+
/** Rule for node */
|
113728
|
+
NODE: "node",
|
113727
113729
|
/** Rule for bff */
|
113728
113730
|
JS_BFF_API: "js-bff-api"
|
113729
113731
|
},
|
@@ -113762,6 +113764,8 @@ var require_chainId = __commonJS({
|
|
113762
113764
|
TOML: "toml",
|
113763
113765
|
/** html-loader */
|
113764
113766
|
HTML: "html",
|
113767
|
+
/** node-loader */
|
113768
|
+
NODE: "html",
|
113765
113769
|
/** babel-loader */
|
113766
113770
|
BABEL: "babel",
|
113767
113771
|
/** esbuild-loader */
|
@@ -114022,7 +114026,6 @@ var require_constants = __commonJS({
|
|
114022
114026
|
};
|
114023
114027
|
var INTERNAL_MODULE_TOOLS_PLUGINS = {
|
114024
114028
|
"@modern-js/module-tools": "@modern-js/module-tools",
|
114025
|
-
"@modern-js/doc-tools": "@modern-js/doc-tools",
|
114026
114029
|
"@modern-js/runtime": "@modern-js/runtime/cli",
|
114027
114030
|
"@modern-js/plugin-testing": "@modern-js/plugin-testing/cli",
|
114028
114031
|
"@modern-js/plugin-storybook": "@modern-js/plugin-storybook/cli",
|
@@ -114300,11 +114303,12 @@ var require_config2 = __commonJS({
|
|
114300
114303
|
});
|
114301
114304
|
var _type = require_type();
|
114302
114305
|
var isSSR = (config) => {
|
114306
|
+
var _server, _server1;
|
114303
114307
|
const { server } = config;
|
114304
|
-
if (server === null ||
|
114308
|
+
if ((_server = server) === null || _server === void 0 ? void 0 : _server.ssr) {
|
114305
114309
|
return true;
|
114306
114310
|
}
|
114307
|
-
if ((server === null ||
|
114311
|
+
if (((_server1 = server) === null || _server1 === void 0 ? void 0 : _server1.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
|
114308
114312
|
for (const name of Object.keys(server.ssrByEntries)) {
|
114309
114313
|
if (server.ssrByEntries[name]) {
|
114310
114314
|
return true;
|
@@ -114314,27 +114318,29 @@ var require_config2 = __commonJS({
|
|
114314
114318
|
return false;
|
114315
114319
|
};
|
114316
114320
|
var isUseSSRBundle = (config) => {
|
114321
|
+
var _output;
|
114317
114322
|
const { output: output2 } = config;
|
114318
|
-
if (output2 === null ||
|
114323
|
+
if ((_output = output2) === null || _output === void 0 ? void 0 : _output.ssg) {
|
114319
114324
|
return true;
|
114320
114325
|
}
|
114321
114326
|
return isSSR(config);
|
114322
114327
|
};
|
114323
114328
|
var isServiceWorker = (config) => {
|
114324
|
-
var _deploy_worker;
|
114329
|
+
var _deploy_worker, _deploy, _output;
|
114325
114330
|
const { output: output2, deploy } = config;
|
114326
|
-
if ((deploy === null ||
|
114331
|
+
if (((_deploy = deploy) === null || _deploy === void 0 ? void 0 : (_deploy_worker = _deploy.worker) === null || _deploy_worker === void 0 ? void 0 : _deploy_worker.ssr) && (((_output = output2) === null || _output === void 0 ? void 0 : _output.ssg) || isSSR(config))) {
|
114327
114332
|
return true;
|
114328
114333
|
}
|
114329
114334
|
return false;
|
114330
114335
|
};
|
114331
114336
|
var isRouterV5 = (config) => {
|
114332
|
-
var _config_runtime, _config_runtime1,
|
114333
|
-
return typeof ((_config_runtime = config.runtime) === null || _config_runtime === void 0 ? void 0 : _config_runtime.router) !== "boolean" && (config === null ||
|
114337
|
+
var _config_runtime, _config_runtime_router, _config_runtime1, _config;
|
114338
|
+
return typeof ((_config_runtime = config.runtime) === null || _config_runtime === void 0 ? void 0 : _config_runtime.router) !== "boolean" && ((_config = config) === null || _config === void 0 ? void 0 : (_config_runtime1 = _config.runtime) === null || _config_runtime1 === void 0 ? void 0 : (_config_runtime_router = _config_runtime1.router) === null || _config_runtime_router === void 0 ? void 0 : _config_runtime_router.mode) === "react-router-5";
|
114334
114339
|
};
|
114335
114340
|
var isSSGEntry = (config, entryName, entrypoints) => {
|
114341
|
+
var _ssgConfig, _ssgConfig1;
|
114336
114342
|
const ssgConfig = config.output.ssg;
|
114337
|
-
const useSSG = isSingleEntry(entrypoints) ? Boolean(ssgConfig) : ssgConfig === true || typeof (ssgConfig === null ||
|
114343
|
+
const useSSG = isSingleEntry(entrypoints) ? Boolean(ssgConfig) : ssgConfig === true || typeof ((_ssgConfig = ssgConfig) === null || _ssgConfig === void 0 ? void 0 : _ssgConfig[0]) === "function" || Boolean((_ssgConfig1 = ssgConfig) === null || _ssgConfig1 === void 0 ? void 0 : _ssgConfig1[entryName]);
|
114338
114344
|
return useSSG;
|
114339
114345
|
};
|
114340
114346
|
var isSingleEntry = (entrypoints) => entrypoints.length === 1 && entrypoints[0].entryName === "main";
|
@@ -115081,7 +115087,7 @@ var require_alias = __commonJS({
|
|
115081
115087
|
};
|
115082
115088
|
var mergeAlias = (alias) => (0, _applyOptionsChain.applyOptionsChain)({}, alias);
|
115083
115089
|
var getAliasConfig = (aliasOption, option) => {
|
115084
|
-
var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
|
115090
|
+
var _tsconfig_compilerOptions, _tsconfig, _tsconfig_compilerOptions1, _tsconfig1;
|
115085
115091
|
const isTsProject2 = _fs.default.existsSync(option.tsconfigPath);
|
115086
115092
|
const alias = mergeAlias(aliasOption);
|
115087
115093
|
if (!isTsProject2) {
|
@@ -115093,10 +115099,10 @@ var require_alias = __commonJS({
|
|
115093
115099
|
};
|
115094
115100
|
}
|
115095
115101
|
const tsconfig = (0, _get.readTsConfigByFile)(option.tsconfigPath);
|
115096
|
-
const baseUrl = tsconfig === null ||
|
115102
|
+
const baseUrl = (_tsconfig = tsconfig) === null || _tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = _tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
|
115097
115103
|
return {
|
115098
115104
|
absoluteBaseUrl: baseUrl ? _path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
|
115099
|
-
paths: __spreadValues(__spreadValues({}, alias), tsconfig === null ||
|
115105
|
+
paths: __spreadValues(__spreadValues({}, alias), (_tsconfig1 = tsconfig) === null || _tsconfig1 === void 0 ? void 0 : (_tsconfig_compilerOptions1 = _tsconfig1.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths),
|
115100
115106
|
isTsPath: true,
|
115101
115107
|
isTsProject: isTsProject2
|
115102
115108
|
};
|
@@ -115635,7 +115641,8 @@ var require_prettyInstructions = __commonJS({
|
|
115635
115641
|
const LOCAL_LABEL = "Local: ";
|
115636
115642
|
const NETWORK_LABEL = "Network: ";
|
115637
115643
|
const isLocalhost = (url) => {
|
115638
|
-
|
115644
|
+
var _url;
|
115645
|
+
return (_url = url) === null || _url === void 0 ? void 0 : _url.includes("localhost");
|
115639
115646
|
};
|
115640
115647
|
if (host && host !== _constants.DEFAULT_DEV_HOST) {
|
115641
115648
|
return [
|
@@ -115664,7 +115671,7 @@ var require_prettyInstructions = __commonJS({
|
|
115664
115671
|
var prettyInstructions = (appContext, config) => {
|
115665
115672
|
var _appContext_builder_context_devServer, _appContext_builder, _config_dev;
|
115666
115673
|
const { entrypoints, serverRoutes, port, apiOnly, checkedEntries } = appContext;
|
115667
|
-
const isHttps = (0, _is.isDev)() && ((
|
115674
|
+
const isHttps = (0, _is.isDev)() && ((_appContext_builder = appContext.builder) === null || _appContext_builder === void 0 ? void 0 : (_appContext_builder_context_devServer = _appContext_builder.context.devServer) === null || _appContext_builder_context_devServer === void 0 ? void 0 : _appContext_builder_context_devServer.https);
|
115668
115675
|
const urls = getAddressUrls(isHttps ? "https" : "http", port, (_config_dev = config.dev) === null || _config_dev === void 0 ? void 0 : _config_dev.host);
|
115669
115676
|
const routes = !apiOnly ? serverRoutes.filter((route) => route.entryName) : serverRoutes;
|
115670
115677
|
let message = "App running at:\n\n";
|
@@ -115729,8 +115736,9 @@ var require_require = __commonJS({
|
|
115729
115736
|
});
|
115730
115737
|
var _fs = require_fs();
|
115731
115738
|
var compatRequire = (filePath, interop = true) => {
|
115739
|
+
var _mod;
|
115732
115740
|
const mod = require(filePath);
|
115733
|
-
const rtnESMDefault = interop && (mod === null ||
|
115741
|
+
const rtnESMDefault = interop && ((_mod = mod) === null || _mod === void 0 ? void 0 : _mod.__esModule);
|
115734
115742
|
return rtnESMDefault ? mod.default : mod;
|
115735
115743
|
};
|
115736
115744
|
var dynamicImport = new Function("modulePath", "return import(modulePath)");
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "3.1.
|
18
|
+
"version": "3.1.30",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"main": "./dist/index.js",
|
21
21
|
"files": [
|
@@ -29,12 +29,12 @@
|
|
29
29
|
"@types/node": "^14",
|
30
30
|
"jest": "^29",
|
31
31
|
"typescript": "^5",
|
32
|
-
"@modern-js/generator-common": "3.1.
|
33
|
-
"@modern-js/generator-utils": "3.1.
|
34
|
-
"@modern-js/plugin-i18n": "2.
|
35
|
-
"@modern-js/dependence-generator": "3.1.
|
36
|
-
"@scripts/
|
37
|
-
"@scripts/
|
32
|
+
"@modern-js/generator-common": "3.1.30",
|
33
|
+
"@modern-js/generator-utils": "3.1.30",
|
34
|
+
"@modern-js/plugin-i18n": "2.28.0",
|
35
|
+
"@modern-js/dependence-generator": "3.1.30",
|
36
|
+
"@scripts/jest-config": "2.28.0",
|
37
|
+
"@scripts/build": "2.28.0"
|
38
38
|
},
|
39
39
|
"sideEffects": false,
|
40
40
|
"publishConfig": {
|