@nx/rollup 16.4.0-beta.5 → 16.4.0-beta.7

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": "16.4.0-beta.5",
3
+ "version": "16.4.0-beta.7",
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,9 +29,9 @@
29
29
  "migrations": "./migrations.json"
30
30
  },
31
31
  "dependencies": {
32
- "@nrwl/rollup": "16.4.0-beta.5",
33
- "@nx/devkit": "16.4.0-beta.5",
34
- "@nx/js": "16.4.0-beta.5",
32
+ "@nrwl/rollup": "16.4.0-beta.7",
33
+ "@nx/devkit": "16.4.0-beta.7",
34
+ "@nx/js": "16.4.0-beta.7",
35
35
  "@rollup/plugin-babel": "^5.3.0",
36
36
  "@rollup/plugin-commonjs": "^20.0.0",
37
37
  "@rollup/plugin-image": "^2.1.0",
@@ -54,5 +54,5 @@
54
54
  "access": "public"
55
55
  },
56
56
  "types": "./index.d.ts",
57
- "gitHead": "94aa566dda725adbc54b4ba31b558377f273e41b"
57
+ "gitHead": "847d3a45b61cd2c267acb66c4165a5bb875aff4f"
58
58
  }
@@ -6,8 +6,10 @@ const devkit_1 = require("@nx/devkit");
6
6
  const get_import_path_1 = require("@nx/js/src/utils/get-import-path");
7
7
  const init_1 = require("../init/init");
8
8
  function rollupProjectGenerator(tree, options) {
9
+ var _a;
9
10
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
10
11
  const task = yield (0, init_1.rollupInitGenerator)(tree, Object.assign(Object.assign({}, options), { skipFormat: true }));
12
+ (_a = options.buildTarget) !== null && _a !== void 0 ? _a : (options.buildTarget = 'build');
11
13
  checkForTargetConflicts(tree, options);
12
14
  addBuildTarget(tree, options);
13
15
  yield (0, devkit_1.formatFiles)(tree);
@@ -20,8 +22,8 @@ function checkForTargetConflicts(tree, options) {
20
22
  if (options.skipValidation)
21
23
  return;
22
24
  const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
23
- if ((_a = project.targets) === null || _a === void 0 ? void 0 : _a.build) {
24
- throw new Error(`Project "${options.project}" already has a build target. Pass --skipValidation to ignore this error.`);
25
+ if ((_a = project.targets) === null || _a === void 0 ? void 0 : _a[options.buildTarget]) {
26
+ throw new Error(`Project "${options.project}" already has a ${options.buildTarget} target. Pass --skipValidation to ignore this error.`);
25
27
  }
26
28
  }
27
29
  function addBuildTarget(tree, options) {
@@ -56,7 +58,7 @@ function addBuildTarget(tree, options) {
56
58
  },
57
59
  ];
58
60
  }
59
- (0, devkit_1.updateProjectConfiguration)(tree, options.project, Object.assign(Object.assign({}, project), { targets: Object.assign(Object.assign({}, project.targets), { build: {
61
+ (0, devkit_1.updateProjectConfiguration)(tree, options.project, Object.assign(Object.assign({}, project), { targets: Object.assign(Object.assign({}, project.targets), { [options.buildTarget]: {
60
62
  executor: '@nx/rollup:rollup',
61
63
  outputs: ['{options.outputPath}'],
62
64
  defaultConfiguration: 'production',
@@ -9,4 +9,5 @@ export interface RollupProjectSchema {
9
9
  importPath?: string;
10
10
  external?: string[];
11
11
  rollupConfig?: string;
12
+ buildTarget?: string;
12
13
  }
@@ -66,6 +66,11 @@
66
66
  "rollupConfig": {
67
67
  "type": "string",
68
68
  "description": "Path relative to workspace root to a custom rollup file that takes a config object and returns an updated config."
69
+ },
70
+ "buildTarget": {
71
+ "description": "The build target to add.",
72
+ "type": "string",
73
+ "default": "build"
69
74
  }
70
75
  },
71
76
  "required": []