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/CHANGELOG.md +9 -0
- package/LICENSE.md +1 -1
- package/dist/bin/rollup +200 -152
- package/dist/es/rollup.browser.js +3 -3
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/rollup.js +18 -12
- package/dist/es/shared/watch.js +2 -2
- package/dist/rollup.browser.js +3 -3
- package/dist/rollup.d.ts +4 -3
- package/dist/rollup.js +2 -2
- package/dist/shared/_events_commonjs-external.js +2 -2
- package/dist/shared/rollup.js +18 -12
- package/dist/shared/watch.js +2 -2
- package/package.json +8 -8
package/dist/es/rollup.js
CHANGED
package/dist/es/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.0
|
|
4
|
-
|
|
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
|
|
@@ -13,7 +13,7 @@ import { writeFile as writeFile$1, readdirSync, mkdirSync, readFile as readFile$
|
|
|
13
13
|
import { createHash as createHash$1 } from 'crypto';
|
|
14
14
|
import { EventEmitter } from 'events';
|
|
15
15
|
|
|
16
|
-
var version = "2.0
|
|
16
|
+
var version = "2.1.0";
|
|
17
17
|
|
|
18
18
|
// Reserved word lists for various dialects of the language
|
|
19
19
|
|
|
@@ -16475,8 +16475,12 @@ function transform(graph, source, module) {
|
|
|
16475
16475
|
});
|
|
16476
16476
|
}
|
|
16477
16477
|
|
|
16478
|
-
function normalizeRelativeExternalId(
|
|
16479
|
-
return isRelative(source)
|
|
16478
|
+
function normalizeRelativeExternalId(source, importer) {
|
|
16479
|
+
return isRelative(source)
|
|
16480
|
+
? importer
|
|
16481
|
+
? resolve(importer, '..', source)
|
|
16482
|
+
: resolve(source)
|
|
16483
|
+
: source;
|
|
16480
16484
|
}
|
|
16481
16485
|
function getIdMatcher(option) {
|
|
16482
16486
|
if (option === true) {
|
|
@@ -16517,7 +16521,7 @@ class ModuleLoader {
|
|
|
16517
16521
|
this.latestLoadModulesPromise = Promise.resolve();
|
|
16518
16522
|
this.manualChunkModules = {};
|
|
16519
16523
|
this.nextEntryModuleIndex = 0;
|
|
16520
|
-
this.loadEntryModule = (unresolvedId, isEntry) => this.pluginDriver.hookFirst('resolveId', [unresolvedId,
|
|
16524
|
+
this.loadEntryModule = (unresolvedId, isEntry, importer) => this.pluginDriver.hookFirst('resolveId', [unresolvedId, importer]).then(resolveIdResult => {
|
|
16521
16525
|
if (resolveIdResult === false ||
|
|
16522
16526
|
(resolveIdResult && typeof resolveIdResult === 'object' && resolveIdResult.external)) {
|
|
16523
16527
|
return error(errEntryCannotBeExternal(unresolvedId));
|
|
@@ -16540,7 +16544,7 @@ class ModuleLoader {
|
|
|
16540
16544
|
addEntryModules(unresolvedEntryModules, isUserDefined) {
|
|
16541
16545
|
const firstEntryModuleIndex = this.nextEntryModuleIndex;
|
|
16542
16546
|
this.nextEntryModuleIndex += unresolvedEntryModules.length;
|
|
16543
|
-
const loadNewEntryModulesPromise = Promise.all(unresolvedEntryModules.map(({ fileName, id, name }) => this.loadEntryModule(id, true).then(module => {
|
|
16547
|
+
const loadNewEntryModulesPromise = Promise.all(unresolvedEntryModules.map(({ fileName, id, name, importer }) => this.loadEntryModule(id, true, importer).then(module => {
|
|
16544
16548
|
if (fileName !== null) {
|
|
16545
16549
|
module.chunkFileNames.add(fileName);
|
|
16546
16550
|
}
|
|
@@ -16583,7 +16587,7 @@ class ModuleLoader {
|
|
|
16583
16587
|
unresolvedManualChunks.push({ id, alias });
|
|
16584
16588
|
}
|
|
16585
16589
|
}
|
|
16586
|
-
const loadNewManualChunkModulesPromise = Promise.all(unresolvedManualChunks.map(({ id }) => this.loadEntryModule(id, false))).then(manualChunkModules => {
|
|
16590
|
+
const loadNewManualChunkModulesPromise = Promise.all(unresolvedManualChunks.map(({ id }) => this.loadEntryModule(id, false, undefined))).then(manualChunkModules => {
|
|
16587
16591
|
for (let index = 0; index < manualChunkModules.length; index++) {
|
|
16588
16592
|
this.addModuleToManualChunk(unresolvedManualChunks[index].alias, manualChunkModules[index]);
|
|
16589
16593
|
}
|
|
@@ -16774,11 +16778,11 @@ class ModuleLoader {
|
|
|
16774
16778
|
if (this.isExternal(resolveIdResult, importer, true)) {
|
|
16775
16779
|
external = true;
|
|
16776
16780
|
}
|
|
16777
|
-
id = external ? normalizeRelativeExternalId(
|
|
16781
|
+
id = external ? normalizeRelativeExternalId(resolveIdResult, importer) : resolveIdResult;
|
|
16778
16782
|
}
|
|
16779
16783
|
}
|
|
16780
16784
|
else {
|
|
16781
|
-
id = normalizeRelativeExternalId(
|
|
16785
|
+
id = normalizeRelativeExternalId(source, importer);
|
|
16782
16786
|
if (resolveIdResult !== false && !this.isExternal(id, importer, true)) {
|
|
16783
16787
|
return null;
|
|
16784
16788
|
}
|
|
@@ -17128,6 +17132,7 @@ class FileEmitter {
|
|
|
17128
17132
|
{
|
|
17129
17133
|
fileName: emittedChunk.fileName || null,
|
|
17130
17134
|
id: emittedChunk.id,
|
|
17135
|
+
importer: emittedChunk.importer,
|
|
17131
17136
|
name: emittedChunk.name || null
|
|
17132
17137
|
}
|
|
17133
17138
|
], false)
|
|
@@ -17450,14 +17455,15 @@ class PluginDriver {
|
|
|
17450
17455
|
|
|
17451
17456
|
function normalizeEntryModules(entryModules) {
|
|
17452
17457
|
if (typeof entryModules === 'string') {
|
|
17453
|
-
return [{ fileName: null, name: null, id: entryModules }];
|
|
17458
|
+
return [{ fileName: null, name: null, id: entryModules, importer: undefined }];
|
|
17454
17459
|
}
|
|
17455
17460
|
if (Array.isArray(entryModules)) {
|
|
17456
|
-
return entryModules.map(id => ({ fileName: null, name: null, id }));
|
|
17461
|
+
return entryModules.map(id => ({ fileName: null, name: null, id, importer: undefined }));
|
|
17457
17462
|
}
|
|
17458
17463
|
return Object.keys(entryModules).map(name => ({
|
|
17459
17464
|
fileName: null,
|
|
17460
17465
|
id: entryModules[name],
|
|
17466
|
+
importer: undefined,
|
|
17461
17467
|
name
|
|
17462
17468
|
}));
|
|
17463
17469
|
}
|
package/dist/es/shared/watch.js
CHANGED