@nx/rollup 16.4.0-beta.1 → 16.4.0-beta.13
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/index.d.ts +1 -1
- package/index.js +0 -1
- package/migrations.json +6 -0
- package/package.json +5 -5
- package/src/executors/rollup/rollup.impl.js +1 -1
- package/src/executors/rollup/schema.d.ts +1 -0
- package/src/executors/rollup/schema.json +5 -0
- package/src/generators/init/init.js +0 -4
- package/src/generators/rollup-project/rollup-project.js +5 -3
- package/src/generators/rollup-project/schema.d.ts +1 -0
- package/src/generators/rollup-project/schema.json +5 -0
- package/src/migrations/update-16-3-3-add-babel-upward-root-mode-flag/update-16-3-3-add-babel-upward-root-mode-flag.d.ts +2 -0
- package/src/migrations/update-16-3-3-add-babel-upward-root-mode-flag/update-16-3-3-add-babel-upward-root-mode-flag.js +20 -0
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from './src/generators/init/init';
|
|
2
2
|
export * from './src/generators/rollup-project/rollup-project';
|
|
3
|
-
export
|
|
3
|
+
export type { AssetGlobPattern, Globals, RollupExecutorOptions, } from './src/executors/rollup/schema';
|
|
4
4
|
export * from './src/executors/rollup/rollup.impl';
|
package/index.js
CHANGED
|
@@ -3,5 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./src/generators/init/init"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./src/generators/rollup-project/rollup-project"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./src/executors/rollup/schema"), exports);
|
|
7
6
|
tslib_1.__exportStar(require("./src/executors/rollup/rollup.impl"), exports);
|
package/migrations.json
CHANGED
|
@@ -11,6 +11,12 @@
|
|
|
11
11
|
"version": "16.0.0-beta.1",
|
|
12
12
|
"description": "Replace @nrwl/rollup with @nx/rollup",
|
|
13
13
|
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages"
|
|
14
|
+
},
|
|
15
|
+
"update-16-3-3-add-babel-upward-root-mode-flag": {
|
|
16
|
+
"cli": "nx",
|
|
17
|
+
"version": "16-3-3-beta.0",
|
|
18
|
+
"description": "Add babelUpwardRootMode if not already defined",
|
|
19
|
+
"implementation": "./src/migrations/update-16-3-3-add-babel-upward-root-mode-flag/update-16-3-3-add-babel-upward-root-mode-flag"
|
|
14
20
|
}
|
|
15
21
|
},
|
|
16
22
|
"packageJsonUpdates": {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/rollup",
|
|
3
|
-
"version": "16.4.0-beta.
|
|
3
|
+
"version": "16.4.0-beta.13",
|
|
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.
|
|
33
|
-
"@nx/devkit": "16.4.0-beta.
|
|
34
|
-
"@nx/js": "16.4.0-beta.
|
|
32
|
+
"@nrwl/rollup": "16.4.0-beta.13",
|
|
33
|
+
"@nx/devkit": "16.4.0-beta.13",
|
|
34
|
+
"@nx/js": "16.4.0-beta.13",
|
|
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": "
|
|
57
|
+
"gitHead": "d81afedfcc8d07db8cdb9b0e9286de0321ee184e"
|
|
58
58
|
}
|
|
@@ -167,7 +167,7 @@ function createRollupOptions(options, dependencies, context, packageJson, source
|
|
|
167
167
|
isModern: true,
|
|
168
168
|
},
|
|
169
169
|
cwd: (0, path_1.join)(context.root, sourceRoot),
|
|
170
|
-
rootMode: 'upward',
|
|
170
|
+
rootMode: options.babelUpwardRootMode ? 'upward' : undefined,
|
|
171
171
|
babelrc: true,
|
|
172
172
|
extensions: fileExtensions,
|
|
173
173
|
babelHelpers: 'bundled',
|
|
@@ -137,6 +137,11 @@
|
|
|
137
137
|
"default": "babel",
|
|
138
138
|
"description": "Which compiler to use."
|
|
139
139
|
},
|
|
140
|
+
"babelUpwardRootMode": {
|
|
141
|
+
"type": "boolean",
|
|
142
|
+
"description": "Whether to set rootmode to upward. See https://babeljs.io/docs/en/options#rootmode",
|
|
143
|
+
"default": false
|
|
144
|
+
},
|
|
140
145
|
"javascriptEnabled": {
|
|
141
146
|
"type": "boolean",
|
|
142
147
|
"description": "Sets `javascriptEnabled` option for less loader",
|
|
@@ -5,13 +5,9 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const versions_1 = require("@nx/js/src/utils/versions");
|
|
7
7
|
const versions_2 = require("../../utils/versions");
|
|
8
|
-
const add_babel_inputs_1 = require("@nx/js/src/utils/add-babel-inputs");
|
|
9
8
|
function rollupInitGenerator(tree, schema) {
|
|
10
9
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
10
|
let task;
|
|
12
|
-
if (schema.compiler === 'babel') {
|
|
13
|
-
(0, add_babel_inputs_1.addBabelInputs)(tree);
|
|
14
|
-
}
|
|
15
11
|
if (schema.compiler === 'swc') {
|
|
16
12
|
task = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
17
13
|
'@nx/rollup': versions_2.nxVersion,
|
|
@@ -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.
|
|
24
|
-
throw new Error(`Project "${options.project}" already has a
|
|
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), {
|
|
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',
|
|
@@ -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": []
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
|
|
6
|
+
function default_1(tree) {
|
|
7
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
8
|
+
(0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nx/rollup:rollup', (options, projectName, targetName, _configurationName) => {
|
|
9
|
+
if (options.babelUpwardRootMode !== undefined) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const projectConfiguration = (0, devkit_1.readProjectConfiguration)(tree, projectName);
|
|
13
|
+
projectConfiguration.targets[targetName].options.babelUpwardRootMode =
|
|
14
|
+
true;
|
|
15
|
+
(0, devkit_1.updateProjectConfiguration)(tree, projectName, projectConfiguration);
|
|
16
|
+
});
|
|
17
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
exports.default = default_1;
|