rollup 2.0.6 → 2.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/rollup.d.ts CHANGED
@@ -134,6 +134,7 @@ export interface EmittedAsset {
134
134
  export interface EmittedChunk {
135
135
  fileName?: string;
136
136
  id: string;
137
+ importer?: string;
137
138
  name?: string;
138
139
  type: 'chunk';
139
140
  }
@@ -175,11 +176,11 @@ export interface PluginContext extends MinimalPluginContext {
175
176
  parse: (input: string, options: any) => AcornNode;
176
177
  resolve: (
177
178
  source: string,
178
- importer: string,
179
+ importer?: string,
179
180
  options?: { skipSelf: boolean }
180
181
  ) => Promise<ResolvedId | null>;
181
182
  /** @deprecated Use `this.resolve` instead */
182
- resolveId: (source: string, importer: string) => Promise<string | null>;
183
+ resolveId: (source: string, importer?: string) => Promise<string | null>;
183
184
  setAssetSource: (assetReferenceId: string, source: string | Uint8Array) => void;
184
185
  warn: (warning: RollupWarning | string, pos?: number | { column: number; line: number }) => void;
185
186
  }
@@ -216,7 +217,7 @@ export type ResolveIdHook = (
216
217
 
217
218
  export type IsExternal = (
218
219
  source: string,
219
- importer: string,
220
+ importer: string | undefined,
220
221
  isResolved: boolean
221
222
  ) => boolean | null | undefined;
222
223
 
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.0.6
4
- Fri, 13 Mar 2020 05:27:52 GMT - commit c0b73e4705a4acf8ae92209b67eacb2b62134fbf
3
+ Rollup.js v2.1.0
4
+ Wed, 18 Mar 2020 05:17:01 GMT - commit f8bc01847155ccf69f9e772ee99fc0905848548f
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.0.6
4
- Fri, 13 Mar 2020 05:27:52 GMT - commit c0b73e4705a4acf8ae92209b67eacb2b62134fbf
3
+ Rollup.js v2.1.0
4
+ Wed, 18 Mar 2020 05:17:01 GMT - commit f8bc01847155ccf69f9e772ee99fc0905848548f
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.0.6
4
- Fri, 13 Mar 2020 05:27:52 GMT - commit c0b73e4705a4acf8ae92209b67eacb2b62134fbf
3
+ Rollup.js v2.1.0
4
+ Wed, 18 Mar 2020 05:17:01 GMT - commit f8bc01847155ccf69f9e772ee99fc0905848548f
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -28,7 +28,7 @@ var fs = require('fs');
28
28
  var crypto = require('crypto');
29
29
  var events = require('events');
30
30
 
31
- var version = "2.0.6";
31
+ var version = "2.1.0";
32
32
 
33
33
  // Reserved word lists for various dialects of the language
34
34
 
@@ -16494,8 +16494,12 @@ function transform(graph, source, module) {
16494
16494
  });
16495
16495
  }
16496
16496
 
