rollup 3.0.1 → 3.1.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/dist/bin/rollup CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  /*
4
4
  @license
5
- Rollup.js v3.0.1
6
- Wed, 12 Oct 2022 07:33:32 GMT - commit 4dd8f96addd8d8197f96e258749d78c2d1c443c8
5
+ Rollup.js v3.1.0
6
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
7
7
 
8
8
  https://github.com/rollup/rollup
9
9
 
package/dist/es/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.1
4
- Wed, 12 Oct 2022 07:33:32 GMT - commit 4dd8f96addd8d8197f96e258749d78c2d1c443c8
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.1
4
- Wed, 12 Oct 2022 07:33:32 GMT - commit 4dd8f96addd8d8197f96e258749d78c2d1c443c8
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -15,7 +15,7 @@ import { createHash as createHash$1 } from 'node:crypto';
15
15
  import { promises } from 'node:fs';
16
16
  import { EventEmitter } from 'node:events';
17
17
 
18
- var version$1 = "3.0.1";
18
+ var version$1 = "3.1.0";
19
19
 
20
20
  var charToInteger = {};
21
21
  var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
@@ -23823,6 +23823,7 @@ const getOptionWithPreset = (value, presets, optionName, additionalValues) => {
23823
23823
  return objectifyOptionWithPresets(presets, optionName, additionalValues)(value);
23824
23824
  };
23825
23825
  const getHashFromObjectOption = (optionName) => optionName.split('.').join('').toLowerCase();
23826
+ const normalizePluginOption = (plugins) => [plugins].flat(Infinity).filter(Boolean);
23826
23827
 
23827
23828
  function normalizeInputOptions(config) {
23828
23829
  // These are options that may trigger special warnings or behaviour later
@@ -23848,7 +23849,7 @@ function normalizeInputOptions(config) {
23848
23849
  moduleContext: getModuleContext(config, context),
23849
23850
  onwarn,
23850
23851
  perf: config.perf || false,
23851
- plugins: ensureArray(config.plugins),
23852
+ plugins: normalizePluginOption(config.plugins),
23852
23853
  preserveEntrySignatures: config.preserveEntrySignatures ?? 'exports-only',
23853
23854
  preserveModules: getPreserveModules$1(config, onwarn, strictDeprecations),
23854
23855
  preserveSymlinks: config.preserveSymlinks || false,
@@ -24065,7 +24066,7 @@ function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
24065
24066
  noConflict: config.noConflict || false,
24066
24067
  outro: getAddon(config, 'outro'),
24067
24068
  paths: config.paths || {},
24068
- plugins: ensureArray(config.plugins),
24069
+ plugins: normalizePluginOption(config.plugins),
24069
24070
  preferConst,
24070
24071
  preserveModules,
24071
24072
  preserveModulesRoot: getPreserveModulesRoot(config),
@@ -24547,4 +24548,4 @@ function watch(configs) {
24547
24548
  return emitter;
24548
24549
  }
24549
24550
 
24550
- export { createFilter, defaultOnWarn, defineConfig, ensureArray, fseventsImporter, generatedCodePresets, getAugmentedNamespace, objectifyOption, objectifyOptionWithPresets, picomatch$1 as picomatch, rollup, rollupInternal, treeshakePresets, version$1 as version, warnUnknownOptions, watch };
24551
+ export { createFilter, defaultOnWarn, defineConfig, ensureArray, fseventsImporter, generatedCodePresets, getAugmentedNamespace, normalizePluginOption, objectifyOption, objectifyOptionWithPresets, picomatch$1 as picomatch, rollup, rollupInternal, treeshakePresets, version$1 as version, warnUnknownOptions, watch };
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.1
4
- Wed, 12 Oct 2022 07:33:32 GMT - commit 4dd8f96addd8d8197f96e258749d78c2d1c443c8
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -9,7 +9,7 @@
9
9
  */
10
10
  import { resolve } from 'node:path';
11
11
  import process$1 from 'node:process';
12
- import { ensureArray, warnUnknownOptions, defaultOnWarn, objectifyOptionWithPresets, treeshakePresets, objectifyOption, generatedCodePresets, picomatch as picomatch$2, getAugmentedNamespace, fseventsImporter, createFilter, rollupInternal } from './rollup.js';
12
+ import { ensureArray, warnUnknownOptions, defaultOnWarn, normalizePluginOption, objectifyOptionWithPresets, treeshakePresets, objectifyOption, generatedCodePresets, picomatch as picomatch$2, getAugmentedNamespace, fseventsImporter, createFilter, rollupInternal } from './rollup.js';
13
13
  import { platform } from 'node:os';
14
14
  import require$$0$1 from 'fs';
15
15
  import require$$2 from 'util';
