@nx/rollup 18.3.0-beta.0 → 18.3.0-beta.1

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": "18.3.0-beta.0",
3
+ "version": "18.3.0-beta.1",
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.1",
45
45
  "rollup-plugin-typescript2": "0.36.0",
46
46
  "tslib": "^2.3.0",
47
- "@nx/devkit": "18.3.0-beta.0",
48
- "@nx/js": "18.3.0-beta.0",
49
- "@nrwl/rollup": "18.3.0-beta.0"
47
+ "@nx/devkit": "18.3.0-beta.1",
48
+ "@nx/js": "18.3.0-beta.1",
49
+ "@nrwl/rollup": "18.3.0-beta.1"
50
50
  },
51
51
  "publishConfig": {
52
52
  "access": "public"
@@ -11,5 +11,5 @@ export declare function rollupExecutor(rawOptions: RollupExecutorOptions, contex
11
11
  success: boolean;
12
12
  outfile?: undefined;
13
13
  }, unknown>;
14
- export declare function createRollupOptions(options: NormalizedRollupExecutorOptions, dependencies: DependentBuildableProjectNode[], context: ExecutorContext, packageJson: PackageJson, sourceRoot: string, npmDeps: string[]): Promise<rollup.RollupOptions>;
14
+ export declare function createRollupOptions(options: NormalizedRollupExecutorOptions, dependencies: DependentBuildableProjectNode[], context: ExecutorContext, packageJson: PackageJson, sourceRoot: string, npmDeps: string[]): Promise<rollup.RollupOptions | rollup.RollupOptions[]>;
15
15
  export default rollupExecutor;
@@ -73,12 +73,15 @@ async function* rollupExecutor(rawOptions, context) {
73
73
  (0, fs_1.deleteOutputDir)(context.root, options.outputPath);
74
74
  }
75
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);
76
+ const allRollupOptions = Array.isArray(rollupOptions)
77
+ ? rollupOptions
78
+ : [rollupOptions];
79
+ for (const opts of allRollupOptions) {
80
+ const bundle = await rollup.rollup(opts);
81
+ const output = Array.isArray(opts.output) ? opts.output : [opts.output];
82
+ for (const o of output) {
83
+ await bundle.write(o);
84
+ }
82
85
  }
83
86
  const end = process.hrtime.bigint();
84
87
  const duration = `${(Number(end - start) / 1_000_000_000).toFixed(2)}s`;
@@ -86,7 +89,8 @@ async function* rollupExecutor(rawOptions, context) {
86
89
  devkit_1.logger.info(`⚡ Done in ${duration}`);
87
90
  return { success: true, outfile };
88
91
  }
89
- catch {
92
+ catch (e) {
93
+ devkit_1.logger.error(e);
90
94
  devkit_1.logger.error(`Bundle failed: ${context.projectName}`);
91
95
  return { success: false };
92
96
  }