@nx/rollup 19.5.0-beta.3 → 19.5.0-beta.4
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.5.0-beta.
|
|
3
|
+
"version": "19.5.0-beta.4",
|
|
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.2",
|
|
45
45
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
46
46
|
"tslib": "^2.3.0",
|
|
47
|
-
"@nx/devkit": "19.5.0-beta.
|
|
48
|
-
"@nx/js": "19.5.0-beta.
|
|
49
|
-
"@nrwl/rollup": "19.5.0-beta.
|
|
47
|
+
"@nx/devkit": "19.5.0-beta.4",
|
|
48
|
+
"@nx/js": "19.5.0-beta.4",
|
|
49
|
+
"@nrwl/rollup": "19.5.0-beta.4"
|
|
50
50
|
},
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|
|
@@ -9,6 +9,7 @@ const normalize_1 = require("./lib/normalize");
|
|
|
9
9
|
const config_utils_1 = require("@nx/devkit/src/utils/config-utils");
|
|
10
10
|
const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
|
11
11
|
const with_nx_1 = require("../../plugins/with-nx/with-nx");
|
|
12
|
+
const generate_package_json_1 = require("../../plugins/package-json/generate-package-json");
|
|
12
13
|
const buildable_libs_utils_1 = require("@nx/js/src/utils/buildable-libs-utils");
|
|
13
14
|
async function* rollupExecutor(rawOptions, context) {
|
|
14
15
|
process.env.NODE_ENV ??= 'production';
|
|
@@ -79,6 +80,11 @@ async function* rollupExecutor(rawOptions, context) {
|
|
|
79
80
|
async function createRollupOptions(options, context) {
|
|
80
81
|
const { dependencies } = (0, buildable_libs_utils_1.calculateProjectBuildableDependencies)(context.taskGraph, context.projectGraph, context.root, context.projectName, context.targetName, context.configurationName, true);
|
|
81
82
|
const rollupConfig = (0, with_nx_1.withNx)(options, {}, dependencies);
|
|
83
|
+
// `generatePackageJson` is a plugin rather than being embedded into @nx/rollup:rollup.
|
|
84
|
+
// Make sure the plugin is always present to keep the previous before of Nx < 19.4, where it was not a plugin.
|
|
85
|
+
const generatePackageJsonPlugin = Array.isArray(rollupConfig.plugins)
|
|
86
|
+
? rollupConfig.plugins.find((p) => p['name'] === generate_package_json_1.pluginName)
|
|
87
|
+
: null;
|
|
82
88
|
const userDefinedRollupConfigs = options.rollupConfig.map((plugin) => (0, config_utils_1.loadConfigFile)(plugin));
|
|
83
89
|
let finalConfig = rollupConfig;
|
|
84
90
|
for (const _config of userDefinedRollupConfigs) {
|
|
@@ -100,6 +106,11 @@ async function createRollupOptions(options, context) {
|
|
|
100
106
|
};
|
|
101
107
|
}
|
|
102
108
|
}
|
|
109
|
+
if (generatePackageJsonPlugin &&
|
|
110
|
+
Array.isArray(finalConfig.plugins) &&
|
|
111
|
+
!finalConfig.plugins.some((p) => p['name'] === generate_package_json_1.pluginName)) {
|
|
112
|
+
finalConfig.plugins.push(generatePackageJsonPlugin);
|
|
113
|
+
}
|
|
103
114
|
return finalConfig;
|
|
104
115
|
}
|
|
105
116
|
function resolveOutfile(context, options) {
|
|
@@ -9,4 +9,5 @@ export interface GeneratePackageJsonOptions {
|
|
|
9
9
|
outputFileName?: string;
|
|
10
10
|
additionalEntryPoints?: string[];
|
|
11
11
|
}
|
|
12
|
+
export declare const pluginName = "rollup-plugin-nx-generate-package-json";
|
|
12
13
|
export declare function generatePackageJson(options: GeneratePackageJsonOptions, packageJson: PackageJson): Plugin;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pluginName = void 0;
|
|
3
4
|
exports.generatePackageJson = generatePackageJson;
|
|
4
5
|
const update_package_json_1 = require("./update-package-json");
|
|
6
|
+
exports.pluginName = 'rollup-plugin-nx-generate-package-json';
|
|
5
7
|
function generatePackageJson(options, packageJson) {
|
|
6
8
|
return {
|
|
7
|
-
name:
|
|
9
|
+
name: exports.pluginName,
|
|
8
10
|
writeBundle: () => {
|
|
9
11
|
(0, update_package_json_1.updatePackageJson)(options, packageJson);
|
|
10
12
|
},
|