@nx/rollup 18.1.2 → 18.2.0-beta.0
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 +4 -5
- package/src/executors/rollup/rollup.impl.d.ts +8 -6
- package/src/executors/rollup/rollup.impl.js +145 -160
- package/src/utils/ensure-dependencies.js +14 -7
- package/src/utils/versions.d.ts +1 -0
- package/src/utils/versions.js +2 -1
- package/src/executors/rollup/lib/run-rollup.d.ts +0 -4
- package/src/executors/rollup/lib/run-rollup.js +0 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/rollup",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.2.0-beta.0",
|
|
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,11 +43,10 @@
|
|
|
43
43
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
44
44
|
"rollup-plugin-postcss": "^4.0.1",
|
|
45
45
|
"rollup-plugin-typescript2": "0.36.0",
|
|
46
|
-
"rxjs": "^7.8.0",
|
|
47
46
|
"tslib": "^2.3.0",
|
|
48
|
-
"@nx/devkit": "18.
|
|
49
|
-
"@nx/js": "18.
|
|
50
|
-
"@nrwl/rollup": "18.
|
|
47
|
+
"@nx/devkit": "18.2.0-beta.0",
|
|
48
|
+
"@nx/js": "18.2.0-beta.0",
|
|
49
|
+
"@nrwl/rollup": "18.2.0-beta.0"
|
|
51
50
|
},
|
|
52
51
|
"publishConfig": {
|
|
53
52
|
"access": "public"
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import * as rollup from 'rollup';
|
|
2
|
-
import type
|
|
2
|
+
import { type ExecutorContext } from '@nx/devkit';
|
|
3
3
|
import { DependentBuildableProjectNode } from '@nx/js/src/utils/buildable-libs-utils';
|
|
4
4
|
import type { PackageJson } from 'nx/src/utils/package-json';
|
|
5
5
|
import { RollupExecutorOptions } from './schema';
|
|
6
6
|
import { NormalizedRollupExecutorOptions } from './lib/normalize';
|
|
7
|
-
export
|
|
7
|
+
export declare function rollupExecutor(rawOptions: RollupExecutorOptions, context: ExecutorContext): AsyncGenerator<never, AsyncIterable<unknown> | {
|
|
8
8
|
success: boolean;
|
|
9
|
-
outfile
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
outfile: string;
|
|
10
|
+
} | {
|
|
11
|
+
success: boolean;
|
|
12
|
+
outfile?: undefined;
|
|
13
|
+
}, unknown>;
|
|
14
|
+
export declare function createRollupOptions(options: NormalizedRollupExecutorOptions, dependencies: DependentBuildableProjectNode[], context: ExecutorContext, packageJson: PackageJson, sourceRoot: string, npmDeps: string[]): Promise<rollup.RollupOptions>;
|
|
13
15
|
export default rollupExecutor;
|
|
@@ -6,21 +6,18 @@ const rollup = require("rollup");
|
|
|
6
6
|
const peerDepsExternal = require("rollup-plugin-peer-deps-external");
|
|
7
7
|
const plugin_babel_1 = require("@rollup/plugin-babel");
|
|
8
8
|
const path_1 = require("path");
|
|
9
|
-
const rxjs_1 = require("rxjs");
|
|
10
|
-
const operators_1 = require("rxjs/operators");
|
|
11
|
-
const rxjs_for_await_1 = require("@nx/devkit/src/utils/rxjs-for-await");
|
|
12
9
|
const autoprefixer = require("autoprefixer");
|
|
13
10
|
const devkit_1 = require("@nx/devkit");
|
|
14
11
|
const buildable_libs_utils_1 = require("@nx/js/src/utils/buildable-libs-utils");
|
|
15
12
|
const plugin_node_resolve_1 = require("@rollup/plugin-node-resolve");
|
|
16
13
|
const type_definitions_1 = require("@nx/js/src/plugins/rollup/type-definitions");
|
|
17
|
-
const run_rollup_1 = require("./lib/run-rollup");
|
|
18
14
|
const normalize_1 = require("./lib/normalize");
|
|
19
15
|
const analyze_plugin_1 = require("./lib/analyze-plugin");
|
|
20
16
|
const fs_1 = require("../../utils/fs");
|
|
21
17
|
const swc_plugin_1 = require("./lib/swc-plugin");
|
|
22
18
|
const update_package_json_1 = require("./lib/update-package-json");
|
|
23
19
|
const config_utils_1 = require("@nx/devkit/src/utils/config-utils");
|
|
20
|
+
const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
|
24
21
|
// These use require because the ES import isn't correct.
|
|
25
22
|
const commonjs = require('@rollup/plugin-commonjs');
|
|
26
23
|
const image = require('@rollup/plugin-image');
|
|
@@ -32,7 +29,7 @@ async function* rollupExecutor(rawOptions, context) {
|
|
|
32
29
|
process.env.NODE_ENV ??= 'production';
|
|
33
30
|
const project = context.projectsConfigurations.projects[context.projectName];
|
|
34
31
|
const sourceRoot = project.sourceRoot;
|
|
35
|
-
const {
|
|
32
|
+
const { dependencies } = (0, buildable_libs_utils_1.calculateProjectBuildableDependencies)(context.taskGraph, context.projectGraph, context.root, context.projectName, context.targetName, context.configurationName, true);
|
|
36
33
|
const options = (0, normalize_1.normalizeRollupExecutorOptions)(rawOptions, context, sourceRoot);
|
|
37
34
|
const packageJson = (0, devkit_1.readJsonFile)(options.project);
|
|
38
35
|
const npmDeps = (context.projectGraph.dependencies[context.projectName] ?? [])
|
|
@@ -41,8 +38,9 @@ async function* rollupExecutor(rawOptions, context) {
|
|
|
41
38
|
const rollupOptions = await createRollupOptions(options, dependencies, context, packageJson, sourceRoot, npmDeps);
|
|
42
39
|
const outfile = resolveOutfile(context, options);
|
|
43
40
|
if (options.watch) {
|
|
44
|
-
|
|
45
|
-
return
|
|
41
|
+
// region Watch build
|
|
42
|
+
return (0, async_iterable_1.createAsyncIterable)(({ next }) => {
|
|
43
|
+
const watcher = rollup.watch(rollupOptions);
|
|
46
44
|
watcher.on('event', (data) => {
|
|
47
45
|
if (data.code === 'START') {
|
|
48
46
|
devkit_1.logger.info(`Bundling ${context.projectName}...`);
|
|
@@ -50,46 +48,49 @@ async function* rollupExecutor(rawOptions, context) {
|
|
|
50
48
|
else if (data.code === 'END') {
|
|
51
49
|
(0, update_package_json_1.updatePackageJson)(options, packageJson);
|
|
52
50
|
devkit_1.logger.info('Bundle complete. Watching for file changes...');
|
|
53
|
-
|
|
51
|
+
next({ success: true, outfile });
|
|
54
52
|
}
|
|
55
53
|
else if (data.code === 'ERROR') {
|
|
56
54
|
devkit_1.logger.error(`Error during bundle: ${data.error.message}`);
|
|
57
|
-
|
|
55
|
+
next({ success: false });
|
|
58
56
|
}
|
|
59
57
|
});
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
const processExitListener = (signal) => () => {
|
|
59
|
+
watcher.close();
|
|
60
|
+
};
|
|
61
|
+
process.once('SIGTERM', processExitListener);
|
|
62
|
+
process.once('SIGINT', processExitListener);
|
|
63
|
+
process.once('SIGQUIT', processExitListener);
|
|
64
|
+
});
|
|
65
|
+
// endregion
|
|
63
66
|
}
|
|
64
67
|
else {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
// region Single build
|
|
69
|
+
try {
|
|
70
|
+
devkit_1.logger.info(`Bundling ${context.projectName}...`);
|
|
71
|
+
// Delete output path before bundling
|
|
72
|
+
if (options.deleteOutputPath) {
|
|
73
|
+
(0, fs_1.deleteOutputDir)(context.root, options.outputPath);
|
|
74
|
+
}
|
|
75
|
+
const start = process.hrtime.bigint();
|
|
76
|
+
const bundle = await rollup.rollup(rollupOptions);
|
|
77
|
+
const output = Array.isArray(rollupOptions.output)
|
|
78
|
+
? rollupOptions.output
|
|
79
|
+
: [rollupOptions.output];
|
|
80
|
+
for (const o of output) {
|
|
81
|
+
await bundle.write(o);
|
|
82
|
+
}
|
|
83
|
+
const end = process.hrtime.bigint();
|
|
84
|
+
const duration = `${(Number(end - start) / 1_000_000_000).toFixed(2)}s`;
|
|
85
|
+
(0, update_package_json_1.updatePackageJson)(options, packageJson);
|
|
86
|
+
devkit_1.logger.info(`⚡ Done in ${duration}`);
|
|
87
|
+
return { success: true, outfile };
|
|
69
88
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}))), (0, operators_1.scan)((acc, result) => {
|
|
76
|
-
if (!acc.success)
|
|
77
|
-
return acc;
|
|
78
|
-
return result;
|
|
79
|
-
}, { success: true, outfile }), (0, operators_1.last)(), (0, operators_1.tap)({
|
|
80
|
-
next: (result) => {
|
|
81
|
-
if (result.success) {
|
|
82
|
-
const end = process.hrtime.bigint();
|
|
83
|
-
const duration = `${(Number(end - start) / 1000000000).toFixed(2)}s`;
|
|
84
|
-
(0, update_package_json_1.updatePackageJson)(options, packageJson);
|
|
85
|
-
devkit_1.logger.info(`⚡ Done in ${duration}`);
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
devkit_1.logger.error(`Bundle failed: ${context.projectName}`);
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
}))
|
|
92
|
-
.toPromise();
|
|
89
|
+
catch {
|
|
90
|
+
devkit_1.logger.error(`Bundle failed: ${context.projectName}`);
|
|
91
|
+
return { success: false };
|
|
92
|
+
}
|
|
93
|
+
// endregion
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
96
|
exports.rollupExecutor = rollupExecutor;
|
|
@@ -116,133 +117,117 @@ async function createRollupOptions(options, dependencies, context, packageJson,
|
|
|
116
117
|
}
|
|
117
118
|
options.format = ['cjs'];
|
|
118
119
|
}
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
autoModules: true,
|
|
149
|
-
plugins: [autoprefixer],
|
|
150
|
-
use: {
|
|
151
|
-
less: {
|
|
152
|
-
javascriptEnabled: options.javascriptEnabled,
|
|
153
|
-
},
|
|
120
|
+
const plugins = [
|
|
121
|
+
copy({
|
|
122
|
+
targets: convertCopyAssetsToRollupOptions(options.outputPath, options.assets),
|
|
123
|
+
}),
|
|
124
|
+
image(),
|
|
125
|
+
json(),
|
|
126
|
+
// Needed to generate type definitions, even if we're using babel or swc.
|
|
127
|
+
require('rollup-plugin-typescript2')({
|
|
128
|
+
check: !options.skipTypeCheck,
|
|
129
|
+
tsconfig: options.tsConfig,
|
|
130
|
+
tsconfigOverride: {
|
|
131
|
+
compilerOptions: createTsCompilerOptions(config, dependencies, options),
|
|
132
|
+
},
|
|
133
|
+
}),
|
|
134
|
+
(0, type_definitions_1.typeDefinitions)({
|
|
135
|
+
main: options.main,
|
|
136
|
+
projectRoot: options.projectRoot,
|
|
137
|
+
}),
|
|
138
|
+
peerDepsExternal({
|
|
139
|
+
packageJsonPath: options.project,
|
|
140
|
+
}),
|
|
141
|
+
postcss({
|
|
142
|
+
inject: true,
|
|
143
|
+
extract: options.extractCss,
|
|
144
|
+
autoModules: true,
|
|
145
|
+
plugins: [autoprefixer],
|
|
146
|
+
use: {
|
|
147
|
+
less: {
|
|
148
|
+
javascriptEnabled: options.javascriptEnabled,
|
|
154
149
|
},
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
150
|
+
},
|
|
151
|
+
}),
|
|
152
|
+
(0, plugin_node_resolve_1.default)({
|
|
153
|
+
preferBuiltins: true,
|
|
154
|
+
extensions: fileExtensions,
|
|
155
|
+
}),
|
|
156
|
+
useSwc && (0, swc_plugin_1.swc)(),
|
|
157
|
+
useBabel &&
|
|
158
|
+
(0, plugin_babel_1.getBabelInputPlugin)({
|
|
159
|
+
// Lets `@nx/js/babel` preset know that we are packaging.
|
|
160
|
+
caller: {
|
|
161
|
+
// @ts-ignore
|
|
162
|
+
// Ignoring type checks for caller since we have custom attributes
|
|
163
|
+
isNxPackage: true,
|
|
164
|
+
// Always target esnext and let rollup handle cjs
|
|
165
|
+
supportsStaticESM: true,
|
|
166
|
+
isModern: true,
|
|
167
|
+
},
|
|
168
|
+
cwd: (0, path_1.join)(context.root, sourceRoot),
|
|
169
|
+
rootMode: options.babelUpwardRootMode ? 'upward' : undefined,
|
|
170
|
+
babelrc: true,
|
|
158
171
|
extensions: fileExtensions,
|
|
172
|
+
babelHelpers: 'bundled',
|
|
173
|
+
skipPreflightCheck: true, // pre-flight check may yield false positives and also slows down the build
|
|
174
|
+
exclude: /node_modules/,
|
|
159
175
|
}),
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
176
|
+
commonjs(),
|
|
177
|
+
(0, analyze_plugin_1.analyze)(),
|
|
178
|
+
];
|
|
179
|
+
let externalPackages = [
|
|
180
|
+
...Object.keys(packageJson.dependencies || {}),
|
|
181
|
+
...Object.keys(packageJson.peerDependencies || {}),
|
|
182
|
+
]; // If external is set to none, include all dependencies and peerDependencies in externalPackages
|
|
183
|
+
if (options.external === 'all') {
|
|
184
|
+
externalPackages = externalPackages
|
|
185
|
+
.concat(dependencies.map((d) => d.name))
|
|
186
|
+
.concat(npmDeps);
|
|
187
|
+
}
|
|
188
|
+
else if (Array.isArray(options.external) && options.external.length > 0) {
|
|
189
|
+
externalPackages = externalPackages.concat(options.external);
|
|
190
|
+
}
|
|
191
|
+
externalPackages = [...new Set(externalPackages)];
|
|
192
|
+
const mainEntryFileName = options.outputFileName || options.main;
|
|
193
|
+
const input = {};
|
|
194
|
+
input[(0, path_1.parse)(mainEntryFileName).name] = options.main;
|
|
195
|
+
options.additionalEntryPoints.forEach((entry) => {
|
|
196
|
+
input[(0, path_1.parse)(entry).name] = entry;
|
|
197
|
+
});
|
|
198
|
+
const rollupConfig = {
|
|
199
|
+
input,
|
|
200
|
+
output: options.format.map((format) => ({
|
|
201
|
+
format,
|
|
202
|
+
dir: `${options.outputPath}`,
|
|
203
|
+
name: (0, devkit_1.names)(context.projectName).className,
|
|
204
|
+
entryFileNames: `[name].${format}.js`,
|
|
205
|
+
chunkFileNames: `[name].${format}.js`,
|
|
206
|
+
})),
|
|
207
|
+
external: (id) => {
|
|
208
|
+
return externalPackages.some((name) => id === name || id.startsWith(`${name}/`)); // Could be a deep import
|
|
209
|
+
},
|
|
210
|
+
plugins,
|
|
211
|
+
};
|
|
212
|
+
const userDefinedRollupConfigs = options.rollupConfig.map((plugin) => (0, config_utils_1.loadConfigFile)(plugin));
|
|
213
|
+
let finalConfig = rollupConfig;
|
|
214
|
+
for (const _config of userDefinedRollupConfigs) {
|
|
215
|
+
const config = await _config;
|
|
216
|
+
if (typeof config === 'function') {
|
|
217
|
+
finalConfig = config(finalConfig, options);
|
|
196
218
|
}
|
|
197
|
-
else
|
|
198
|
-
|
|
219
|
+
else {
|
|
220
|
+
finalConfig = {
|
|
221
|
+
...finalConfig,
|
|
222
|
+
...config,
|
|
223
|
+
plugins: [
|
|
224
|
+
...(finalConfig.plugins?.length > 0 ? finalConfig.plugins : []),
|
|
225
|
+
...(config.plugins?.length > 0 ? config.plugins : []),
|
|
226
|
+
],
|
|
227
|
+
};
|
|
199
228
|
}
|
|
200
|
-
externalPackages = [...new Set(externalPackages)];
|
|
201
|
-
const mainEntryFileName = options.outputFileName || options.main;
|
|
202
|
-
const input = {};
|
|
203
|
-
input[(0, path_1.parse)(mainEntryFileName).name] = options.main;
|
|
204
|
-
options.additionalEntryPoints.forEach((entry) => {
|
|
205
|
-
input[(0, path_1.parse)(entry).name] = entry;
|
|
206
|
-
});
|
|
207
|
-
const rollupConfig = {
|
|
208
|
-
input,
|
|
209
|
-
output: {
|
|
210
|
-
format,
|
|
211
|
-
dir: `${options.outputPath}`,
|
|
212
|
-
name: (0, devkit_1.names)(context.projectName).className,
|
|
213
|
-
entryFileNames: `[name].${format}.js`,
|
|
214
|
-
chunkFileNames: `[name].${format}.js`,
|
|
215
|
-
},
|
|
216
|
-
external: (id) => {
|
|
217
|
-
return externalPackages.some((name) => id === name || id.startsWith(`${name}/`)); // Could be a deep import
|
|
218
|
-
},
|
|
219
|
-
plugins,
|
|
220
|
-
};
|
|
221
|
-
const userDefinedRollupConfigs = options.rollupConfig.map((plugin) => (0, config_utils_1.loadConfigFile)(plugin));
|
|
222
|
-
let finalConfig = rollupConfig;
|
|
223
|
-
for (const _config of userDefinedRollupConfigs) {
|
|
224
|
-
const config = await _config;
|
|
225
|
-
if (typeof config === 'function') {
|
|
226
|
-
finalConfig = config(finalConfig, options);
|
|
227
|
-
}
|
|
228
|
-
else {
|
|
229
|
-
finalConfig = {
|
|
230
|
-
...finalConfig,
|
|
231
|
-
...config,
|
|
232
|
-
plugins: [
|
|
233
|
-
...(finalConfig.plugins?.length > 0 ? finalConfig.plugins : []),
|
|
234
|
-
...(config.plugins?.length > 0 ? config.plugins : []),
|
|
235
|
-
],
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
return finalConfig;
|
|
240
|
-
});
|
|
241
|
-
const rollupOptions = [];
|
|
242
|
-
for (const rollupOption of _rollupOptions) {
|
|
243
|
-
rollupOptions.push(await rollupOption);
|
|
244
229
|
}
|
|
245
|
-
return
|
|
230
|
+
return finalConfig;
|
|
246
231
|
}
|
|
247
232
|
exports.createRollupOptions = createRollupOptions;
|
|
248
233
|
function createTsCompilerOptions(config, dependencies, options) {
|
|
@@ -5,13 +5,20 @@ const devkit_1 = require("@nx/devkit");
|
|
|
5
5
|
const versions_1 = require("@nx/js/src/utils/versions");
|
|
6
6
|
const versions_2 = require("./versions");
|
|
7
7
|
function ensureDependencies(tree, options) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
switch (options.compiler) {
|
|
9
|
+
case 'swc':
|
|
10
|
+
return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
11
|
+
'@swc/helpers': versions_1.swcHelpersVersion,
|
|
12
|
+
'@swc/core': versions_1.swcCoreVersion,
|
|
13
|
+
'swc-loader': versions_2.swcLoaderVersion,
|
|
14
|
+
});
|
|
15
|
+
case 'babel':
|
|
16
|
+
return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
17
|
+
'core-js': versions_2.coreJsVersion, // needed for preset-env to work
|
|
18
|
+
tslib: versions_2.tsLibVersion,
|
|
19
|
+
});
|
|
20
|
+
default:
|
|
21
|
+
return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, { tslib: versions_2.tsLibVersion });
|
|
14
22
|
}
|
|
15
|
-
return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, { tslib: versions_2.tsLibVersion });
|
|
16
23
|
}
|
|
17
24
|
exports.ensureDependencies = ensureDependencies;
|
package/src/utils/versions.d.ts
CHANGED
package/src/utils/versions.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tsLibVersion = exports.swcLoaderVersion = exports.nxVersion = void 0;
|
|
3
|
+
exports.coreJsVersion = exports.tsLibVersion = exports.swcLoaderVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
5
|
exports.swcLoaderVersion = '0.1.15';
|
|
6
6
|
exports.tsLibVersion = '^2.3.0';
|
|
7
|
+
exports.coreJsVersion = '^3.36.1';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.runRollup = void 0;
|
|
4
|
-
const rollup = require("rollup");
|
|
5
|
-
const rxjs_1 = require("rxjs");
|
|
6
|
-
const operators_1 = require("rxjs/operators");
|
|
7
|
-
function runRollup(options) {
|
|
8
|
-
return (0, rxjs_1.from)(rollup.rollup(options)).pipe((0, operators_1.switchMap)((bundle) => {
|
|
9
|
-
const outputOptions = Array.isArray(options.output)
|
|
10
|
-
? options.output
|
|
11
|
-
: [options.output];
|
|
12
|
-
return (0, rxjs_1.from)(Promise.all(outputOptions.map((o) => bundle.write(o))));
|
|
13
|
-
}), (0, operators_1.map)(() => ({ success: true })));
|
|
14
|
-
}
|
|
15
|
-
exports.runRollup = runRollup;
|