@nx/rollup 19.0.6 → 19.0.8

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": "19.0.6",
3
+ "version": "19.0.8",
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": {
@@ -43,9 +43,9 @@
43
43
  "rollup-plugin-postcss": "^4.0.2",
44
44
  "rollup-plugin-typescript2": "^0.36.0",
45
45
  "tslib": "^2.3.0",
46
- "@nx/devkit": "19.0.6",
47
- "@nx/js": "19.0.6",
48
- "@nrwl/rollup": "19.0.6"
46
+ "@nx/devkit": "19.0.8",
47
+ "@nx/js": "19.0.8",
48
+ "@nrwl/rollup": "19.0.8"
49
49
  },
50
50
  "publishConfig": {
51
51
  "access": "public"
@@ -12,16 +12,19 @@ const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
12
12
  // @ts-ignore
13
13
  const loadConfigFile_1 = require("rollup/loadConfigFile");
14
14
  const cachePath = (0, path_1.join)(cache_directory_1.projectGraphCacheDirectory, 'rollup.hash');
15
- const targetsCache = (0, fs_1.existsSync)(cachePath) ? readTargetsCache() : {};
16
- const calculatedTargets = {};
15
+ const targetsCache = readTargetsCache();
17
16
  function readTargetsCache() {
18
- return (0, devkit_1.readJsonFile)(cachePath);
17
+ return (0, fs_1.existsSync)(cachePath) ? (0, devkit_1.readJsonFile)(cachePath) : {};
19
18
  }
20
- function writeTargetsToCache(targets) {
21
- (0, devkit_1.writeJsonFile)(cachePath, targets);
19
+ function writeTargetsToCache() {
20
+ const oldCache = readTargetsCache();
21
+ (0, devkit_1.writeJsonFile)(cachePath, {
22
+ ...oldCache,
23
+ ...targetsCache,
24
+ });
22
25
  }
23
26
  const createDependencies = () => {
24
- writeTargetsToCache(calculatedTargets);
27
+ writeTargetsToCache();
25
28
  return [];
26
29
  };
27
30
  exports.createDependencies = createDependencies;
@@ -40,15 +43,12 @@ exports.createNodes = [
40
43
  const hash = (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, options, context, [
41
44
  (0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot)),
42
45
  ]);
43
- const targets = targetsCache[hash]
44
- ? targetsCache[hash]
45
- : await buildRollupTarget(configFilePath, projectRoot, options, context);
46
- calculatedTargets[hash] = targets;
46
+ targetsCache[hash] ??= await buildRollupTarget(configFilePath, projectRoot, options, context);
47
47
  return {
48
48
  projects: {
49
49
  [projectRoot]: {
50
50
  root: projectRoot,
51
- targets,
51
+ targets: targetsCache[hash],
52
52
  },
53
53
  },
54
54
  };