rollup 2.8.0 → 2.9.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/dist/rollup.d.ts CHANGED
@@ -150,6 +150,19 @@ export type EmitChunk = (id: string, options?: { name?: string }) => string;
150
150
 
151
151
  export type EmitFile = (emittedFile: EmittedFile) => string;
152
152
 
153
+ interface ModuleInfo {
154
+ dynamicallyImportedIds: string[];
155
+ dynamicImporters: string[];
156
+ hasModuleSideEffects: boolean;
157
+ id: string;
158
+ importedIds: string[];
159
+ importers: string[];
160
+ isEntry: boolean;
161
+ isExternal: boolean;
162
+ }
163
+
164
+ export type GetModuleInfo = (moduleId: string) => ModuleInfo;
165
+
153
166
  export interface PluginContext extends MinimalPluginContext {
154
167
  addWatchFile: (id: string) => void;
155
168
  cache: PluginCache;
@@ -164,18 +177,11 @@ export interface PluginContext extends MinimalPluginContext {
164
177
  /** @deprecated Use `this.getFileName` instead */
165
178
  getChunkFileName: (chunkReferenceId: string) => string;
166
179
  getFileName: (fileReferenceId: string) => string;
167
- getModuleInfo: (
168
- moduleId: string
169
- ) => {
170
- dynamicallyImportedIds: string[];
171
- hasModuleSideEffects: boolean;
172
- id: string;
173
- importedIds: string[];
174
- isEntry: boolean;
175
- isExternal: boolean;
176
- };
180
+ getModuleIds: () => IterableIterator<string>;
181
+ getModuleInfo: GetModuleInfo;
177
182
  /** @deprecated Use `this.resolve` instead */
178
183
  isExternal: IsExternal;
184
+ /** @deprecated Use `this.getModuleIds` instead */
179
185
  moduleIds: IterableIterator<string>;
180
186
  parse: (input: string, options: any) => AcornNode;
181
187
  resolve: (
@@ -438,8 +444,11 @@ export interface TreeshakingOptions {
438
444
  tryCatchDeoptimization?: boolean;
439
445
  unknownGlobalSideEffects?: boolean;
440
446
  }
441
-
442
- export type GetManualChunk = (id: string) => string | null | undefined;
447
+ interface GetManualChunkApi {
448
+ getModuleIds: () => IterableIterator<string>;
449
+ getModuleInfo: GetModuleInfo;
450
+ }
451
+ export type GetManualChunk = (id: string, api: GetManualChunkApi) => string | null | undefined;
443
452
 
444
453
  export type ExternalOption = (string | RegExp)[] | string | RegExp | IsExternal;
445
454
  export type PureModulesOption = boolean | string[] | IsPureModule;
@@ -625,6 +634,7 @@ export interface ChokidarOptions {
625
634
  }
626
635
 
627
636
  export interface WatcherOptions {
637
+ buildDelay?: number;
628
638
  chokidar?: ChokidarOptions;
629
639
  clearScreen?: boolean;
630
640
  exclude?: string[];
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.8.0
4
- Wed, 06 May 2020 05:15:09 GMT - commit 35b0f782f0de661628e48240cbaed4f0178472f3
3
+ Rollup.js v2.9.1
4
+ Mon, 11 May 2020 05:23:48 GMT - commit 1436473192ef975ee515ede6ab90dbf832cdfab1
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.8.0
4
- Wed, 06 May 2020 05:15:09 GMT - commit 35b0f782f0de661628e48240cbaed4f0178472f3
3
+ Rollup.js v2.9.1
4
+ Mon, 11 May 2020 05:23:48 GMT - commit 1436473192ef975ee515ede6ab90dbf832cdfab1
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.8.0
4
- Wed, 06 May 2020 05:15:09 GMT - commit 35b0f782f0de661628e48240cbaed4f0178472f3
3
+ Rollup.js v2.9.1
4
+ Mon, 11 May 2020 05:23:48 GMT - commit 1436473192ef975ee515ede6ab90dbf832cdfab1
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -417,7 +417,7 @@ function loadAndRegisterPlugin(inputOptions, pluginText) {
417
417
  plugin = new Function('return ' + pluginText);
418
418
  }
419
419
  else {
420
- const match = pluginText.match(/^([@.\/\\\w|^{}|-]+)(=(.*))?$/);
420
+ const match = pluginText.match(/^([@.\/\\\w|^{}-]+)(=(.*))?$/);
421
421
  if (match) {
422
422
  // -p plugin
423
423
  // -p plugin=arg
@@ -451,10 +451,10 @@ function loadAndRegisterPlugin(inputOptions, pluginText) {
451
451
  }
452
452
  }
453
453
  }
454
- if (typeof plugin === 'object' && pluginText in plugin) {
455
- // some plugins do not use `export default` for their entry point.
456
- // attempt to use the plugin name as the named import name.
457
- plugin = plugin[pluginText];
454
+ // some plugins do not use `module.exports` for their entry point,
455
+ // in which case we try the named default export and the plugin name
456
+ if (typeof plugin === 'object') {
457
+ plugin = plugin.default || plugin[pluginText];
458
458
  }
459
459
  inputOptions.plugins.push(typeof plugin === 'function' ? plugin.call(plugin, pluginArg) : plugin);
460
460
  }
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.8.0
4
- Wed, 06 May 2020 05:15:09 GMT - commit 35b0f782f0de661628e48240cbaed4f0178472f3
3
+ Rollup.js v2.9.1
4
+ Mon, 11 May 2020 05:23:48 GMT - commit 1436473192ef975ee515ede6ab90dbf832cdfab1
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup