rollup 2.67.2 → 2.69.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/rollup.d.ts CHANGED
@@ -108,7 +108,6 @@ export interface TransformModuleJSON {
108
108
  customTransformCache: boolean;
109
109
  originalCode: string;
110
110
  originalSourcemap: ExistingDecodedSourceMap | null;
111
- resolvedIds?: ResolvedIdMap;
112
111
  sourcemapChain: DecodedSourceMapOrMissing[];
113
112
  transformDependencies: string[];
114
113
  }
@@ -117,6 +116,7 @@ export interface ModuleJSON extends TransformModuleJSON, ModuleOptions {
117
116
  ast: AcornNode;
118
117
  dependencies: string[];
119
118
  id: string;
119
+ resolvedIds: ResolvedIdMap;
120
120
  transformFiles: EmittedFile[] | undefined;
121
121
  }
122
122
 
@@ -254,6 +254,7 @@ export type ShouldTransformCachedModuleHook = (
254
254
  id: string;
255
255
  meta: CustomPluginOptions;
256
256
  moduleSideEffects: boolean | 'no-treeshake';
257
+ resolvedSources: ResolvedIdMap;
257
258
  syntheticNamedExports: boolean | string;
258
259
  }
259
260
  ) => Promise<boolean> | boolean;
@@ -607,6 +608,7 @@ interface NormalizedGeneratedCodeOptions {
607
608
  constBindings: boolean;
608
609
  objectShorthand: boolean;
609
610
  reservedNamesAsProps: boolean;
611
+ symbols: boolean;
610
612
  }
611
613
 
