rollup 1.16.7 → 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 +11 -0
- package/bin/rollup +1 -1
- package/dist/rollup.browser.es.js +3 -3
- package/dist/rollup.browser.js +3 -3
- package/dist/rollup.es.js +69 -41
- package/dist/rollup.js +69 -41
- package/package.json +15 -15
package/dist/rollup.es.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
|
|
@@ -16,7 +16,7 @@ import { tokTypes, Parser } from 'acorn';
|
|
|
16
16
|
import { EventEmitter } from 'events';
|
|
17
17
|
import module$1 from 'module';
|
|
18
18
|
|
|
19
|
-
var version = "1.
|
|
19
|
+
var version = "1.17.0";
|
|
20
20
|
|
|
21
21
|
var minimalisticAssert = assert;
|
|
22
22
|
function assert(val, msg) {
|
|
@@ -583,13 +583,13 @@ function decode(mappings) {
|
|
|
583
583
|
var c = mappings.charCodeAt(i);
|
|
584
584
|
if (c === 44) { // ","
|
|
585
585
|
if (segment.length)
|
|
586
|
-
line.push(
|
|
586
|
+
line.push(segment);
|
|
587
587
|
segment = [];
|
|
588
588
|
j = 0;
|
|
589
589
|
}
|
|
590
590
|
else if (c === 59) { // ";"
|
|
591
591
|
if (segment.length)
|
|
592
|
-
line.push(
|
|
592
|
+
line.push(segment);
|
|
593
593
|
segment = [];
|
|
594
594
|
j = 0;
|
|
595
595
|
decoded.push(line);
|
|
@@ -609,26 +609,30 @@ function decode(mappings) {
|
|
|
609
609
|
}
|
|
610
610
|
else {
|
|
611
611
|
var shouldNegate = value & 1;
|
|
612
|
-
value
|
|
613
|
-
|
|
612
|
+
value >>>= 1;
|
|
613
|
+
if (shouldNegate) {
|
|
614
|
+
value = -value;
|
|
615
|
+
if (value === 0)
|
|
616
|
+
value = -0x80000000;
|
|
617
|
+
}
|
|
614
618
|
if (j == 0) {
|
|
615
|
-
generatedCodeColumn +=
|
|
619
|
+
generatedCodeColumn += value;
|
|
616
620
|
segment.push(generatedCodeColumn);
|
|
617
621
|
}
|
|
618
622
|
else if (j === 1) {
|
|
619
|
-
sourceFileIndex +=
|
|
623
|
+
sourceFileIndex += value;
|
|
620
624
|
segment.push(sourceFileIndex);
|
|
621
625
|
}
|
|
622
626
|
else if (j === 2) {
|
|
623
|
-
sourceCodeLine +=
|
|
627
|
+
sourceCodeLine += value;
|
|
624
628
|
segment.push(sourceCodeLine);
|
|
625
629
|
}
|
|
626
630
|
else if (j === 3) {
|
|
627
|
-
sourceCodeColumn +=
|
|
631
|
+
sourceCodeColumn += value;
|
|
628
632
|
segment.push(sourceCodeColumn);
|
|
629
633
|
}
|
|
630
634
|
else if (j === 4) {
|
|
631
|
-
nameIndex +=
|
|
635
|
+
nameIndex += value;
|
|
632
636
|
segment.push(nameIndex);
|
|
633
637
|
}
|
|
634
638
|
j++;
|
|
@@ -637,7 +641,7 @@ function decode(mappings) {
|
|
|
637
641
|
}
|
|
638
642
|
}
|
|
639
643
|
if (segment.length)
|
|
640
|
-
line.push(
|
|
644
|
+
line.push(segment);
|
|
641
645
|
decoded.push(line);
|
|
642
646
|
return decoded;
|
|
643
647
|
}
|
|
@@ -683,7 +687,7 @@ function encodeInteger(num) {
|
|
|
683
687
|
num = num < 0 ? (-num << 1) | 1 : num << 1;
|
|
684
688
|
do {
|
|
685
689
|
var clamped = num & 31;
|
|
686
|
-
num
|
|
690
|
+
num >>>= 5;
|
|
687
691
|
if (num > 0) {
|
|
688
692
|
clamped |= 32;
|
|
689
693
|
}
|
|
@@ -8276,6 +8280,8 @@ function isReference(node, parent) {
|
|
|
8276
8280
|
return !node.computed && isReference(node.object, node);
|
|
8277
8281
|
}
|
|
8278
8282
|
if (node.type === 'Identifier') {
|
|
8283
|
+
if (!parent)
|
|
8284
|
+
return true;
|
|
8279
8285
|
switch (parent.type) {
|
|
8280
8286
|
// disregard `bar` in `foo.bar`
|
|
8281
8287
|
case 'MemberExpression': return parent.computed || node === parent.object;
|
|
@@ -12851,13 +12857,13 @@ base$1.WithStatement = function (node, st, c) {
|
|
|
12851
12857
|
};
|
|
12852
12858
|
base$1.SwitchStatement = function (node, st, c) {
|
|
12853
12859
|
c(node.discriminant, st, "Expression");
|
|
12854
|
-
for (var i = 0, list = node.cases; i < list.length; i += 1) {
|
|
12855
|
-
var cs = list[i];
|
|
12860
|
+
for (var i$1 = 0, list$1 = node.cases; i$1 < list$1.length; i$1 += 1) {
|
|
12861
|
+
var cs = list$1[i$1];
|
|
12856
12862
|
|
|
12857
12863
|
if (cs.test) { c(cs.test, st, "Expression"); }
|
|
12858
|
-
for (var i
|
|
12864
|
+
for (var i = 0, list = cs.consequent; i < list.length; i += 1)
|
|
12859
12865
|
{
|
|
12860
|
-
var cons = list
|
|
12866
|
+
var cons = list[i];
|
|
12861
12867
|
|
|
12862
12868
|
c(cons, st, "Statement");
|
|
12863
12869
|
}
|
|
@@ -13052,7 +13058,7 @@ base$1.ImportDeclaration = function (node, st, c) {
|
|
|
13052
13058
|
}
|
|
13053
13059
|
c(node.source, st, "Expression");
|
|
13054
13060
|
};
|
|
13055
|
-
base$1.ImportSpecifier = base$1.ImportDefaultSpecifier = base$1.ImportNamespaceSpecifier = base$1.Identifier = base$1.Literal = ignore;
|
|
13061
|
+
base$1.ImportSpecifier = base$1.ImportDefaultSpecifier = base$1.ImportNamespaceSpecifier = base$1.Identifier = base$1.Literal = base$1.Import = ignore;
|
|
13056
13062
|
|
|
13057
13063
|
base$1.TaggedTemplateExpression = function (node, st, c) {
|
|
13058
13064
|
c(node.tag, st, "Expression");
|
|
@@ -13902,12 +13908,12 @@ class Link {
|
|
|
13902
13908
|
return null;
|
|
13903
13909
|
}
|
|
13904
13910
|
}
|
|
13905
|
-
function
|
|
13906
|
-
function linkMap(source, map) {
|
|
13911
|
+
function getLinkMap(graph) {
|
|
13912
|
+
return function linkMap(source, map) {
|
|
13907
13913
|
if (map.mappings) {
|
|
13908
13914
|
return new Link(map, [source]);
|
|
13909
13915
|
}
|
|
13910
|
-
|
|
13916
|
+
graph.warn({
|
|
13911
13917
|
code: 'SOURCEMAP_BROKEN',
|
|
13912
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`,
|
|
13913
13919
|
plugin: map.plugin,
|
|
@@ -13917,27 +13923,29 @@ function collapseSourcemaps(bundle, file, map, modules, bundleSourcemapChain, ex
|
|
|
13917
13923
|
mappings: [],
|
|
13918
13924
|
names: []
|
|
13919
13925
|
}, [source]);
|
|
13926
|
+
};
|
|
13927
|
+
}
|
|
13928
|
+
function getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapChain, linkMap) {
|
|
13929
|
+
let source;
|
|
13930
|
+
if (!originalSourcemap) {
|
|
13931
|
+
source = new Source(id, originalCode);
|
|
13920
13932
|
}
|
|
13933
|
+
else {
|
|
13934
|
+
const sources = originalSourcemap.sources;
|
|
13935
|
+
const sourcesContent = originalSourcemap.sourcesContent || [];
|
|
13936
|
+
// TODO indiscriminately treating IDs and sources as normal paths is probably bad.
|
|
13937
|
+
const directory = dirname(id) || '.';
|
|
13938
|
+
const sourceRoot = originalSourcemap.sourceRoot || '.';
|
|
13939
|
+
const baseSources = sources.map((source, i) => new Source(resolve(directory, sourceRoot, source), sourcesContent[i]));
|
|
13940
|
+
source = new Link(originalSourcemap, baseSources);
|
|
13941
|
+
}
|
|
13942
|
+
return sourcemapChain.reduce(linkMap, source);
|
|
13943
|
+
}
|
|
13944
|
+
function collapseSourcemaps(bundle, file, map, modules, bundleSourcemapChain, excludeContent) {
|
|
13945
|
+
const linkMap = getLinkMap(bundle.graph);
|
|
13921
13946
|
const moduleSources = modules
|
|
13922
13947
|
.filter(module => !module.excludeFromSourcemap)
|
|
13923
|
-
.map(module =>
|
|
13924
|
-
let source;
|
|
13925
|
-
const originalSourcemap = module.originalSourcemap;
|
|
13926
|
-
if (!originalSourcemap) {
|
|
13927
|
-
source = new Source(module.id, module.originalCode);
|
|
13928
|
-
}
|
|
13929
|
-
else {
|
|
13930
|
-
const sources = originalSourcemap.sources;
|
|
13931
|
-
const sourcesContent = originalSourcemap.sourcesContent || [];
|
|
13932
|
-
// TODO indiscriminately treating IDs and sources as normal paths is probably bad.
|
|
13933
|
-
const directory = dirname(module.id) || '.';
|
|
13934
|
-
const sourceRoot = originalSourcemap.sourceRoot || '.';
|
|
13935
|
-
const baseSources = sources.map((source, i) => new Source(resolve(directory, sourceRoot, source), sourcesContent[i]));
|
|
13936
|
-
source = new Link(originalSourcemap, baseSources);
|
|
13937
|
-
}
|
|
13938
|
-
source = module.sourcemapChain.reduce(linkMap, source);
|
|
13939
|
-
return source;
|
|
13940
|
-
});
|
|
13948
|
+
.map(module => getCollapsedSourcemap(module.id, module.originalCode, module.originalSourcemap, module.sourcemapChain, linkMap));
|
|
13941
13949
|
// DecodedSourceMap (from magic-string) uses a number[] instead of the more
|
|
13942
13950
|
// correct SourceMapSegment tuples. Cast it here to gain type safety.
|
|
13943
13951
|
let source = new Link(map, moduleSources);
|
|
@@ -13951,6 +13959,14 @@ function collapseSourcemaps(bundle, file, map, modules, bundleSourcemapChain, ex
|
|
|
13951
13959
|
sourcesContent = (excludeContent ? null : sourcesContent);
|
|
13952
13960
|
return new SourceMap({ file, sources, sourcesContent, names, mappings });
|
|
13953
13961
|
}
|
|
13962
|
+
function collapseSourcemap(graph, id, originalCode, originalSourcemap, sourcemapChain) {
|
|
13963
|
+
if (!sourcemapChain.length) {
|
|
13964
|
+
return originalSourcemap;
|
|
13965
|
+
}
|
|
13966
|
+
const source = getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapChain, getLinkMap(graph));
|
|
13967
|
+
const map = source.traceMappings();
|
|
13968
|
+
return Object.assign({ version: 3 }, map);
|
|
13969
|
+
}
|
|
13954
13970
|
|
|
13955
13971
|
const DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT = {
|
|
13956
13972
|
amd: deconflictImportsOther,
|
|
@@ -15979,7 +15995,7 @@ const uncacheablePlugin = pluginName => ({
|
|
|
15979
15995
|
function transform(graph, source, module) {
|
|
15980
15996
|
const id = module.id;
|
|
15981
15997
|
const sourcemapChain = [];
|
|
15982
|
-
|
|
15998
|
+
let originalSourcemap = source.map === null ? null : decodedSourcemap(source.map);
|
|
15983
15999
|
const baseEmitAsset = graph.pluginDriver.emitAsset;
|
|
15984
16000
|
const originalCode = source.code;
|
|
15985
16001
|
let ast = source.ast;
|
|
@@ -16099,6 +16115,18 @@ function transform(graph, source, module) {
|
|
|
16099
16115
|
setAssetSourceErr = err;
|
|
16100
16116
|
}
|
|
16101
16117
|
}
|
|
16118
|
+
},
|
|
16119
|
+
getCombinedSourcemap() {
|
|
16120
|
+
const combinedMap = collapseSourcemap(graph, id, originalCode, originalSourcemap, sourcemapChain);
|
|
16121
|
+
if (!combinedMap) {
|
|
16122
|
+
const magicString = new MagicString(originalCode);
|
|
16123
|
+
return magicString.generateMap({ includeContent: true, hires: true, source: id });
|
|
16124
|
+
}
|
|
16125
|
+
if (originalSourcemap !== combinedMap) {
|
|
16126
|
+
originalSourcemap = combinedMap;
|
|
16127
|
+
sourcemapChain.length = 0;
|
|
16128
|
+
}
|
|
16129
|
+
return new SourceMap(Object.assign({}, combinedMap, { file: null, sourcesContent: combinedMap.sourcesContent }));
|
|
16102
16130
|
} });
|
|
16103
16131
|
})
|
|
16104
16132
|
.catch(err => {
|
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;
|
|
@@ -12858,13 +12864,13 @@ base$1.WithStatement = function (node, st, c) {
|
|
|
12858
12864
|
};
|
|
12859
12865
|
base$1.SwitchStatement = function (node, st, c) {
|
|
12860
12866
|
c(node.discriminant, st, "Expression");
|
|
12861
|
-
for (var i = 0, list = node.cases; i < list.length; i += 1) {
|
|
12862
|
-
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];
|
|
12863
12869
|
|
|
12864
12870
|
if (cs.test) { c(cs.test, st, "Expression"); }
|
|
12865
|
-
for (var i
|
|
12871
|
+
for (var i = 0, list = cs.consequent; i < list.length; i += 1)
|
|
12866
12872
|
{
|
|
12867
|
-
var cons = list
|
|
12873
|
+
var cons = list[i];
|
|
12868
12874
|
|
|
12869
12875
|
c(cons, st, "Statement");
|
|
12870
12876
|
}
|
|
@@ -13059,7 +13065,7 @@ base$1.ImportDeclaration = function (node, st, c) {
|
|
|
13059
13065
|
}
|
|
13060
13066
|
c(node.source, st, "Expression");
|
|
13061
13067
|
};
|
|
13062
|
-
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;
|
|
13063
13069
|
|
|
13064
13070
|
base$1.TaggedTemplateExpression = function (node, st, c) {
|
|
13065
13071
|
c(node.tag, st, "Expression");
|
|
@@ -13909,12 +13915,12 @@ class Link {
|
|
|
13909
13915
|
return null;
|
|
13910
13916
|
}
|
|
13911
13917
|
}
|
|
13912
|
-
function
|
|
13913
|
-
function linkMap(source, map) {
|
|
13918
|
+
function getLinkMap(graph) {
|
|
13919
|
+
return function linkMap(source, map) {
|
|
13914
13920
|
if (map.mappings) {
|
|
13915
13921
|
return new Link(map, [source]);
|
|
13916
13922
|
}
|
|
13917
|
-
|
|
13923
|
+
graph.warn({
|
|
13918
13924
|
code: 'SOURCEMAP_BROKEN',
|
|
13919
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`,
|
|
13920
13926
|
plugin: map.plugin,
|
|
@@ -13924,27 +13930,29 @@ function collapseSourcemaps(bundle, file, map, modules, bundleSourcemapChain, ex
|
|
|
13924
13930
|
mappings: [],
|
|
13925
13931
|
names: []
|
|
13926
13932
|
}, [source]);
|
|
13933
|
+
};
|
|
13934
|
+
}
|
|
13935
|
+
function getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapChain, linkMap) {
|
|
13936
|
+
let source;
|
|
13937
|
+
if (!originalSourcemap) {
|
|
13938
|
+
source = new Source(id, originalCode);
|
|
13927
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);
|
|
13928
13953
|
const moduleSources = modules
|
|
13929
13954
|
.filter(module => !module.excludeFromSourcemap)
|
|
13930
|
-
.map(module =>
|
|
13931
|
-
let source;
|
|
13932
|
-
const originalSourcemap = module.originalSourcemap;
|
|
13933
|
-
if (!originalSourcemap) {
|
|
13934
|
-
source = new Source(module.id, module.originalCode);
|
|
13935
|
-
}
|
|
13936
|
-
else {
|
|
13937
|
-
const sources = originalSourcemap.sources;
|
|
13938
|
-
const sourcesContent = originalSourcemap.sourcesContent || [];
|
|
13939
|
-
// TODO indiscriminately treating IDs and sources as normal paths is probably bad.
|
|
13940
|
-
const directory = path.dirname(module.id) || '.';
|
|
13941
|
-
const sourceRoot = originalSourcemap.sourceRoot || '.';
|
|
13942
|
-
const baseSources = sources.map((source, i) => new Source(path.resolve(directory, sourceRoot, source), sourcesContent[i]));
|
|
13943
|
-
source = new Link(originalSourcemap, baseSources);
|
|
13944
|
-
}
|
|
13945
|
-
source = module.sourcemapChain.reduce(linkMap, source);
|
|
13946
|
-
return source;
|
|
13947
|
-
});
|
|
13955
|
+
.map(module => getCollapsedSourcemap(module.id, module.originalCode, module.originalSourcemap, module.sourcemapChain, linkMap));
|
|
13948
13956
|
// DecodedSourceMap (from magic-string) uses a number[] instead of the more
|
|
13949
13957
|
// correct SourceMapSegment tuples. Cast it here to gain type safety.
|
|
13950
13958
|
let source = new Link(map, moduleSources);
|
|
@@ -13958,6 +13966,14 @@ function collapseSourcemaps(bundle, file, map, modules, bundleSourcemapChain, ex
|
|
|
13958
13966
|
sourcesContent = (excludeContent ? null : sourcesContent);
|
|
13959
13967
|
return new SourceMap({ file, sources, sourcesContent, names, mappings });
|
|
13960
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
|
+
}
|
|
13961
13977
|
|
|
13962
13978
|
const DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT = {
|
|
13963
13979
|
amd: deconflictImportsOther,
|
|
@@ -15986,7 +16002,7 @@ const uncacheablePlugin = pluginName => ({
|
|
|
15986
16002
|
function transform(graph, source, module) {
|
|
15987
16003
|
const id = module.id;
|
|
15988
16004
|
const sourcemapChain = [];
|
|
15989
|
-
|
|
16005
|
+
let originalSourcemap = source.map === null ? null : decodedSourcemap(source.map);
|
|
15990
16006
|
const baseEmitAsset = graph.pluginDriver.emitAsset;
|
|
15991
16007
|
const originalCode = source.code;
|
|
15992
16008
|
let ast = source.ast;
|
|
@@ -16106,6 +16122,18 @@ function transform(graph, source, module) {
|
|
|
16106
16122
|
setAssetSourceErr = err;
|
|
16107
16123
|
}
|
|
16108
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 }));
|
|
16109
16137
|
} });
|
|
16110
16138
|
})
|
|
16111
16139
|
.catch(err => {
|
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",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"homepage": "https://github.com/rollup/rollup",
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@types/estree": "0.0.39",
|
|
64
|
-
"@types/node": "^12.
|
|
65
|
-
"acorn": "^6.
|
|
64
|
+
"@types/node": "^12.6.2",
|
|
65
|
+
"acorn": "^6.2.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/chokidar": "^2.1.3",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"acorn-dynamic-import": "^4.0.0",
|
|
73
73
|
"acorn-import-meta": "^1.0.0",
|
|
74
74
|
"acorn-jsx": "^5.0.1",
|
|
75
|
-
"acorn-walk": "^6.
|
|
76
|
-
"buble": "^0.19.
|
|
75
|
+
"acorn-walk": "^6.2.0",
|
|
76
|
+
"buble": "^0.19.8",
|
|
77
77
|
"chokidar": "^2.1.6",
|
|
78
78
|
"console-group": "^0.3.3",
|
|
79
79
|
"core-js": "^3.1.4",
|
|
@@ -82,14 +82,14 @@
|
|
|
82
82
|
"es6-shim": "^0.35.5",
|
|
83
83
|
"eslint": "^6.0.1",
|
|
84
84
|
"eslint-plugin-import": "^2.18.0",
|
|
85
|
-
"execa": "^2.0.
|
|
85
|
+
"execa": "^2.0.3",
|
|
86
86
|
"fixturify": "^1.2.0",
|
|
87
87
|
"hash.js": "^1.1.7",
|
|
88
88
|
"husky": "^3.0.0",
|
|
89
89
|
"immutable": "^4.0.0-rc.12",
|
|
90
|
-
"is-reference": "^1.1.
|
|
90
|
+
"is-reference": "^1.1.3",
|
|
91
91
|
"istanbul": "^0.4.5",
|
|
92
|
-
"lint-staged": "^9.
|
|
92
|
+
"lint-staged": "^9.2.0",
|
|
93
93
|
"locate-character": "^2.0.5",
|
|
94
94
|
"magic-string": "^0.25.3",
|
|
95
95
|
"markdownlint-cli": "^0.17.0",
|
|
@@ -102,15 +102,15 @@
|
|
|
102
102
|
"remap-istanbul": "^0.13.0",
|
|
103
103
|
"require-relative": "^0.8.7",
|
|
104
104
|
"requirejs": "^2.3.6",
|
|
105
|
-
"rollup": "^1.16.
|
|
105
|
+
"rollup": "^1.16.7",
|
|
106
106
|
"rollup-plugin-alias": "^1.5.2",
|
|
107
|
-
"rollup-plugin-buble": "^0.19.
|
|
107
|
+
"rollup-plugin-buble": "^0.19.8",
|
|
108
108
|
"rollup-plugin-commonjs": "^10.0.1",
|
|
109
109
|
"rollup-plugin-json": "^4.0.0",
|
|
110
110
|
"rollup-plugin-node-resolve": "^5.2.0",
|
|
111
111
|
"rollup-plugin-replace": "^2.2.0",
|
|
112
112
|
"rollup-plugin-string": "^3.0.0",
|
|
113
|
-
"rollup-plugin-terser": "^5.
|
|
113
|
+
"rollup-plugin-terser": "^5.1.1",
|
|
114
114
|
"rollup-plugin-typescript": "^1.0.1",
|
|
115
115
|
"rollup-pluginutils": "^2.8.1",
|
|
116
116
|
"sander": "^0.6.0",
|
|
@@ -118,13 +118,13 @@
|
|
|
118
118
|
"signal-exit": "^3.0.2",
|
|
119
119
|
"source-map": "^0.6.1",
|
|
120
120
|
"source-map-support": "^0.5.12",
|
|
121
|
-
"sourcemap-codec": "^1.4.
|
|
122
|
-
"systemjs": "^4.0.
|
|
123
|
-
"terser": "^4.
|
|
121
|
+
"sourcemap-codec": "^1.4.6",
|
|
122
|
+
"systemjs": "^4.0.2",
|
|
123
|
+
"terser": "^4.1.2",
|
|
124
124
|
"tslib": "^1.10.0",
|
|
125
125
|
"tslint": "^5.18.0",
|
|
126
126
|
"turbocolor": "^2.6.1",
|
|
127
|
-
"typescript": "^3.5.
|
|
127
|
+
"typescript": "^3.5.3",
|
|
128
128
|
"url-parse": "^1.4.7"
|
|
129
129
|
},
|
|
130
130
|
"files": [
|