@nx/rollup 18.3.0-beta.1 → 18.3.0-beta.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/rollup",
3
- "version": "18.3.0-beta.1",
3
+ "version": "18.3.0-beta.2",
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": {
@@ -44,9 +44,9 @@
44
44
  "rollup-plugin-postcss": "^4.0.1",
45
45
  "rollup-plugin-typescript2": "0.36.0",
46
46
  "tslib": "^2.3.0",
47
- "@nx/devkit": "18.3.0-beta.1",
48
- "@nx/js": "18.3.0-beta.1",
49
- "@nrwl/rollup": "18.3.0-beta.1"
47
+ "@nx/devkit": "18.3.0-beta.2",
48
+ "@nx/js": "18.3.0-beta.2",
49
+ "@nrwl/rollup": "18.3.0-beta.2"
50
50
  },
51
51
  "publishConfig": {
52
52
  "access": "public"
@@ -42,7 +42,7 @@ function updatePackageJson(options, packageJson) {
42
42
  fileExt: '.cjs.js',
43
43
  });
44
44
  packageJson.main = cjsExports['.'];
45
- if (!hasEsmFormat) {
45
+ if (!hasEsmFormat && !options.skipTypeField) {
46
46
  packageJson.type = 'commonjs';
47
47
  }
48
48
  if (options.generateExportsField) {
@@ -3,26 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.rollupInitGenerator = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const versions_1 = require("../../utils/versions");
6
- const update_package_scripts_1 = require("@nx/devkit/src/utils/update-package-scripts");
6
+ const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
7
7
  const plugin_1 = require("../../plugins/plugin");
8
- function addPlugin(tree) {
9
- const nxJson = (0, devkit_1.readNxJson)(tree);
10
- nxJson.plugins ??= [];
11
- for (const plugin of nxJson.plugins) {
12
- if (typeof plugin === 'string'
13
- ? plugin === '@nx/rollup/plugin'
14
- : plugin.plugin === '@nx/rollup/plugin') {
15
- return;
16
- }
17
- }
18
- nxJson.plugins.push({
19
- plugin: '@nx/rollup/plugin',
20
- options: {
21
- buildTargetName: 'build',
22
- },
23
- });
24
- (0, devkit_1.updateNxJson)(tree, nxJson);
25
- }
26
8
  async function rollupInitGenerator(tree, schema) {
27
9
  let task = () => { };
28
10
  if (!schema.skipPackageJson) {
@@ -30,10 +12,9 @@ async function rollupInitGenerator(tree, schema) {
30
12
  }
31
13
  schema.addPlugin ??= process.env.NX_ADD_PLUGINS !== 'false';
32
14
  if (schema.addPlugin) {
33
- addPlugin(tree);
34
- }
35
- if (schema.updatePackageScripts) {
36
- await (0, update_package_scripts_1.updatePackageScripts)(tree, plugin_1.createNodes);
15
+ await (0, add_plugin_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/rollup/plugin', plugin_1.createNodes, {
16
+ buildTargetName: ['build', 'rollup:build', 'rollup-build'],
17
+ }, schema.updatePackageScripts);
37
18
  }
38
19
  if (!schema.skipFormat) {
39
20
  await (0, devkit_1.formatFiles)(tree);