16497
- function normalizeRelativeExternalId(importer, source) {
16498
- return isRelative(source) ? path.resolve(importer, '..', source) : source;
16497
+ function normalizeRelativeExternalId(source, importer) {
16498
+ return isRelative(source)
16499
+ ? importer
16500
+ ? path.resolve(importer, '..', source)
16501
+ : path.resolve(source)
16502
+ : source;
16499
16503
  }
16500
16504
  function getIdMatcher(option) {
16501
16505
  if (option === true) {
@@ -16536,7 +16540,7 @@ class ModuleLoader {
16536
16540
  this.latestLoadModulesPromise = Promise.resolve();
16537
16541
  this.manualChunkModules = {};
16538
16542
  this.nextEntryModuleIndex = 0;
16539
- this.loadEntryModule = (unresolvedId, isEntry) => this.pluginDriver.hookFirst('resolveId', [unresolvedId, undefined]).then(resolveIdResult => {
16543
+ this.loadEntryModule = (unresolvedId, isEntry, importer) => this.pluginDriver.hookFirst('resolveId', [unresolvedId, importer]).then(resolveIdResult => {
16540
16544
  if (resolveIdResult === false ||
16541
16545
  (resolveIdResult && typeof resolveIdResult === 'object' && resolveIdResult.external)) {
16542
16546
  return error(errEntryCannotBeExternal(unresolvedId));
@@ -16559,7 +16563,7 @@ class ModuleLoader {
16559
16563
  addEntryModules(unresolvedEntryModules, isUserDefined) {
16560
16564
  const firstEntryModuleIndex = this.nextEntryModuleIndex;
16561
16565
  this.nextEntryModuleIndex += unresolvedEntryModules.length;
16562
- const loadNewEntryModulesPromise = Promise.all(unresolvedEntryModules.map(({ fileName, id, name }) => this.loadEntryModule(id, true).then(module => {
16566
+ const loadNewEntryModulesPromise = Promise.all(unresolvedEntryModules.map(({ fileName, id, name, importer }) => this.loadEntryModule(id, true, importer).then(module => {
16563
16567
  if (fileName !== null) {
16564
16568
  module.chunkFileNames.add(fileName);
16565
16569
  }
@@ -16602,7 +16606,7 @@ class ModuleLoader {
16602
16606
  unresolvedManualChunks.push({ id, alias });
16603
16607
  }
16604
16608
  }
16605
- const loadNewManualChunkModulesPromise = Promise.all(unresolvedManualChunks.map(({ id }) => this.loadEntryModule(id, false))).then(manualChunkModules => {
16609
+ const loadNewManualChunkModulesPromise = Promise.all(unresolvedManualChunks.map(({ id }) => this.loadEntryModule(id, false, undefined))).then(manualChunkModules => {
16606
16610
  for (let index = 0; index < manualChunkModules.length; index++) {
16607
16611
  this.addModuleToManualChunk(unresolvedManualChunks[index].alias, manualChunkModules[index]);
16608
16612
  }
@@ -16793,11 +16797,11 @@ class ModuleLoader {
16793
16797
  if (this.isExternal(resolveIdResult, importer, true)) {
16794
16798
  external = true;
16795
16799
  }
16796
- id = external ? normalizeRelativeExternalId(importer, resolveIdResult) : resolveIdResult;
16800
+ id = external ? normalizeRelativeExternalId(resolveIdResult, importer) : resolveIdResult;
16797
16801
  }
16798
16802
  }
16799
16803
  else {
16800
- id = normalizeRelativeExternalId(importer, source);
16804
+ id = normalizeRelativeExternalId(source, importer);
16801
16805
  if (resolveIdResult !== false && !this.isExternal(id, importer, true)) {
16802
16806
  return null;
16803
16807
  }
@@ -17147,6 +17151,7 @@ class FileEmitter {
17147
17151
  {
17148
17152
  fileName: emittedChunk.fileName || null,
17149
17153
  id: emittedChunk.id,
17154
+ importer: emittedChunk.importer,
17150
17155
  name: emittedChunk.name || null
17151
17156
  }
17152
17157
  ], false)
@@ -17469,14 +17474,15 @@ class PluginDriver {
17469
17474
 
17470
17475
  function normalizeEntryModules(entryModules) {
17471
17476
  if (typeof entryModules === 'string') {
17472
- return [{ fileName: null, name: null, id: entryModules }];
17477
+ return [{ fileName: null, name: null, id: entryModules, importer: undefined }];
17473
17478
  }
17474
17479
  if (Array.isArray(entryModules)) {
17475
- return entryModules.map(id => ({ fileName: null, name: null, id }));
17480
+ return entryModules.map(id => ({ fileName: null, name: null, id, importer: undefined }));
17476
17481
  }
17477
17482
  return Object.keys(entryModules).map(name => ({
17478
17483
  fileName: null,
17479
17484
  id: entryModules[name],
17485
+ importer: undefined,
17480
17486
  name
17481
17487
  }));
17482
17488
  }
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.0.6
4
- Fri, 13 Mar 2020 05:27:52 GMT - commit c0b73e4705a4acf8ae92209b67eacb2b62134fbf
3
+ Rollup.js v2.1.0
4
+ Wed, 18 Mar 2020 05:17:01 GMT - commit f8bc01847155ccf69f9e772ee99fc0905848548f
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rollup",
3
- "version": "2.0.6",
3
+ "version": "2.1.0",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -70,7 +70,7 @@
70
70
  "@rollup/plugin-node-resolve": "^7.1.1",
71
71
  "@rollup/plugin-replace": "^2.3.1",
72
72
  "@types/micromatch": "^4.0.1",
73
- "@types/node": "^13.9.0",
73
+ "@types/node": "^13.9.1",
74
74
  "@types/yargs-parser": "^15.0.0",
75
75
  "acorn": "^7.1.1",
76
76
  "acorn-export-ns-from": "^0.1.0",
@@ -107,10 +107,10 @@
107
107
  "pretty-ms": "^6.0.1",
108
108
  "require-relative": "^0.8.7",
109
109
  "requirejs": "^2.3.6",
110
- "rollup": "^2.0.0",
110
+ "rollup": "^2.0.6",
111
111
  "rollup-plugin-license": "^0.13.0",
112
112
  "rollup-plugin-string": "^3.0.0",
113
- "rollup-plugin-terser": "^5.2.0",
113
+ "rollup-plugin-terser": "^5.3.0",
114
114
  "rollup-plugin-typescript": "^1.0.1",
115
115
  "rollup-pluginutils": "^2.8.2",
116
116
  "sander": "^0.6.0",
@@ -119,13 +119,13 @@
119
119
  "source-map": "^0.7.3",
120
120
  "source-map-support": "^0.5.16",
121
121
  "sourcemap-codec": "^1.4.8",
122
- "systemjs": "^6.2.5",
123
- "terser": "^4.6.6",
122
+ "systemjs": "^6.2.6",
123
+ "terser": "^4.6.7",
124
124
  "tslib": "^1.11.1",
125
- "tslint": "^6.0.0",
125
+ "tslint": "^6.1.0",
126
126
  "typescript": "^3.8.3",
127
127
  "url-parse": "^1.4.7",
128
- "yargs-parser": "^16.1.0"
128
+ "yargs-parser": "^18.1.1"
129
129
  },
130
130
  "files": [
131
131
  "dist/**/*.js",