612
614
  interface GeneratedCodeOptions extends Partial<NormalizedGeneratedCodeOptions> {
@@ -680,12 +682,13 @@ export interface OutputOptions {
680
682
  manualChunks?: ManualChunksOption;
681
683
  minifyInternalExports?: boolean;
682
684
  name?: string;
685
+ /** @deprecated Use "generatedCode.symbols" instead. */
683
686
  namespaceToStringTag?: boolean;
684
687
  noConflict?: boolean;
685
688
  outro?: string | (() => string | Promise<string>);
686
689
  paths?: OptionsPaths;
687
690
  plugins?: (OutputPlugin | null | false | undefined)[];
688
- /** @deprecated Use the "generatedCode.constBindings" instead. */
691
+ /** @deprecated Use "generatedCode.constBindings" instead. */
689
692
  preferConst?: boolean;
690
693
  preserveModules?: boolean;
691
694
  preserveModulesRoot?: string;
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.67.2
4
- Thu, 10 Feb 2022 08:15:45 GMT - commit 60706c33073abe34cac170a92a17a1b166d348e3
3
+ Rollup.js v2.69.0
4
+ Wed, 02 Mar 2022 13:21:33 GMT - commit 10dc32678944cb276c2efe781b12350a8e0a5adf
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -10,7 +10,7 @@
10
10
  */
11
11
  'use strict';
12
12
 
13
- Object.defineProperty(exports, '__esModule', { value: true });
13
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
14
14
 
15
15
  const rollup = require('./shared/rollup.js');
16
16
  require('path');
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.67.2
4
- Thu, 10 Feb 2022 08:15:45 GMT - commit 60706c33073abe34cac170a92a17a1b166d348e3
3
+ Rollup.js v2.69.0
4
+ Wed, 02 Mar 2022 13:21:33 GMT - commit 10dc32678944cb276c2efe781b12350a8e0a5adf
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.67.2
4
- Thu, 10 Feb 2022 08:15:45 GMT - commit 60706c33073abe34cac170a92a17a1b166d348e3
3
+ Rollup.js v2.69.0
4
+ Wed, 02 Mar 2022 13:21:33 GMT - commit 10dc32678944cb276c2efe781b12350a8e0a5adf
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -19,7 +19,7 @@ const rollup = require('./rollup.js');
19
19
  const mergeOptions = require('./mergeOptions.js');
20
20
 
21
21
  function _interopNamespaceDefault(e) {
22
- const n = Object.create(null);
22
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
23
23
  if (e) {
24
24
  for (const k in e) {
25
25
  n[k] = e[k];
@@ -171,10 +171,10 @@ function handleError(err, recover = false) {
171
171
 
172
172
  function batchWarnings() {
173
173
  let count = 0;
174
- let deferredWarnings = new Map();
174
+ const deferredWarnings = new Map();
175
175
  let warningOccurred = false;
176
176
  return {
177
- add: (warning) => {
177
+ add(warning) {
178
178
  count += 1;
179
179
  warningOccurred = true;
180
180
  if (warning.code in deferredHandlers) {
@@ -201,14 +201,14 @@ function batchWarnings() {
201
201
  get count() {
202
202
  return count;
203
203
  },
204
- flush: () => {
204
+ flush() {
205
205
  if (count === 0)
206
206
  return;
207
207
  const codes = Array.from(deferredWarnings.keys()).sort((a, b) => deferredWarnings.get(b).length - deferredWarnings.get(a).length);
208
208
  for (const code of codes) {
209
209
  deferredHandlers[code](deferredWarnings.get(code));
210
210
  }
211
- deferredWarnings = new Map();
211
+ deferredWarnings.clear();
212
212
  count = 0;
213
213
  },
214
214
  get warningOccurred() {
@@ -217,11 +217,11 @@ function batchWarnings() {
217
217
  };
218
218
  }
219
219
  const immediateHandlers = {
220
- MISSING_NODE_BUILTINS: warning => {
220
+ MISSING_NODE_BUILTINS(warning) {
221
221
  title(`Missing shims for Node.js built-ins`);
222
222
  stderr(`Creating a browser bundle that depends on ${rollup.printQuotedStringList(warning.modules)}. You might need to include https://github.com/snowpackjs/rollup-plugin-polyfill-node`);
223
223
  },
224
- UNKNOWN_OPTION: warning => {
224
+ UNKNOWN_OPTION(warning) {
225
225
  title(`You have passed an unrecognized option`);
226
226
  stderr(warning.message);
227
227
  }
@@ -262,7 +262,7 @@ const deferredHandlers = {
262
262
  stderr(`${bold(warning.source)} (guessing '${warning.guess}')`);
263
263
  }
264
264
  },
265
- MIXED_EXPORTS: warnings => {
265
+ MIXED_EXPORTS(warnings) {
266
266
  title('Mixing named and default exports');
267
267
  info(`https://rollupjs.org/guide/en/#outputexports`);
268
268
  stderr(bold('The following entry modules are using named and default exports together:'));
@@ -314,9 +314,7 @@ const deferredHandlers = {
314
314
  SOURCEMAP_BROKEN(warnings) {
315
315
  title(`Broken sourcemap`);
316
316
  info('https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect');
317
- const plugins = [
318
- ...new Set(warnings.map(warning => warning.plugin).filter(Boolean))
319
- ];
317
+ const plugins = [...new Set(warnings.map(({ plugin }) => plugin).filter(Boolean))];
320
318
  stderr(`Plugins that transform code (such as ${rollup.printQuotedStringList(plugins)}) should generate accompanying sourcemaps`);
321
319
  },
322
320
  THIS_IS_UNDEFINED(warnings) {
@@ -331,8 +329,7 @@ const deferredHandlers = {
331
329
  for (const warning of warnings) {
332
330
  rollup.getOrCreate(dependencies, warning.source, () => []).push(warning.importer);
333
331
  }
334
- for (const dependency of dependencies.keys()) {
335
- const importers = dependencies.get(dependency);
332
+ for (const [dependency, importers] of dependencies) {
336
333
  stderr(`${bold(dependency)} (imported by ${importers.join(', ')})`);
337
334
  }
338
335
  },
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.67.2
4
- Thu, 10 Feb 2022 08:15:45 GMT - commit 60706c33073abe34cac170a92a17a1b166d348e3
3
+ Rollup.js v2.69.0
4
+ Wed, 02 Mar 2022 13:21:33 GMT - commit 10dc32678944cb276c2efe781b12350a8e0a5adf
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -53,7 +53,7 @@ function getCommandOptions(rawCommandOptions) {
53
53
  ? rawCommandOptions.globals.split(',').reduce((globals, globalDefinition) => {
54
54
  const [id, variableName] = globalDefinition.split(':');
55
55
  globals[id] = variableName;
56
- if (external.indexOf(id) === -1) {
56
+ if (!external.includes(id)) {
57
57
  external.push(id);
58
58
  }
59
59
  return globals;
@@ -93,7 +93,7 @@ function mergeInputOptions(config, overrides, defaultOnWarnHandler) {
93
93
  const getExternal = (config, overrides) => {
94
94
  const configExternal = config.external;
95
95
  return typeof configExternal === 'function'
96
- ? (source, importer, isResolved) => configExternal(source, importer, isResolved) || overrides.external.indexOf(source) !== -1
96
+ ? (source, importer, isResolved) => configExternal(source, importer, isResolved) || overrides.external.includes(source)
97
97
  : rollup.ensureArray(configExternal).concat(overrides.external);
98
98
  };
99
99
  const getOnWarn = (config, defaultOnWarnHandler) => config.onwarn