@modern-js/app-tools 2.67.11 → 2.68.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.
@@ -48,6 +48,9 @@ function createBuilderProviderConfig(resolveConfig, appContext) {
48
48
  const config = {
49
49
  ...resolveConfig,
50
50
  plugins: [],
51
+ resolve: {
52
+ ...resolveConfig.resolve
53
+ },
51
54
  dev: {
52
55
  ...resolveConfig.dev,
53
56
  port: appContext.port
@@ -37,7 +37,7 @@ var import_loadPlugins = require("../utils/loadPlugins");
37
37
  var import_register = require("../utils/register");
38
38
  var import_routes = require("../utils/routes");
39
39
  const build = async (api, options) => {
40
- var _resolvedConfig_source;
40
+ var _resolvedConfig_resolve, _resolvedConfig_source;
41
41
  if (options === null || options === void 0 ? void 0 : options.analyze) {
42
42
  process.env.BUNDLE_ANALYZE = "true";
43
43
  }
@@ -46,15 +46,21 @@ const build = async (api, options) => {
46
46
  const hooks = api.getHooks();
47
47
  await (0, import_loadPlugins.loadServerPlugins)(api, appContext.appDirectory, appContext.metaName);
48
48
  if (appContext.moduleType && appContext.moduleType === "module") {
49
- var _resolvedConfig_source1;
49
+ var _resolvedConfig_resolve1, _resolvedConfig_source1;
50
50
  const { registerEsm } = await import("../esm/register-esm.mjs");
51
51
  await registerEsm({
52
52
  appDir: appContext.appDirectory,
53
53
  distDir: appContext.distDirectory,
54
- alias: (_resolvedConfig_source1 = resolvedConfig.source) === null || _resolvedConfig_source1 === void 0 ? void 0 : _resolvedConfig_source1.alias
54
+ alias: {
55
+ ...(_resolvedConfig_resolve1 = resolvedConfig.resolve) === null || _resolvedConfig_resolve1 === void 0 ? void 0 : _resolvedConfig_resolve1.alias,
56
+ ...(_resolvedConfig_source1 = resolvedConfig.source) === null || _resolvedConfig_source1 === void 0 ? void 0 : _resolvedConfig_source1.alias
57
+ }
55
58
  });
56
59
  }
57
- await (0, import_register.registerCompiler)(appContext.appDirectory, appContext.distDirectory, resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_source = resolvedConfig.source) === null || _resolvedConfig_source === void 0 ? void 0 : _resolvedConfig_source.alias);
60
+ await (0, import_register.registerCompiler)(appContext.appDirectory, appContext.distDirectory, {
61
+ ...resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_resolve = resolvedConfig.resolve) === null || _resolvedConfig_resolve === void 0 ? void 0 : _resolvedConfig_resolve.alias,
62
+ ...resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_source = resolvedConfig.source) === null || _resolvedConfig_source === void 0 ? void 0 : _resolvedConfig_source.alias
63
+ });
58
64
  const { apiOnly } = appContext;
59
65
  if (apiOnly) {
60
66
  const { appDirectory: appDirectory2, distDirectory: distDirectory2, serverConfigFile: serverConfigFile2 } = appContext;
@@ -42,7 +42,7 @@ var import_printInstructions = require("../utils/printInstructions");
42
42
  var import_register = require("../utils/register");
43
43
  var import_routes = require("../utils/routes");
44
44
  const dev = async (api, options, devServerOptions) => {
45
- var _normalizedConfig_source, _normalizedConfig_tools, _normalizedConfig_dev;
45
+ var _normalizedConfig_source, _normalizedConfig_resolve, _normalizedConfig_tools, _normalizedConfig_dev;
46
46
  if (options.analyze) {
47
47
  process.env.BUNDLE_ANALYZE = "true";
48
48
  }
@@ -50,15 +50,21 @@ const dev = async (api, options, devServerOptions) => {
50
50
  const appContext = api.getAppContext();
51
51
  const hooks = api.getHooks();
52
52
  if (appContext.moduleType && appContext.moduleType === "module") {
53
- var _normalizedConfig_source1;
53
+ var _normalizedConfig_resolve1, _normalizedConfig_source1;
54
54
  const { registerEsm } = await import("../esm/register-esm.mjs");
55
55
  await registerEsm({
56
56
  appDir: appContext.appDirectory,
57
57
  distDir: appContext.distDirectory,
58
- alias: (_normalizedConfig_source1 = normalizedConfig.source) === null || _normalizedConfig_source1 === void 0 ? void 0 : _normalizedConfig_source1.alias
58
+ alias: {
59
+ ...(_normalizedConfig_resolve1 = normalizedConfig.resolve) === null || _normalizedConfig_resolve1 === void 0 ? void 0 : _normalizedConfig_resolve1.alias,
60
+ ...(_normalizedConfig_source1 = normalizedConfig.source) === null || _normalizedConfig_source1 === void 0 ? void 0 : _normalizedConfig_source1.alias
61
+ }
59
62
  });
60
63
  }
61
- await (0, import_register.registerCompiler)(appContext.appDirectory, appContext.distDirectory, normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_source = normalizedConfig.source) === null || _normalizedConfig_source === void 0 ? void 0 : _normalizedConfig_source.alias);
64
+ await (0, import_register.registerCompiler)(appContext.appDirectory, appContext.distDirectory, {
65
+ ...normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_source = normalizedConfig.source) === null || _normalizedConfig_source === void 0 ? void 0 : _normalizedConfig_source.alias,
66
+ ...normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_resolve = normalizedConfig.resolve) === null || _normalizedConfig_resolve === void 0 ? void 0 : _normalizedConfig_resolve.alias
67
+ });
62
68
  const { appDirectory, distDirectory, port, apiOnly, serverConfigFile, metaName, serverRoutes } = appContext;
63
69
  await (0, import_config.buildServerConfig)({
64
70
  appDirectory,
@@ -58,6 +58,9 @@ function createDefaultConfig(appContext) {
58
58
  entriesDir: "./src",
59
59
  configDir: "./config",
60
60
  globalVars: (0, import_env.getAutoInjectEnv)(appContext),
61
+ alias: {}
62
+ };
63
+ const resolve = {
61
64
  alias: {
62
65
  [appContext.internalDirAlias]: appContext.internalDirectory,
63
66
  [appContext.internalSrcAlias]: appContext.srcDirectory,
@@ -94,6 +97,7 @@ function createDefaultConfig(appContext) {
94
97
  };
95
98
  return {
96
99
  source,
100
+ resolve,
97
101
  output,
98
102
  server,
99
103
  dev,
@@ -33,6 +33,7 @@ function transformNormalizedConfig(config) {
33
33
  const tools = (0, import_createToolsConfig.createToolsConfig)(config);
34
34
  const { bff, dev, deploy, runtime, runtimeByEntries, server, cliOptions, plugins, testing, autoLoadPlugins } = config;
35
35
  return {
36
+ resolve: {},
36
37
  source,
37
38
  html,
38
39
  output,
@@ -49,7 +49,7 @@ async function run({ cwd, initialLog, metaName = "modern-js", version, internalP
49
49
  ${import_utils.chalk.bgRed.white.bold(" ⚠️ CRITICAL NODE.JS VERSION ALERT ⚠️ ")}
50
50
 
51
51
  ${import_utils.chalk.red.bold("Node.js 16 End-of-Life Notice:")}
52
- ${import_utils.chalk.red.bold.underline("June 30, 2025")} ${import_utils.chalk.red("- Security updates and support will cease")}
52
+ ${import_utils.chalk.red("- Security updates and support have ended for Node.js 16")}
53
53
 
54
54
  ${import_utils.chalk.yellow("▸ Detected Runtime:")} ${import_utils.chalk.yellow.bold(`Node.js v${nodeVersion}`)}
55
55
  ${import_utils.chalk.green("▸ Required Minimum:")} ${import_utils.chalk.green.bold("Node.js LTS (v18.x or higher)")}
@@ -63,7 +63,7 @@ async function run({ cwd, initialLog, metaName = "modern-js", version, internalP
63
63
  ${import_utils.chalk.gray("└──")} ${import_utils.chalk.yellow("Environment Verification")}
64
64
  ${import_utils.chalk.bold("node -v && npm -v")}
65
65
 
66
- ${import_utils.chalk.hex("#AAAAAA").italic("[Security Advisory] Production environments must update before 2025-06-30")}
66
+ ${import_utils.chalk.hex("#AAAAAA").italic("[Security Advisory] Node.js 16 is no longer supported. Upgrade immediately for security and compatibility.")}
67
67
  `);
68
68
  }
69
69
  const command = process.argv[2];
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var resolve_exports = {};
16
+ module.exports = __toCommonJS(resolve_exports);
@@ -20,6 +20,7 @@ function createBuilderProviderConfig(resolveConfig, appContext) {
20
20
  }
21
21
  var config = _object_spread_props(_object_spread({}, resolveConfig), {
22
22
  plugins: [],
23
+ resolve: _object_spread({}, resolveConfig.resolve),
23
24
  dev: _object_spread_props(_object_spread({}, resolveConfig.dev), {
24
25
  port: appContext.port
25
26
  }),
@@ -1,4 +1,5 @@
1
1
  import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
2
+ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
3
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
3
4
  import { logger } from "@modern-js/utils";
4
5
  import { buildServerConfig } from "../utils/config";
@@ -7,7 +8,7 @@ import { registerCompiler } from "../utils/register";
7
8
  import { generateRoutes } from "../utils/routes";
8
9
  var build = function() {
9
10
  var _ref = _async_to_generator(function(api, options) {
10
- var _resolvedConfig_source, resolvedConfig, appContext, hooks, _resolvedConfig_source1, registerEsm, apiOnly, appDirectory, distDirectory, serverConfigFile, distDirectory1, appDirectory1, serverConfigFile1;
11
+ var _resolvedConfig_resolve, _resolvedConfig_source, resolvedConfig, appContext, hooks, _resolvedConfig_resolve1, _resolvedConfig_source1, registerEsm, apiOnly, appDirectory, distDirectory, serverConfigFile, distDirectory1, appDirectory1, serverConfigFile1;
11
12
  return _ts_generator(this, function(_state) {
12
13
  switch (_state.label) {
13
14
  case 0:
@@ -39,7 +40,7 @@ var build = function() {
39
40
  registerEsm({
40
41
  appDir: appContext.appDirectory,
41
42
  distDir: appContext.distDirectory,
42
- alias: (_resolvedConfig_source1 = resolvedConfig.source) === null || _resolvedConfig_source1 === void 0 ? void 0 : _resolvedConfig_source1.alias
43
+ alias: _object_spread({}, (_resolvedConfig_resolve1 = resolvedConfig.resolve) === null || _resolvedConfig_resolve1 === void 0 ? void 0 : _resolvedConfig_resolve1.alias, (_resolvedConfig_source1 = resolvedConfig.source) === null || _resolvedConfig_source1 === void 0 ? void 0 : _resolvedConfig_source1.alias)
43
44
  })
44
45
  ];
45
46
  case 3:
@@ -48,7 +49,7 @@ var build = function() {
48
49
  case 4:
49
50
  return [
50
51
  4,
51
- registerCompiler(appContext.appDirectory, appContext.distDirectory, resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_source = resolvedConfig.source) === null || _resolvedConfig_source === void 0 ? void 0 : _resolvedConfig_source.alias)
52
+ registerCompiler(appContext.appDirectory, appContext.distDirectory, _object_spread({}, resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_resolve = resolvedConfig.resolve) === null || _resolvedConfig_resolve === void 0 ? void 0 : _resolvedConfig_resolve.alias, resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_source = resolvedConfig.source) === null || _resolvedConfig_source === void 0 ? void 0 : _resolvedConfig_source.alias))
52
53
  ];
53
54
  case 5:
54
55
  _state.sent();
@@ -14,7 +14,7 @@ import { registerCompiler } from "../utils/register";
14
14
  import { generateRoutes } from "../utils/routes";
15
15
  var dev = function() {
16
16
  var _ref = _async_to_generator(function(api, options, devServerOptions) {
17
- var _normalizedConfig_source, _normalizedConfig_tools, _normalizedConfig_dev, normalizedConfig, appContext, hooks, _normalizedConfig_source1, registerEsm, appDirectory, distDirectory, port, apiOnly, serverConfigFile, metaName, serverRoutes, meta, serverConfigPath, pluginInstances, toolsDevServerConfig, _normalizedConfig_dev_host, _normalizedConfig_dev_https, _normalizedConfig_dev_hmr, _normalizedConfig_dev_setupMiddlewares, serverOptions, host, server, _ref2, server1, afterListen;
17
+ var _normalizedConfig_source, _normalizedConfig_resolve, _normalizedConfig_tools, _normalizedConfig_dev, normalizedConfig, appContext, hooks, _normalizedConfig_resolve1, _normalizedConfig_source1, registerEsm, appDirectory, distDirectory, port, apiOnly, serverConfigFile, metaName, serverRoutes, meta, serverConfigPath, pluginInstances, toolsDevServerConfig, _normalizedConfig_dev_host, _normalizedConfig_dev_https, _normalizedConfig_dev_hmr, _normalizedConfig_dev_setupMiddlewares, serverOptions, host, server, _ref2, server1, afterListen;
18
18
  return _ts_generator(this, function(_state) {
19
19
  switch (_state.label) {
20
20
  case 0:
@@ -40,7 +40,7 @@ var dev = function() {
40
40
  registerEsm({
41
41
  appDir: appContext.appDirectory,
42
42
  distDir: appContext.distDirectory,
43
- alias: (_normalizedConfig_source1 = normalizedConfig.source) === null || _normalizedConfig_source1 === void 0 ? void 0 : _normalizedConfig_source1.alias
43
+ alias: _object_spread({}, (_normalizedConfig_resolve1 = normalizedConfig.resolve) === null || _normalizedConfig_resolve1 === void 0 ? void 0 : _normalizedConfig_resolve1.alias, (_normalizedConfig_source1 = normalizedConfig.source) === null || _normalizedConfig_source1 === void 0 ? void 0 : _normalizedConfig_source1.alias)
44
44
  })
45
45
  ];
46
46
  case 2:
@@ -49,7 +49,7 @@ var dev = function() {
49
49
  case 3:
50
50
  return [
51
51
  4,
52
- registerCompiler(appContext.appDirectory, appContext.distDirectory, normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_source = normalizedConfig.source) === null || _normalizedConfig_source === void 0 ? void 0 : _normalizedConfig_source.alias)
52
+ registerCompiler(appContext.appDirectory, appContext.distDirectory, _object_spread({}, normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_source = normalizedConfig.source) === null || _normalizedConfig_source === void 0 ? void 0 : _normalizedConfig_source.alias, normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_resolve = normalizedConfig.resolve) === null || _normalizedConfig_resolve === void 0 ? void 0 : _normalizedConfig_resolve.alias))
53
53
  ];
54
54
  case 4:
55
55
  _state.sent();
@@ -32,7 +32,6 @@ function createDefaultConfig(appContext) {
32
32
  enableInlineRouteManifests: true,
33
33
  disableInlineRouteManifests: false
34
34
  };
35
- var _obj;
36
35
  var source = {
37
36
  entries: void 0,
38
37
  mainEntryName: MAIN_ENTRY_NAME,
@@ -42,6 +41,10 @@ function createDefaultConfig(appContext) {
42
41
  entriesDir: "./src",
43
42
  configDir: "./config",
44
43
  globalVars: getAutoInjectEnv(appContext),
44
+ alias: {}
45
+ };
46
+ var _obj;
47
+ var resolve = {
45
48
  alias: (_obj = {}, _define_property(_obj, appContext.internalDirAlias, appContext.internalDirectory), _define_property(_obj, appContext.internalSrcAlias, appContext.srcDirectory), _define_property(_obj, "@", appContext.srcDirectory), _define_property(_obj, "@shared", appContext.sharedDirectory), _obj)
46
49
  };
47
50
  var html = {
@@ -73,6 +76,7 @@ function createDefaultConfig(appContext) {
73
76
  };
74
77
  return {
75
78
  source,
79
+ resolve,
76
80
  output,
77
81
  server,
78
82
  dev,
@@ -9,6 +9,7 @@ function transformNormalizedConfig(config) {
9
9
  var tools = createToolsConfig(config);
10
10
  var bff = config.bff, dev = config.dev, deploy = config.deploy, runtime = config.runtime, runtimeByEntries = config.runtimeByEntries, server = config.server, cliOptions = config.cliOptions, plugins = config.plugins, testing = config.testing, autoLoadPlugins = config.autoLoadPlugins;
11
11
  return {
12
+ resolve: {},
12
13
  source,
13
14
  html,
14
15
  output,
@@ -23,7 +23,7 @@ function _run() {
23
23
  nodeVersion = process.versions.node;
24
24
  versionArr = nodeVersion.split(".").map(Number);
25
25
  if (versionArr[0] <= 16) {
26
- console.warn("\n ".concat(chalk.bgRed.white.bold(" ⚠️ CRITICAL NODE.JS VERSION ALERT ⚠️ "), "\n\n ").concat(chalk.red.bold("Node.js 16 End-of-Life Notice:"), "\n ").concat(chalk.red.bold.underline("June 30, 2025"), " ").concat(chalk.red("- Security updates and support will cease"), "\n\n ").concat(chalk.yellow("▸ Detected Runtime:"), " ").concat(chalk.yellow.bold("Node.js v".concat(nodeVersion)), "\n ").concat(chalk.green("▸ Required Minimum:"), " ").concat(chalk.green.bold("Node.js LTS (v18.x or higher)"), "\n ").concat(chalk.green("▸ Recommended:"), " ").concat(chalk.green.bold("Node.js LTS (v22.x or higher)"), "\n\n ").concat(chalk.cyan("Immediate Action Required:"), "\n ").concat(chalk.gray("├──"), " ").concat(chalk.yellow("Recommended Upgrade"), "\n ").concat(chalk.bold("nvm install 22 --lts && nvm use 22"), "\n ").concat(chalk.gray("├──"), " ").concat(chalk.yellow("Manual Installation"), "\n ").concat(chalk.underline("https://nodejs.org/download/release/lts-hydrogen/"), "\n ").concat(chalk.gray("└──"), " ").concat(chalk.yellow("Environment Verification"), "\n ").concat(chalk.bold("node -v && npm -v"), "\n\n ").concat(chalk.hex("#AAAAAA").italic("[Security Advisory] Production environments must update before 2025-06-30"), "\n "));
26
+ console.warn("\n ".concat(chalk.bgRed.white.bold(" ⚠️ CRITICAL NODE.JS VERSION ALERT ⚠️ "), "\n\n ").concat(chalk.red.bold("Node.js 16 End-of-Life Notice:"), "\n ").concat(chalk.red("- Security updates and support have ended for Node.js 16"), "\n\n ").concat(chalk.yellow("▸ Detected Runtime:"), " ").concat(chalk.yellow.bold("Node.js v".concat(nodeVersion)), "\n ").concat(chalk.green("▸ Required Minimum:"), " ").concat(chalk.green.bold("Node.js LTS (v18.x or higher)"), "\n ").concat(chalk.green("▸ Recommended:"), " ").concat(chalk.green.bold("Node.js LTS (v22.x or higher)"), "\n\n ").concat(chalk.cyan("Immediate Action Required:"), "\n ").concat(chalk.gray("├──"), " ").concat(chalk.yellow("Recommended Upgrade"), "\n ").concat(chalk.bold("nvm install 22 --lts && nvm use 22"), "\n ").concat(chalk.gray("├──"), " ").concat(chalk.yellow("Manual Installation"), "\n ").concat(chalk.underline("https://nodejs.org/download/release/lts-hydrogen/"), "\n ").concat(chalk.gray("└──"), " ").concat(chalk.yellow("Environment Verification"), "\n ").concat(chalk.bold("node -v && npm -v"), "\n\n ").concat(chalk.hex("#AAAAAA").italic("[Security Advisory] Node.js 16 is no longer supported. Upgrade immediately for security and compatibility."), "\n "));
27
27
  }
28
28
  command = process.argv[2];
29
29
  cliParams = minimist(process.argv.slice(2));
File without changes
@@ -25,6 +25,9 @@ function createBuilderProviderConfig(resolveConfig, appContext) {
25
25
  const config = {
26
26
  ...resolveConfig,
27
27
  plugins: [],
28
+ resolve: {
29
+ ...resolveConfig.resolve
30
+ },
28
31
  dev: {
29
32
  ...resolveConfig.dev,
30
33
  port: appContext.port
@@ -4,7 +4,7 @@ import { loadServerPlugins } from "../utils/loadPlugins";
4
4
  import { registerCompiler } from "../utils/register";
5
5
  import { generateRoutes } from "../utils/routes";
6
6
  const build = async (api, options) => {
7
- var _resolvedConfig_source;
7
+ var _resolvedConfig_resolve, _resolvedConfig_source;
8
8
  if (options === null || options === void 0 ? void 0 : options.analyze) {
9
9
  process.env.BUNDLE_ANALYZE = "true";
10
10
  }
@@ -13,15 +13,21 @@ const build = async (api, options) => {
13
13
  const hooks = api.getHooks();
14
14
  await loadServerPlugins(api, appContext.appDirectory, appContext.metaName);
15
15
  if (appContext.moduleType && appContext.moduleType === "module") {
16
- var _resolvedConfig_source1;
16
+ var _resolvedConfig_resolve1, _resolvedConfig_source1;
17
17
  const { registerEsm } = await import("../esm/register-esm.mjs");
18
18
  await registerEsm({
19
19
  appDir: appContext.appDirectory,
20
20
  distDir: appContext.distDirectory,
21
- alias: (_resolvedConfig_source1 = resolvedConfig.source) === null || _resolvedConfig_source1 === void 0 ? void 0 : _resolvedConfig_source1.alias
21
+ alias: {
22
+ ...(_resolvedConfig_resolve1 = resolvedConfig.resolve) === null || _resolvedConfig_resolve1 === void 0 ? void 0 : _resolvedConfig_resolve1.alias,
23
+ ...(_resolvedConfig_source1 = resolvedConfig.source) === null || _resolvedConfig_source1 === void 0 ? void 0 : _resolvedConfig_source1.alias
24
+ }
22
25
  });
23
26
  }
24
- await registerCompiler(appContext.appDirectory, appContext.distDirectory, resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_source = resolvedConfig.source) === null || _resolvedConfig_source === void 0 ? void 0 : _resolvedConfig_source.alias);
27
+ await registerCompiler(appContext.appDirectory, appContext.distDirectory, {
28
+ ...resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_resolve = resolvedConfig.resolve) === null || _resolvedConfig_resolve === void 0 ? void 0 : _resolvedConfig_resolve.alias,
29
+ ...resolvedConfig === null || resolvedConfig === void 0 ? void 0 : (_resolvedConfig_source = resolvedConfig.source) === null || _resolvedConfig_source === void 0 ? void 0 : _resolvedConfig_source.alias
30
+ });
25
31
  const { apiOnly } = appContext;
26
32
  if (apiOnly) {
27
33
  const { appDirectory: appDirectory2, distDirectory: distDirectory2, serverConfigFile: serverConfigFile2 } = appContext;
@@ -9,7 +9,7 @@ import { printInstructions } from "../utils/printInstructions";
9
9
  import { registerCompiler } from "../utils/register";
10
10
  import { generateRoutes } from "../utils/routes";
11
11
  const dev = async (api, options, devServerOptions) => {
12
- var _normalizedConfig_source, _normalizedConfig_tools, _normalizedConfig_dev;
12
+ var _normalizedConfig_source, _normalizedConfig_resolve, _normalizedConfig_tools, _normalizedConfig_dev;
13
13
  if (options.analyze) {
14
14
  process.env.BUNDLE_ANALYZE = "true";
15
15
  }
@@ -17,15 +17,21 @@ const dev = async (api, options, devServerOptions) => {
17
17
  const appContext = api.getAppContext();
18
18
  const hooks = api.getHooks();
19
19
  if (appContext.moduleType && appContext.moduleType === "module") {
20
- var _normalizedConfig_source1;
20
+ var _normalizedConfig_resolve1, _normalizedConfig_source1;
21
21
  const { registerEsm } = await import("../esm/register-esm.mjs");
22
22
  await registerEsm({
23
23
  appDir: appContext.appDirectory,
24
24
  distDir: appContext.distDirectory,
25
- alias: (_normalizedConfig_source1 = normalizedConfig.source) === null || _normalizedConfig_source1 === void 0 ? void 0 : _normalizedConfig_source1.alias
25
+ alias: {
26
+ ...(_normalizedConfig_resolve1 = normalizedConfig.resolve) === null || _normalizedConfig_resolve1 === void 0 ? void 0 : _normalizedConfig_resolve1.alias,
27
+ ...(_normalizedConfig_source1 = normalizedConfig.source) === null || _normalizedConfig_source1 === void 0 ? void 0 : _normalizedConfig_source1.alias
28
+ }
26
29
  });
27
30
  }
28
- await registerCompiler(appContext.appDirectory, appContext.distDirectory, normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_source = normalizedConfig.source) === null || _normalizedConfig_source === void 0 ? void 0 : _normalizedConfig_source.alias);
31
+ await registerCompiler(appContext.appDirectory, appContext.distDirectory, {
32
+ ...normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_source = normalizedConfig.source) === null || _normalizedConfig_source === void 0 ? void 0 : _normalizedConfig_source.alias,
33
+ ...normalizedConfig === null || normalizedConfig === void 0 ? void 0 : (_normalizedConfig_resolve = normalizedConfig.resolve) === null || _normalizedConfig_resolve === void 0 ? void 0 : _normalizedConfig_resolve.alias
34
+ });
29
35
  const { appDirectory, distDirectory, port, apiOnly, serverConfigFile, metaName, serverRoutes } = appContext;
30
36
  await buildServerConfig({
31
37
  appDirectory,
@@ -34,6 +34,9 @@ function createDefaultConfig(appContext) {
34
34
  entriesDir: "./src",
35
35
  configDir: "./config",
36
36
  globalVars: getAutoInjectEnv(appContext),
37
+ alias: {}
38
+ };
39
+ const resolve = {
37
40
  alias: {
38
41
  [appContext.internalDirAlias]: appContext.internalDirectory,
39
42
  [appContext.internalSrcAlias]: appContext.srcDirectory,
@@ -70,6 +73,7 @@ function createDefaultConfig(appContext) {
70
73
  };
71
74
  return {
72
75
  source,
76
+ resolve,
73
77
  output,
74
78
  server,
75
79
  dev,
@@ -9,6 +9,7 @@ function transformNormalizedConfig(config) {
9
9
  const tools = createToolsConfig(config);
10
10
  const { bff, dev, deploy, runtime, runtimeByEntries, server, cliOptions, plugins, testing, autoLoadPlugins } = config;
11
11
  return {
12
+ resolve: {},
12
13
  source,
13
14
  html,
14
15
  output,
@@ -16,7 +16,7 @@ async function run({ cwd, initialLog, metaName = "modern-js", version, internalP
16
16
  ${chalk.bgRed.white.bold(" ⚠️ CRITICAL NODE.JS VERSION ALERT ⚠️ ")}
17
17
 
18
18
  ${chalk.red.bold("Node.js 16 End-of-Life Notice:")}
19
- ${chalk.red.bold.underline("June 30, 2025")} ${chalk.red("- Security updates and support will cease")}
19
+ ${chalk.red("- Security updates and support have ended for Node.js 16")}
20
20
 
21
21
  ${chalk.yellow("▸ Detected Runtime:")} ${chalk.yellow.bold(`Node.js v${nodeVersion}`)}
22
22
  ${chalk.green("▸ Required Minimum:")} ${chalk.green.bold("Node.js LTS (v18.x or higher)")}
@@ -30,7 +30,7 @@ async function run({ cwd, initialLog, metaName = "modern-js", version, internalP
30
30
  ${chalk.gray("└──")} ${chalk.yellow("Environment Verification")}
31
31
  ${chalk.bold("node -v && npm -v")}
32
32
 
33
- ${chalk.hex("#AAAAAA").italic("[Security Advisory] Production environments must update before 2025-06-30")}
33
+ ${chalk.hex("#AAAAAA").italic("[Security Advisory] Node.js 16 is no longer supported. Upgrade immediately for security and compatibility.")}
34
34
  `);
35
35
  }
36
36
  const command = process.argv[2];
File without changes
@@ -8,6 +8,7 @@ import type { ExperimentsUserConfig } from './experiments';
8
8
  import type { HtmlUserConfig } from './html';
9
9
  import type { OutputUserConfig } from './output';
10
10
  import type { PerformanceUserConfig } from './performance';
11
+ import type { ResolveUserConfig } from './resolve';
11
12
  import type { SecurityUserConfig } from './security';
12
13
  import type { SourceUserConfig } from './source';
13
14
  import type { TestingUserConfig } from './testing';
@@ -20,6 +21,7 @@ export interface RuntimeByEntriesUserConfig {
20
21
  [name: string]: RuntimeUserConfig;
21
22
  }
22
23
  export interface AppToolsUserConfig<B extends Bundler> {
24
+ resolve?: ResolveUserConfig;
23
25
  server?: ServerUserConfig;
24
26
  source?: SourceUserConfig;
25
27
  output?: OutputUserConfig;
@@ -0,0 +1,2 @@
1
+ import type { UniBuilderConfig } from '@modern-js/uni-builder';
2
+ export type ResolveUserConfig = UniBuilderConfig['resolve'];
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.67.11",
18
+ "version": "2.68.0",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -85,31 +85,31 @@
85
85
  "@babel/parser": "^7.22.15",
86
86
  "@babel/traverse": "^7.23.2",
87
87
  "@babel/types": "^7.26.0",
88
- "@rsbuild/core": "1.3.22",
88
+ "@rsbuild/core": "1.4.3",
89
89
  "@rsbuild/plugin-node-polyfill": "1.3.0",
90
90
  "@swc/helpers": "^0.5.17",
91
91
  "es-module-lexer": "^1.1.0",
92
- "esbuild": "0.17.19",
92
+ "esbuild": "0.25.5",
93
93
  "esbuild-register": "^3.6.0",
94
94
  "flatted": "^3.3.3",
95
- "mlly": "^1.6.1",
96
- "ndepe": "^0.1.11",
95
+ "mlly": "^1.7.4",
96
+ "ndepe": "^0.1.12",
97
97
  "pkg-types": "^1.1.0",
98
98
  "std-env": "^3.7.0",
99
- "@modern-js/core": "2.67.11",
100
- "@modern-js/node-bundle-require": "2.67.11",
101
- "@modern-js/plugin": "2.67.11",
102
- "@modern-js/plugin-data-loader": "2.67.11",
103
- "@modern-js/plugin-i18n": "2.67.11",
104
- "@modern-js/plugin-v2": "2.67.11",
105
- "@modern-js/prod-server": "2.67.11",
106
- "@modern-js/rsbuild-plugin-esbuild": "2.67.11",
107
- "@modern-js/server": "2.67.11",
108
- "@modern-js/server-core": "2.67.11",
109
- "@modern-js/server-utils": "2.67.11",
110
- "@modern-js/types": "2.67.11",
111
- "@modern-js/uni-builder": "2.67.11",
112
- "@modern-js/utils": "2.67.11"
99
+ "@modern-js/core": "2.68.0",
100
+ "@modern-js/plugin": "2.68.0",
101
+ "@modern-js/node-bundle-require": "2.68.0",
102
+ "@modern-js/plugin-data-loader": "2.68.0",
103
+ "@modern-js/plugin-i18n": "2.68.0",
104
+ "@modern-js/plugin-v2": "2.68.0",
105
+ "@modern-js/prod-server": "2.68.0",
106
+ "@modern-js/rsbuild-plugin-esbuild": "2.68.0",
107
+ "@modern-js/server": "2.68.0",
108
+ "@modern-js/server-core": "2.68.0",
109
+ "@modern-js/server-utils": "2.68.0",
110
+ "@modern-js/types": "2.68.0",
111
+ "@modern-js/uni-builder": "2.68.0",
112
+ "@modern-js/utils": "2.68.0"
113
113
  },
114
114
  "devDependencies": {
115
115
  "@rsbuild/plugin-webpack-swc": "1.1.1",