rollup 1.16.4 → 1.17.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 +42 -1
- package/bin/rollup +11 -12
- package/dist/rollup.browser.es.js +3 -3
- package/dist/rollup.browser.js +3 -3
- package/dist/rollup.d.ts +31 -8
- package/dist/rollup.es.js +141 -101
- package/dist/rollup.js +141 -101
- package/package.json +16 -15
package/dist/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v1.
|
|
4
|
-
|
|
3
|
+
Rollup.js v1.17.0
|
|
4
|
+
Mon, 15 Jul 2019 04:31:04 GMT - commit 5d1541a577b06d9004a3533bde672761e5798482
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
@@ -23,7 +23,7 @@ var acorn__default = _interopDefault(acorn);
|
|
|
23
23
|
var events = require('events');
|
|
24
24
|
var module$1 = _interopDefault(require('module'));
|
|
25
25
|
|
|
26
|
-
var version = "1.
|
|
26
|
+
var version = "1.17.0";
|
|
27
27
|
|
|
28
28
|
var minimalisticAssert = assert;
|
|
29
29
|
function assert(val, msg) {
|
|
@@ -590,13 +590,13 @@ function decode(mappings) {
|
|
|
590
590
|
var c = mappings.charCodeAt(i);
|
|
591
591
|
if (c === 44) { // ","
|
|
592
592
|
if (segment.length)
|
|
593
|
-
line.push(
|
|
593
|
+
line.push(segment);
|
|
594
594
|
segment = [];
|
|
595
595
|
j = 0;
|
|
596
596
|
}
|
|
597
597
|
else if (c === 59) { // ";"
|
|
598
598
|
if (segment.length)
|
|
599
|
-
line.push(
|
|
599
|
+
line.push(segment);
|
|
600
600
|
segment = [];
|
|
601
601
|
j = 0;
|
|
602
602
|
decoded.push(line);
|
|
@@ -616,26 +616,30 @@ function decode(mappings) {
|
|
|
616
616
|
}
|
|
617
617
|
else {
|
|
618
618
|
var shouldNegate = value & 1;
|
|
619
|
-
value
|
|
620
|
-
|
|
619
|
+
value >>>= 1;
|
|
620
|
+
if (shouldNegate) {
|
|
621
|
+
value = -value;
|
|
622
|
+
if (value === 0)
|
|
623
|
+
value = -0x80000000;
|
|
624
|
+
}
|
|
621
625
|
if (j == 0) {
|
|
622
|
-
generatedCodeColumn +=
|
|
626
|
+
generatedCodeColumn += value;
|
|
623
627
|
segment.push(generatedCodeColumn);
|
|
624
628
|
}
|
|
625
629
|
else if (j === 1) {
|
|
626
|
-
sourceFileIndex +=
|
|
630
|
+
sourceFileIndex += value;
|
|
627
631
|
segment.push(sourceFileIndex);
|
|
628
632
|
}
|
|
629
633
|
else if (j === 2) {
|
|
630
|
-
sourceCodeLine +=
|
|
634
|
+
sourceCodeLine += value;
|
|
631
635
|
segment.push(sourceCodeLine);
|
|
632
636
|
}
|
|
633
637
|
else if (j === 3) {
|
|
634
|
-
sourceCodeColumn +=
|
|
638
|
+
sourceCodeColumn += value;
|
|
635
639
|
segment.push(sourceCodeColumn);
|
|
636
640
|
}
|
|
637
641
|
else if (j === 4) {
|
|
638
|
-
nameIndex +=
|
|
642
|
+
nameIndex += value;
|
|
639
643
|
segment.push(nameIndex);
|
|
640
644
|
}
|
|
641
645
|
j++;
|
|
@@ -644,7 +648,7 @@ function decode(mappings) {
|
|
|
644
648
|
}
|
|
645
649
|
}
|
|
646
650
|
if (segment.length)
|
|
647
|
-
line.push(
|
|
651
|
+
line.push(segment);
|
|
648
652
|
decoded.push(line);
|
|
649
653
|
return decoded;
|
|
650
654
|
}
|
|
@@ -690,7 +694,7 @@ function encodeInteger(num) {
|
|
|
690
694
|
num = num < 0 ? (-num << 1) | 1 : num << 1;
|
|
691
695
|
do {
|
|
692
696
|
var clamped = num & 31;
|
|
693
|
-
num
|
|
697
|
+
num >>>= 5;
|
|
694
698
|
if (num > 0) {
|
|
695
699
|
clamped |= 32;
|
|
696
700
|
}
|
|
@@ -8283,6 +8287,8 @@ function isReference(node, parent) {
|
|
|
8283
8287
|
return !node.computed && isReference(node.object, node);
|
|
8284
8288
|
}
|
|
8285
8289
|
if (node.type === 'Identifier') {
|
|
8290
|
+
if (!parent)
|
|
8291
|
+
return true;
|
|
8286
8292
|
switch (parent.type) {
|
|
8287
8293
|
// disregard `bar` in `foo.bar`
|
|
8288
8294
|
case 'MemberExpression': return parent.computed || node === parent.object;
|
|
@@ -11674,7 +11680,7 @@ class MetaProperty extends NodeBase {
|
|
|
11674
11680
|
}
|
|
11675
11681
|
]);
|
|
11676
11682
|
}
|
|
11677
|
-
code.overwrite(parent.start, parent.end, replacement);
|
|
11683
|
+
code.overwrite(parent.start, parent.end, replacement, { contentOnly: true });
|
|
11678
11684
|
return;
|
|
11679
11685
|
}
|
|
11680
11686
|
const replacement = pluginDriver.hookFirstSync('resolveImportMeta', [
|
|
@@ -11687,10 +11693,10 @@ class MetaProperty extends NodeBase {
|
|
|
11687
11693
|
]);
|
|
11688
11694
|
if (typeof replacement === 'string') {
|
|
11689
11695
|
if (parent instanceof MemberExpression) {
|
|
11690
|
-
code.overwrite(parent.start, parent.end, replacement);
|
|
11696
|
+
code.overwrite(parent.start, parent.end, replacement, { contentOnly: true });
|
|
11691
11697
|
}
|
|
11692
11698
|
else {
|
|
11693
|
-
code.overwrite(this.start, this.end, replacement);
|
|
11699
|
+
code.overwrite(this.start, this.end, replacement, { contentOnly: true });
|
|
11694
11700
|
}
|
|
11695
11701
|
}
|
|
11696
11702
|
}
|
|
@@ -12795,6 +12801,7 @@ const nodeConstructors = {
|
|
|
12795
12801
|
};
|
|
12796
12802
|
|
|
12797
12803
|
function getOriginalLocation(sourcemapChain, location) {
|
|
12804
|
+
// This cast is guaranteed. If it were a missing Map, it wouldn't have a mappings.
|
|
12798
12805
|
const filteredSourcemapChain = sourcemapChain.filter(sourcemap => sourcemap.mappings);
|
|
12799
12806
|
while (filteredSourcemapChain.length > 0) {
|
|
12800
12807
|
const sourcemap = filteredSourcemapChain.pop();
|
|
@@ -12803,12 +12810,12 @@ function getOriginalLocation(sourcemapChain, location) {
|
|
|
12803
12810
|
if (line !== undefined) {
|
|
12804
12811
|
for (const segment of line) {
|
|
12805
12812
|
if (segment[0] >= location.column) {
|
|
12806
|
-
if (segment.length
|
|
12813
|
+
if (segment.length === 1)
|
|
12807
12814
|
break;
|
|
12808
12815
|
location = {
|
|
12809
12816
|
column: segment[3],
|
|
12810
12817
|
line: segment[2] + 1,
|
|
12811
|
-
name: sourcemap.names[segment[4]],
|
|
12818
|
+
name: segment.length === 5 ? sourcemap.names[segment[4]] : undefined,
|
|
12812
12819
|
source: sourcemap.sources[segment[1]]
|
|
12813
12820
|
};
|
|
12814
12821
|
locationFound = true;
|
|
@@ -12857,13 +12864,13 @@ base$1.WithStatement = function (node, st, c) {
|
|
|
12857
12864
|
};
|
|
12858
12865
|
base$1.SwitchStatement = function (node, st, c) {
|
|
12859
12866
|
c(node.discriminant, st, "Expression");
|
|
12860
|
-
for (var i = 0, list = node.cases; i < list.length; i += 1) {
|
|
12861
|
-
var cs = list[i];
|
|
12867
|
+
for (var i$1 = 0, list$1 = node.cases; i$1 < list$1.length; i$1 += 1) {
|
|
12868
|
+
var cs = list$1[i$1];
|
|
12862
12869
|
|
|
12863
12870
|
if (cs.test) { c(cs.test, st, "Expression"); }
|
|
12864
|
-
for (var i
|
|
12871
|
+
for (var i = 0, list = cs.consequent; i < list.length; i += 1)
|
|
12865
12872
|
{
|
|
12866
|
-
var cons = list
|
|
12873
|
+
var cons = list[i];
|
|
12867
12874
|
|
|
12868
12875
|
c(cons, st, "Statement");
|
|
12869
12876
|
}
|
|
@@ -13058,7 +13065,7 @@ base$1.ImportDeclaration = function (node, st, c) {
|
|
|
13058
13065
|
}
|
|
13059
13066
|
c(node.source, st, "Expression");
|
|
13060
13067
|
};
|
|
13061
|
-
base$1.ImportSpecifier = base$1.ImportDefaultSpecifier = base$1.ImportNamespaceSpecifier = base$1.Identifier = base$1.Literal = ignore;
|
|
13068
|
+
base$1.ImportSpecifier = base$1.ImportDefaultSpecifier = base$1.ImportNamespaceSpecifier = base$1.Identifier = base$1.Literal = base$1.Import = ignore;
|
|
13062
13069
|
|
|
13063
13070
|
base$1.TaggedTemplateExpression = function (node, st, c) {
|
|
13064
13071
|
c(node.tag, st, "Expression");
|
|
@@ -13365,20 +13372,15 @@ class Module {
|
|
|
13365
13372
|
getDynamicImportExpressions() {
|
|
13366
13373
|
return this.dynamicImports.map(({ node }) => {
|
|
13367
13374
|
const importArgument = node.parent.arguments[0];
|
|
13368
|
-
if (importArgument instanceof TemplateLiteral
|
|
13369
|
-
|
|
13370
|
-
|
|
13371
|
-
|
|
13375
|
+
if (importArgument instanceof TemplateLiteral &&
|
|
13376
|
+
importArgument.quasis.length === 1 &&
|
|
13377
|
+
importArgument.quasis[0].value.cooked) {
|
|
13378
|
+
return importArgument.quasis[0].value.cooked;
|
|
13372
13379
|
}
|
|
13373
|
-
|
|
13374
|
-
|
|
13375
|
-
return importArgument.value;
|
|
13376
|
-
}
|
|
13380
|
+
if (importArgument instanceof Literal && typeof importArgument.value === 'string') {
|
|
13381
|
+
return importArgument.value;
|
|
13377
13382
|
}
|
|
13378
|
-
|
|
13379
|
-
return importArgument;
|
|
13380
|
-
}
|
|
13381
|
-
return undefined;
|
|
13383
|
+
return importArgument;
|
|
13382
13384
|
});
|
|
13383
13385
|
}
|
|
13384
13386
|
getExportNamesByVariable() {
|
|
@@ -13841,10 +13843,12 @@ class Link {
|
|
|
13841
13843
|
for (const line of this.mappings) {
|
|
13842
13844
|
const tracedLine = [];
|
|
13843
13845
|
for (const segment of line) {
|
|
13846
|
+
if (segment.length == 1)
|
|
13847
|
+
continue;
|
|
13844
13848
|
const source = this.sources[segment[1]];
|
|
13845
13849
|
if (!source)
|
|
13846
13850
|
continue;
|
|
13847
|
-
const traced = source.traceSegment(segment[2], segment[3], this.names[segment[4]]);
|
|
13851
|
+
const traced = source.traceSegment(segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : '');
|
|
13848
13852
|
if (traced) {
|
|
13849
13853
|
// newer sources are more likely to be used, so search backwards.
|
|
13850
13854
|
let sourceIndex = sources.lastIndexOf(traced.source.filename);
|
|
@@ -13894,10 +13898,12 @@ class Link {
|
|
|
13894
13898
|
const m = (i + j) >> 1;
|
|
13895
13899
|
const segment = segments[m];
|
|
13896
13900
|
if (segment[0] === column) {
|
|
13901
|
+
if (segment.length == 1)
|
|
13902
|
+
return null;
|
|
13897
13903
|
const source = this.sources[segment[1]];
|
|
13898
13904
|
if (!source)
|
|
13899
13905
|
return null;
|
|
13900
|
-
return source.traceSegment(segment[2], segment[3], this.names[segment[4]]
|
|
13906
|
+
return source.traceSegment(segment[2], segment[3], segment.length === 5 ? this.names[segment[4]] : name);
|
|
13901
13907
|
}
|
|
13902
13908
|
if (segment[0] > column) {
|
|
13903
13909
|
j = m - 1;
|
|
@@ -13909,50 +13915,46 @@ class Link {
|
|
|
13909
13915
|
return null;
|
|
13910
13916
|
}
|
|
13911
13917
|
}
|
|
13912
|
-
|
|
13913
|
-
function
|
|
13914
|
-
|
|
13915
|
-
|
|
13916
|
-
bundle.graph.warn({
|
|
13917
|
-
code: 'SOURCEMAP_BROKEN',
|
|
13918
|
-
message: `Sourcemap is likely to be incorrect: a plugin${map.plugin ? ` ('${map.plugin}')` : ``} was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help`,
|
|
13919
|
-
plugin: map.plugin,
|
|
13920
|
-
url: `https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect`
|
|
13921
|
-
});
|
|
13922
|
-
map = {
|
|
13923
|
-
mappings: '',
|
|
13924
|
-
names: []
|
|
13925
|
-
};
|
|
13918
|
+
function getLinkMap(graph) {
|
|
13919
|
+
return function linkMap(source, map) {
|
|
13920
|
+
if (map.mappings) {
|
|
13921
|
+
return new Link(map, [source]);
|
|
13926
13922
|
}
|
|
13927
|
-
|
|
13923
|
+
graph.warn({
|
|
13924
|
+
code: 'SOURCEMAP_BROKEN',
|
|
13925
|
+
message: `Sourcemap is likely to be incorrect: a plugin${map.plugin ? ` ('${map.plugin}')` : ``} was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help`,
|
|
13926
|
+
plugin: map.plugin,
|
|
13927
|
+
url: `https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect`
|
|
13928
|
+
});
|
|
13929
|
+
return new Link({
|
|
13930
|
+
mappings: [],
|
|
13931
|
+
names: []
|
|
13932
|
+
}, [source]);
|
|
13933
|
+
};
|
|
13934
|
+
}
|
|
13935
|
+
function getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapChain, linkMap) {
|
|
13936
|
+
let source;
|
|
13937
|
+
if (!originalSourcemap) {
|
|
13938
|
+
source = new Source(id, originalCode);
|
|
13928
13939
|
}
|
|
13940
|
+
else {
|
|
13941
|
+
const sources = originalSourcemap.sources;
|
|
13942
|
+
const sourcesContent = originalSourcemap.sourcesContent || [];
|
|
13943
|
+
// TODO indiscriminately treating IDs and sources as normal paths is probably bad.
|
|
13944
|
+
const directory = path.dirname(id) || '.';
|
|
13945
|
+
const sourceRoot = originalSourcemap.sourceRoot || '.';
|
|
13946
|
+
const baseSources = sources.map((source, i) => new Source(path.resolve(directory, sourceRoot, source), sourcesContent[i]));
|
|
13947
|
+
source = new Link(originalSourcemap, baseSources);
|
|
13948
|
+
}
|
|
13949
|
+
return sourcemapChain.reduce(linkMap, source);
|
|
13950
|
+
}
|
|
13951
|
+
function collapseSourcemaps(bundle, file, map, modules, bundleSourcemapChain, excludeContent) {
|
|
13952
|
+
const linkMap = getLinkMap(bundle.graph);
|
|
13929
13953
|
const moduleSources = modules
|
|
13930
13954
|
.filter(module => !module.excludeFromSourcemap)
|
|
13931
|
-
.map(module =>
|
|
13932
|
-
|
|
13933
|
-
|
|
13934
|
-
const originalSourcemap = module.originalSourcemap;
|
|
13935
|
-
if (!originalSourcemap) {
|
|
13936
|
-
source = new Source(module.id, module.originalCode);
|
|
13937
|
-
}
|
|
13938
|
-
else {
|
|
13939
|
-
const sources = originalSourcemap.sources;
|
|
13940
|
-
const sourcesContent = originalSourcemap.sourcesContent || [];
|
|
13941
|
-
if (sources == null || (sources.length <= 1 && sources[0] == null)) {
|
|
13942
|
-
source = new Source(module.id, sourcesContent[0]);
|
|
13943
|
-
sourcemapChain = [originalSourcemap].concat(sourcemapChain);
|
|
13944
|
-
}
|
|
13945
|
-
else {
|
|
13946
|
-
// TODO indiscriminately treating IDs and sources as normal paths is probably bad.
|
|
13947
|
-
const directory = path.dirname(module.id) || '.';
|
|
13948
|
-
const sourceRoot = originalSourcemap.sourceRoot || '.';
|
|
13949
|
-
const baseSources = sources.map((source, i) => new Source(path.resolve(directory, sourceRoot, source), sourcesContent[i]));
|
|
13950
|
-
source = new Link(originalSourcemap, baseSources);
|
|
13951
|
-
}
|
|
13952
|
-
}
|
|
13953
|
-
source = sourcemapChain.reduce(linkMap, source);
|
|
13954
|
-
return source;
|
|
13955
|
-
});
|
|
13955
|
+
.map(module => getCollapsedSourcemap(module.id, module.originalCode, module.originalSourcemap, module.sourcemapChain, linkMap));
|
|
13956
|
+
// DecodedSourceMap (from magic-string) uses a number[] instead of the more
|
|
13957
|
+
// correct SourceMapSegment tuples. Cast it here to gain type safety.
|
|
13956
13958
|
let source = new Link(map, moduleSources);
|
|
13957
13959
|
source = bundleSourcemapChain.reduce(linkMap, source);
|
|
13958
13960
|
let { sources, sourcesContent, names, mappings } = source.traceMappings();
|
|
@@ -13964,6 +13966,14 @@ function collapseSourcemaps(bundle, file, map, modules, bundleSourcemapChain, ex
|
|
|
13964
13966
|
sourcesContent = (excludeContent ? null : sourcesContent);
|
|
13965
13967
|
return new SourceMap({ file, sources, sourcesContent, names, mappings });
|
|
13966
13968
|
}
|
|
13969
|
+
function collapseSourcemap(graph, id, originalCode, originalSourcemap, sourcemapChain) {
|
|
13970
|
+
if (!sourcemapChain.length) {
|
|
13971
|
+
return originalSourcemap;
|
|
13972
|
+
}
|
|
13973
|
+
const source = getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapChain, getLinkMap(graph));
|
|
13974
|
+
const map = source.traceMappings();
|
|
13975
|
+
return Object.assign({ version: 3 }, map);
|
|
13976
|
+
}
|
|
13967
13977
|
|
|
13968
13978
|
const DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT = {
|
|
13969
13979
|
amd: deconflictImportsOther,
|
|
@@ -14160,6 +14170,30 @@ function getIndentString(modules, options) {
|
|
|
14160
14170
|
return '\t';
|
|
14161
14171
|
}
|
|
14162
14172
|
|
|
14173
|
+
function decodedSourcemap(map) {
|
|
14174
|
+
if (!map)
|
|
14175
|
+
return null;
|
|
14176
|
+
if (typeof map === 'string') {
|
|
14177
|
+
map = JSON.parse(map);
|
|
14178
|
+
}
|
|
14179
|
+
if (map.mappings === '') {
|
|
14180
|
+
return {
|
|
14181
|
+
mappings: [],
|
|
14182
|
+
names: [],
|
|
14183
|
+
sources: [],
|
|
14184
|
+
version: 3
|
|
14185
|
+
};
|
|
14186
|
+
}
|
|
14187
|
+
let mappings;
|
|
14188
|
+
if (typeof map.mappings === 'string') {
|
|
14189
|
+
mappings = decode(map.mappings);
|
|
14190
|
+
}
|
|
14191
|
+
else {
|
|
14192
|
+
mappings = map.mappings;
|
|
14193
|
+
}
|
|
14194
|
+
return Object.assign({}, map, { mappings });
|
|
14195
|
+
}
|
|
14196
|
+
|
|
14163
14197
|
function renderChunk({ graph, chunk, renderChunk, code, sourcemapChain, options }) {
|
|
14164
14198
|
const renderChunkReducer = (code, result, plugin) => {
|
|
14165
14199
|
if (result == null)
|
|
@@ -14169,12 +14203,11 @@ function renderChunk({ graph, chunk, renderChunk, code, sourcemapChain, options
|
|
|
14169
14203
|
code: result,
|
|
14170
14204
|
map: undefined
|
|
14171
14205
|
};
|
|
14172
|
-
const map = typeof result.map === 'string' ? JSON.parse(result.map) : result.map;
|
|
14173
|
-
if (map && typeof map.mappings === 'string')
|
|
14174
|
-
map.mappings = decode(map.mappings);
|
|
14175
14206
|
// strict null check allows 'null' maps to not be pushed to the chain, while 'undefined' gets the missing map warning
|
|
14176
|
-
if (map !== null)
|
|
14207
|
+
if (result.map !== null) {
|
|
14208
|
+
const map = decodedSourcemap(result.map);
|
|
14177
14209
|
sourcemapChain.push(map || { missing: true, plugin: plugin.name });
|
|
14210
|
+
}
|
|
14178
14211
|
return result.code;
|
|
14179
14212
|
};
|
|
14180
14213
|
let inTransformBundle = false;
|
|
@@ -15969,9 +16002,7 @@ const uncacheablePlugin = pluginName => ({
|
|
|
15969
16002
|
function transform(graph, source, module) {
|
|
15970
16003
|
const id = module.id;
|
|
15971
16004
|
const sourcemapChain = [];
|
|
15972
|
-
|
|
15973
|
-
if (originalSourcemap && typeof originalSourcemap.mappings === 'string')
|
|
15974
|
-
originalSourcemap.mappings = decode(originalSourcemap.mappings);
|
|
16005
|
+
let originalSourcemap = source.map === null ? null : decodedSourcemap(source.map);
|
|
15975
16006
|
const baseEmitAsset = graph.pluginDriver.emitAsset;
|
|
15976
16007
|
const originalCode = source.code;
|
|
15977
16008
|
let ast = source.ast;
|
|
@@ -16031,12 +16062,10 @@ function transform(graph, source, module) {
|
|
|
16031
16062
|
else {
|
|
16032
16063
|
return code;
|
|
16033
16064
|
}
|
|
16034
|
-
if (result.map && typeof result.map.mappings === 'string') {
|
|
16035
|
-
result.map.mappings = decode(result.map.mappings);
|
|
16036
|
-
}
|
|
16037
16065
|
// strict null check allows 'null' maps to not be pushed to the chain, while 'undefined' gets the missing map warning
|
|
16038
16066
|
if (result.map !== null) {
|
|
16039
|
-
|
|
16067
|
+
const map = decodedSourcemap(result.map);
|
|
16068
|
+
sourcemapChain.push(map || { missing: true, plugin: plugin.name });
|
|
16040
16069
|
}
|
|
16041
16070
|
ast = result.ast;
|
|
16042
16071
|
return result.code;
|
|
@@ -16093,6 +16122,18 @@ function transform(graph, source, module) {
|
|
|
16093
16122
|
setAssetSourceErr = err;
|
|
16094
16123
|
}
|
|
16095
16124
|
}
|
|
16125
|
+
},
|
|
16126
|
+
getCombinedSourcemap() {
|
|
16127
|
+
const combinedMap = collapseSourcemap(graph, id, originalCode, originalSourcemap, sourcemapChain);
|
|
16128
|
+
if (!combinedMap) {
|
|
16129
|
+
const magicString = new MagicString(originalCode);
|
|
16130
|
+
return magicString.generateMap({ includeContent: true, hires: true, source: id });
|
|
16131
|
+
}
|
|
16132
|
+
if (originalSourcemap !== combinedMap) {
|
|
16133
|
+
originalSourcemap = combinedMap;
|
|
16134
|
+
sourcemapChain.length = 0;
|
|
16135
|
+
}
|
|
16136
|
+
return new SourceMap(Object.assign({}, combinedMap, { file: null, sourcesContent: combinedMap.sourcesContent }));
|
|
16096
16137
|
} });
|
|
16097
16138
|
})
|
|
16098
16139
|
.catch(err => {
|
|
@@ -17059,11 +17100,9 @@ const defaultOnWarn = warning => {
|
|
|
17059
17100
|
console.warn(warning.message);
|
|
17060
17101
|
}
|
|
17061
17102
|
};
|
|
17062
|
-
const getOnWarn = (config,
|
|
17063
|
-
?
|
|
17064
|
-
:
|
|
17065
|
-
? warning => config.onwarn(warning, defaultOnWarnHandler)
|
|
17066
|
-
: defaultOnWarnHandler;
|
|
17103
|
+
const getOnWarn = (config, defaultOnWarnHandler = defaultOnWarn) => config.onwarn
|
|
17104
|
+
? warning => config.onwarn(warning, defaultOnWarnHandler)
|
|
17105
|
+
: defaultOnWarnHandler;
|
|
17067
17106
|
const getExternal = (config, command) => {
|
|
17068
17107
|
const configExternal = config.external;
|
|
17069
17108
|
return typeof configExternal === 'function'
|
|
@@ -17148,7 +17187,7 @@ function getInputOptions(config, command = { external: [], globals: undefined },
|
|
|
17148
17187
|
input: getOption('input', []),
|
|
17149
17188
|
manualChunks: getOption('manualChunks'),
|
|
17150
17189
|
moduleContext: config.moduleContext,
|
|
17151
|
-
onwarn: getOnWarn(config,
|
|
17190
|
+
onwarn: getOnWarn(config, defaultOnWarnHandler),
|
|
17152
17191
|
perf: getOption('perf', false),
|
|
17153
17192
|
plugins: config.plugins,
|
|
17154
17193
|
preserveModules: getOption('preserveModules'),
|
|
@@ -20887,25 +20926,26 @@ class Task {
|
|
|
20887
20926
|
.then(result => {
|
|
20888
20927
|
if (this.closed)
|
|
20889
20928
|
return undefined;
|
|
20929
|
+
const previouslyWatched = this.watched;
|
|
20890
20930
|
const watched = (this.watched = new Set());
|
|
20891
20931
|
this.cache = result.cache;
|
|
20892
20932
|
this.watchFiles = result.watchFiles;
|
|
20893
|
-
this.cache.modules
|
|
20933
|
+
for (const module of this.cache.modules) {
|
|
20894
20934
|
if (module.transformDependencies) {
|
|
20895
20935
|
module.transformDependencies.forEach(depId => {
|
|
20896
20936
|
watched.add(depId);
|
|
20897
20937
|
this.watchFile(depId, true);
|
|
20898
20938
|
});
|
|
20899
20939
|
}
|
|
20900
|
-
}
|
|
20901
|
-
this.watchFiles
|
|
20940
|
+
}
|
|
20941
|
+
for (const id of this.watchFiles) {
|
|
20902
20942
|
watched.add(id);
|
|
20903
20943
|
this.watchFile(id);
|
|
20904
|
-
}
|
|
20905
|
-
|
|
20944
|
+
}
|
|
20945
|
+
for (const id of previouslyWatched) {
|
|
20906
20946
|
if (!watched.has(id))
|
|
20907
20947
|
deleteTask(id, this, this.chokidarOptionsHash);
|
|
20908
|
-
}
|
|
20948
|
+
}
|
|
20909
20949
|
return Promise.all(this.outputs.map(output => result.write(output))).then(() => result);
|
|
20910
20950
|
})
|
|
20911
20951
|
.then((result) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rollup",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"description": "Next-generation ES module bundler",
|
|
5
5
|
"main": "dist/rollup.js",
|
|
6
6
|
"module": "dist/rollup.es.js",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"ci:coverage": "npm run test:coverage",
|
|
17
17
|
"ci:lint": "npm run lint:nofix && npm run security",
|
|
18
18
|
"ci:test": "npm run build:test && npm run build:bootstrap && npm run test:all",
|
|
19
|
+
"ci:test_12": "npm run build:test && npm run build:bootstrap && npm run test:only && npm run test:typescript",
|
|
19
20
|
"lint": "npm run lint:ts -- --fix && npm run lint:js -- --fix && npm run lint:markdown",
|
|
20
21
|
"lint:nofix": "npm run lint:ts && npm run lint:js && npm run lint:markdown",
|
|
21
22
|
"lint:ts": "tslint --project .",
|
|
@@ -60,8 +61,8 @@
|
|
|
60
61
|
"homepage": "https://github.com/rollup/rollup",
|
|
61
62
|
"dependencies": {
|
|
62
63
|
"@types/estree": "0.0.39",
|
|
63
|
-
"@types/node": "^12.
|
|
64
|
-
"acorn": "^6.
|
|
64
|
+
"@types/node": "^12.6.2",
|
|
65
|
+
"acorn": "^6.2.0"
|
|
65
66
|
},
|
|
66
67
|
"devDependencies": {
|
|
67
68
|
"@types/chokidar": "^2.1.3",
|
|
@@ -71,8 +72,8 @@
|
|
|
71
72
|
"acorn-dynamic-import": "^4.0.0",
|
|
72
73
|
"acorn-import-meta": "^1.0.0",
|
|
73
74
|
"acorn-jsx": "^5.0.1",
|
|
74
|
-
"acorn-walk": "^6.
|
|
75
|
-
"buble": "^0.19.
|
|
75
|
+
"acorn-walk": "^6.2.0",
|
|
76
|
+
"buble": "^0.19.8",
|
|
76
77
|
"chokidar": "^2.1.6",
|
|
77
78
|
"console-group": "^0.3.3",
|
|
78
79
|
"core-js": "^3.1.4",
|
|
@@ -81,14 +82,14 @@
|
|
|
81
82
|
"es6-shim": "^0.35.5",
|
|
82
83
|
"eslint": "^6.0.1",
|
|
83
84
|
"eslint-plugin-import": "^2.18.0",
|
|
84
|
-
"execa": "^2.0.
|
|
85
|
+
"execa": "^2.0.3",
|
|
85
86
|
"fixturify": "^1.2.0",
|
|
86
87
|
"hash.js": "^1.1.7",
|
|
87
88
|
"husky": "^3.0.0",
|
|
88
89
|
"immutable": "^4.0.0-rc.12",
|
|
89
|
-
"is-reference": "^1.1.
|
|
90
|
+
"is-reference": "^1.1.3",
|
|
90
91
|
"istanbul": "^0.4.5",
|
|
91
|
-
"lint-staged": "^9.
|
|
92
|
+
"lint-staged": "^9.2.0",
|
|
92
93
|
"locate-character": "^2.0.5",
|
|
93
94
|
"magic-string": "^0.25.3",
|
|
94
95
|
"markdownlint-cli": "^0.17.0",
|
|
@@ -101,15 +102,15 @@
|
|
|
101
102
|
"remap-istanbul": "^0.13.0",
|
|
102
103
|
"require-relative": "^0.8.7",
|
|
103
104
|
"requirejs": "^2.3.6",
|
|
104
|
-
"rollup": "^1.16.
|
|
105
|
+
"rollup": "^1.16.7",
|
|
105
106
|
"rollup-plugin-alias": "^1.5.2",
|
|
106
|
-
"rollup-plugin-buble": "^0.19.
|
|
107
|
+
"rollup-plugin-buble": "^0.19.8",
|
|
107
108
|
"rollup-plugin-commonjs": "^10.0.1",
|
|
108
109
|
"rollup-plugin-json": "^4.0.0",
|
|
109
110
|
"rollup-plugin-node-resolve": "^5.2.0",
|
|
110
111
|
"rollup-plugin-replace": "^2.2.0",
|
|
111
112
|
"rollup-plugin-string": "^3.0.0",
|
|
112
|
-
"rollup-plugin-terser": "^5.
|
|
113
|
+
"rollup-plugin-terser": "^5.1.1",
|
|
113
114
|
"rollup-plugin-typescript": "^1.0.1",
|
|
114
115
|
"rollup-pluginutils": "^2.8.1",
|
|
115
116
|
"sander": "^0.6.0",
|
|
@@ -117,13 +118,13 @@
|
|
|
117
118
|
"signal-exit": "^3.0.2",
|
|
118
119
|
"source-map": "^0.6.1",
|
|
119
120
|
"source-map-support": "^0.5.12",
|
|
120
|
-
"sourcemap-codec": "^1.4.
|
|
121
|
-
"systemjs": "^4.0.
|
|
122
|
-
"terser": "^4.
|
|
121
|
+
"sourcemap-codec": "^1.4.6",
|
|
122
|
+
"systemjs": "^4.0.2",
|
|
123
|
+
"terser": "^4.1.2",
|
|
123
124
|
"tslib": "^1.10.0",
|
|
124
125
|
"tslint": "^5.18.0",
|
|
125
126
|
"turbocolor": "^2.6.1",
|
|
126
|
-
"typescript": "^3.5.
|
|
127
|
+
"typescript": "^3.5.3",
|
|
127
128
|
"url-parse": "^1.4.7"
|
|
128
129
|
},
|
|
129
130
|
"files": [
|