@nx/rollup 21.2.0-canary.20250611-ec0eda5 → 21.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/rollup",
3
- "version": "21.2.0-canary.20250611-ec0eda5",
3
+ "version": "21.2.0",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Rollup contains executors and generators that support building applications using Rollup.",
6
6
  "repository": {
@@ -29,8 +29,8 @@
29
29
  "migrations": "./migrations.json"
30
30
  },
31
31
  "dependencies": {
32
- "@nx/devkit": "21.2.0-canary.20250611-ec0eda5",
33
- "@nx/js": "21.2.0-canary.20250611-ec0eda5",
32
+ "@nx/devkit": "21.2.0",
33
+ "@nx/js": "21.2.0",
34
34
  "@rollup/plugin-babel": "^6.0.4",
35
35
  "@rollup/plugin-commonjs": "^25.0.7",
36
36
  "@rollup/plugin-image": "^3.0.3",
@@ -6,6 +6,7 @@ const fileutils_1 = require("nx/src/utils/fileutils");
6
6
  const fs_1 = require("fs");
7
7
  const devkit_1 = require("@nx/devkit");
8
8
  function updatePackageJson(options, packageJson) {
9
+ const jsFileRegex = /(\.cjs|\.mjs|\.esm\.js|\.cjs\.js|\.mjs\.js|\.js)$/;
9
10
  const hasEsmFormat = options.format.includes('esm');
10
11
  const hasCjsFormat = options.format.includes('cjs');
11
12
  if (options.generateExportsField) {
@@ -32,7 +33,7 @@ function updatePackageJson(options, packageJson) {
32
33
  // Reserve `module` entry for bundlers to accommodate tree-shaking.
33
34
  {
34
35
  [hasCjsFormat ? 'module' : 'import']: filePath,
35
- types: filePath.replace(/\.js$/, '.d.ts'),
36
+ types: filePath.replace(jsFileRegex, '.d.ts'),
36
37
  };
37
38
  }
38
39
  }
@@ -77,10 +78,10 @@ function updatePackageJson(options, packageJson) {
77
78
  }
78
79
  }
79
80
  if (packageJson.module) {
80
- packageJson.types ??= packageJson.module.replace(/\.js$/, '.d.ts');
81
+ packageJson.types ??= packageJson.module.replace(jsFileRegex, '.d.ts');
81
82
  }
82
83
  else {
83
- packageJson.types ??= packageJson.main.replace(/\.js$/, '.d.ts');
84
+ packageJson.types ??= packageJson.main.replace(jsFileRegex, '.d.ts');
84
85
  }
85
86
  (0, fileutils_1.writeJsonFile)((0, path_1.join)(devkit_1.workspaceRoot, options.outputPath, 'package.json'), packageJson);
86
87
  }