@igniter-js/cli 0.2.70 → 0.2.72

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 CHANGED
@@ -17141,8 +17141,19 @@ async function loadRouter(routerPath) {
17141
17141
  format: "cjs",
17142
17142
  write: false,
17143
17143
  // Keep the result in memory
17144
- logLevel: "silent"
17144
+ logLevel: "silent",
17145
17145
  // We will handle our own logging
17146
+ external: [
17147
+ "@igniter-js/*",
17148
+ "@prisma/*",
17149
+ "prisma",
17150
+ "redis",
17151
+ "ioredis",
17152
+ "bullmq",
17153
+ "@opentelemetry/*",
17154
+ "chalk",
17155
+ "supports-color"
17156
+ ]
17146
17157
  });
17147
17158
  const [outputFile] = result.outputFiles;
17148
17159
  if (!outputFile) {
@@ -17150,7 +17161,14 @@ async function loadRouter(routerPath) {
17150
17161
  }
17151
17162
  const compiledCode = outputFile.text;
17152
17163
  const routerModule = { exports: {} };
17153
- const requireFunc = (moduleName) => require(moduleName);
17164
+ const projectRequire = (0, import_module.createRequire)(fullPath);
17165
+ const requireFunc = (moduleName) => {
17166
+ try {
17167
+ return projectRequire(moduleName);
17168
+ } catch (error) {
17169
+ return require(moduleName);
17170
+ }
17171
+ };
17154
17172
  const factory = new Function("exports", "require", "module", "__filename", "__dirname", compiledCode);
17155
17173
  factory(routerModule.exports, requireFunc, routerModule, fullPath, path7.dirname(fullPath));
17156
17174
  const moduleExports = routerModule.exports;
@@ -17171,7 +17189,7 @@ ${errorMessages}`;
17171
17189
  throw new RouterLoadError(`Failed to load router from ${routerPath}`, error);
17172
17190
  }
17173
17191
  }
17174
- var path7, import_esbuild, RouterLoadError;
17192
+ var path7, import_esbuild, import_module, RouterLoadError;
17175
17193
  var init_introspector = __esm({
17176
17194
  "src/adapters/build/introspector.ts"() {
17177
17195
  "use strict";
@@ -17179,6 +17197,7 @@ var init_introspector = __esm({
17179
17197
  import_esbuild = require("esbuild");
17180
17198
  init_logger();
17181
17199
  init_esm();
17200
+ import_module = require("module");
17182
17201
  RouterLoadError = class extends Error {
17183
17202
  constructor(message, originalError) {
17184
17203
  super(message);