@@ -89,7 +89,7 @@ function mergeInputOptions(config, overrides, defaultOnWarnHandler) {
89
89
  moduleContext: getOption('moduleContext'),
90
90
  onwarn: getOnWarn(config, defaultOnWarnHandler),
91
91
  perf: getOption('perf'),
92
- plugins: ensureArray(config.plugins),
92
+ plugins: normalizePluginOption(config.plugins),
93
93
  preserveEntrySignatures: getOption('preserveEntrySignatures'),
94
94
  preserveModules: getOption('preserveModules'),
95
95
  preserveSymlinks: getOption('preserveSymlinks'),
@@ -163,7 +163,7 @@ function mergeOutputOptions(config, overrides, warn) {
163
163
  noConflict: getOption('noConflict'),
164
164
  outro: getOption('outro'),
165
165
  paths: getOption('paths'),
166
- plugins: ensureArray(config.plugins),
166
+ plugins: normalizePluginOption(config.plugins),
167
167
  preferConst: getOption('preferConst'),
168
168
  preserveModules: getOption('preserveModules'),
169
169
  preserveModulesRoot: getOption('preserveModulesRoot'),
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.1
4
- Wed, 12 Oct 2022 07:33:32 GMT - commit 4dd8f96addd8d8197f96e258749d78c2d1c443c8
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/rollup.d.ts CHANGED
@@ -492,6 +492,8 @@ export type SourcemapPathTransformOption = (
492
492
  sourcemapPath: string
493
493
  ) => string;
494
494
 
495
+ export type InputPluginOption = Plugin | null | false | undefined | InputPluginOption[];
496
+
495
497
  export interface InputOptions {
496
498
  acorn?: Record<string, unknown>;
497
499
  acornInjectPlugins?: (() => unknown)[] | (() => unknown);
@@ -511,7 +513,7 @@ export interface InputOptions {
511
513
  moduleContext?: ((id: string) => string | null | void) | { [id: string]: string };
512
514
  onwarn?: WarningHandlerWithDefault;
513
515
  perf?: boolean;
514
- plugins?: (Plugin | null | false | undefined)[];
516
+ plugins?: InputPluginOption;
515
517
  preserveEntrySignatures?: PreserveEntrySignaturesOption;
516
518
  /** @deprecated Use the "preserveModules" output option instead. */
517
519
  preserveModules?: boolean;
@@ -522,6 +524,10 @@ export interface InputOptions {
522
524
  watch?: WatcherOptions | false;
523
525
  }
524
526
 
527
+ export interface InputOptionsWithPlugins extends InputOptions {
528
+ plugins: Plugin[];
529
+ }
530
+
525
531
  export interface NormalizedInputOptions {
526
532
  acorn: Record<string, unknown>;
527
533
  acornInjectPlugins: (() => unknown)[];
@@ -610,6 +616,8 @@ export type NormalizedAmdOptions = (
610
616
 
611
617
  type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;
612
618
 
619
+ type OutputPluginOption = OutputPlugin | null | false | undefined | OutputPluginOption[];
620
+
613
621
  export interface OutputOptions {
614
622
  amd?: AmdOptions;
615
623
  assetFileNames?: string | ((chunkInfo: PreRenderedAsset) => string);
@@ -647,7 +655,7 @@ export interface OutputOptions {
647
655
  noConflict?: boolean;
648
656
  outro?: string | AddonFunction;
649
657
  paths?: OptionsPaths;
650
- plugins?: (OutputPlugin | null | false | undefined)[];
658
+ plugins?: OutputPluginOption;
651
659
  /** @deprecated Use "generatedCode.constBindings" instead. */
652
660
  preferConst?: boolean;
653
661
  preserveModules?: boolean;
@@ -800,7 +808,7 @@ export interface RollupOptions extends InputOptions {
800
808
  output?: OutputOptions | OutputOptions[];
801
809
  }
802
810
 
803
- export interface MergedRollupOptions extends InputOptions {
811
+ export interface MergedRollupOptions extends InputOptionsWithPlugins {
804
812
  output: OutputOptions[];
805
813
  }
806
814
 
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.1
4
- Wed, 12 Oct 2022 07:33:32 GMT - commit 4dd8f96addd8d8197f96e258749d78c2d1c443c8
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.1
4
- Wed, 12 Oct 2022 07:33:32 GMT - commit 4dd8f96addd8d8197f96e258749d78c2d1c443c8
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.1
4
- Wed, 12 Oct 2022 07:33:32 GMT - commit 4dd8f96addd8d8197f96e258749d78c2d1c443c8
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -450,7 +450,7 @@ async function addCommandPluginsToInputOptions(inputOptions, command) {
450
450
  }
451
451
  async function addPluginsFromCommandOption(commandPlugin, inputOptions) {
452
452
  if (commandPlugin) {
453
- const plugins = Array.isArray(commandPlugin) ? commandPlugin : [commandPlugin];
453
+ const plugins = rollup.normalizePluginOption(commandPlugin);
454
454
  for (const plugin of plugins) {
455
455
  if (/[={}]/.test(plugin)) {
456
456
  // -p plugin=value
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.1
4
- Wed, 12 Oct 2022 07:33:32 GMT - commit 4dd8f96addd8d8197f96e258749d78c2d1c443c8
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -78,7 +78,7 @@ function mergeInputOptions(config, overrides, defaultOnWarnHandler) {
78
78
  moduleContext: getOption('moduleContext'),
79
79
  onwarn: getOnWarn(config, defaultOnWarnHandler),
80
80
  perf: getOption('perf'),
81
- plugins: rollup.ensureArray(config.plugins),
81
+ plugins: rollup.normalizePluginOption(config.plugins),
82
82
  preserveEntrySignatures: getOption('preserveEntrySignatures'),
83
83
  preserveModules: getOption('preserveModules'),
84
84
  preserveSymlinks: getOption('preserveSymlinks'),
@@ -158,7 +158,7 @@ function mergeOutputOptions(config, overrides, warn) {
158
158
  noConflict: getOption('noConflict'),
159
159
  outro: getOption('outro'),
160
160
  paths: getOption('paths'),
161
- plugins: rollup.ensureArray(config.plugins),
161
+ plugins: rollup.normalizePluginOption(config.plugins),
162
162
  preferConst: getOption('preferConst'),
163
163
  preserveModules: getOption('preserveModules'),
164
164
  preserveModulesRoot: getOption('preserveModulesRoot'),
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.1
4
- Wed, 12 Oct 2022 07:33:32 GMT - commit 4dd8f96addd8d8197f96e258749d78c2d1c443c8
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -17,7 +17,7 @@ const node_crypto = require('node:crypto');
17
17
  const node_fs = require('node:fs');
18
18
  const node_events = require('node:events');
19
19
 
20
- var version$1 = "3.0.1";
20
+ var version$1 = "3.1.0";
21
21
 
22
22
  function ensureArray$1(items) {
23
23
  if (Array.isArray(items)) {
@@ -856,6 +856,7 @@ const getOptionWithPreset = (value, presets, optionName, additionalValues) => {
856
856
  return objectifyOptionWithPresets(presets, optionName, additionalValues)(value);
857
857
  };
858
858
  const getHashFromObjectOption = (optionName) => optionName.split('.').join('').toLowerCase();
859
+ const normalizePluginOption = (plugins) => [plugins].flat(Infinity).filter(Boolean);
859
860
 
860
861
  let fsEvents;
861
862
  let fsEventsImportError;
@@ -23933,7 +23934,7 @@ function normalizeInputOptions(config) {
23933
23934
  moduleContext: getModuleContext(config, context),
23934
23935
  onwarn,
23935
23936
  perf: config.perf || false,
23936
- plugins: ensureArray$1(config.plugins),
23937
+ plugins: normalizePluginOption(config.plugins),
23937
23938
  preserveEntrySignatures: config.preserveEntrySignatures ?? 'exports-only',
23938
23939
  preserveModules: getPreserveModules$1(config, onwarn, strictDeprecations),
23939
23940
  preserveSymlinks: config.preserveSymlinks || false,
@@ -24150,7 +24151,7 @@ function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
24150
24151
  noConflict: config.noConflict || false,
24151
24152
  outro: getAddon(config, 'outro'),
24152
24153
  paths: config.paths || {},
24153
- plugins: ensureArray$1(config.plugins),
24154
+ plugins: normalizePluginOption(config.plugins),
24154
24155
  preferConst,
24155
24156
  preserveModules,
24156
24157
  preserveModulesRoot: getPreserveModulesRoot(config),
@@ -24629,6 +24630,7 @@ exports.getAliasName = getAliasName;
24629
24630
  exports.getAugmentedNamespace = getAugmentedNamespace;
24630
24631
  exports.getOrCreate = getOrCreate;
24631
24632
  exports.loadFsEvents = loadFsEvents;
24633
+ exports.normalizePluginOption = normalizePluginOption;
24632
24634
  exports.objectifyOption = objectifyOption;
24633
24635
  exports.objectifyOptionWithPresets = objectifyOptionWithPresets;
24634
24636
  exports.picomatch = picomatch$1;
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.1
4
- Wed, 12 Oct 2022 07:33:32 GMT - commit 4dd8f96addd8d8197f96e258749d78c2d1c443c8
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.1
4
- Wed, 12 Oct 2022 07:33:32 GMT - commit 4dd8f96addd8d8197f96e258749d78c2d1c443c8
3
+ Rollup.js v3.1.0
4
+ Wed, 12 Oct 2022 08:54:50 GMT - commit f7b768992209a970c240799cdff12a4fa437c0d4
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rollup",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",