@nx/devkit 18.3.0 → 18.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/devkit",
3
- "version": "18.3.0",
3
+ "version": "18.3.2",
4
4
  "private": false,
5
5
  "description": "The Nx Devkit is used to customize Nx for different technologies and use cases. It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more. Learn more about [extending Nx by leveraging the Nx Devkit](https://nx.dev/extending-nx/intro/getting-started) on our docs.",
6
6
  "repository": {
@@ -35,7 +35,7 @@
35
35
  "tslib": "^2.3.0",
36
36
  "semver": "^7.5.3",
37
37
  "yargs-parser": "21.1.1",
38
- "@nrwl/devkit": "18.3.0"
38
+ "@nrwl/devkit": "18.3.2"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "nx": ">= 16 <= 19"
@@ -4,6 +4,7 @@ exports.getRootTsConfigFileName = exports.getRootTsConfigPath = exports.loadConf
4
4
  const path_1 = require("path");
5
5
  const fs_1 = require("fs");
6
6
  const nx_1 = require("../../nx");
7
+ const node_url_1 = require("node:url");
7
8
  const { workspaceRoot, registerTsProject } = (0, nx_1.requireNx)();
8
9
  exports.dynamicImport = new Function('modulePath', 'return import(modulePath);');
9
10
  async function loadConfigFile(configFilePath) {
@@ -66,8 +67,9 @@ async function load(path) {
66
67
  }
67
68
  catch (e) {
68
69
  if (e.code === 'ERR_REQUIRE_ESM') {
69
- // If `require` fails to load ESM, try dynamic `import()`.
70
- return await (0, exports.dynamicImport)(`${path}?t=${Date.now()}`);
70
+ // If `require` fails to load ESM, try dynamic `import()`. ESM requires file url protocol for handling absolute paths.
71
+ const pathAsFileUrl = (0, node_url_1.pathToFileURL)(path).pathname;
72
+ return await (0, exports.dynamicImport)(`${pathAsFileUrl}?t=${Date.now()}`);
71
73
  }
72
74
  // Re-throw all other errors
73
75
  throw e;