rollup 4.18.1 → 4.19.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/bin/rollup +2 -2
- package/dist/es/getLogFilter.js +2 -2
- package/dist/es/parseAst.js +2 -2
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/node-entry.js +183 -118
- package/dist/es/shared/parseAst.js +25 -13
- package/dist/es/shared/watch.js +2 -2
- package/dist/getLogFilter.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/parseAst.js +2 -2
- package/dist/rollup.d.ts +19 -3
- package/dist/rollup.js +2 -2
- package/dist/shared/fsevents-importer.js +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/parseAst.js +25 -13
- package/dist/shared/rollup.js +183 -118
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/package.json +36 -33
package/dist/bin/rollup
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*
|
|
3
3
|
@license
|
|
4
|
-
Rollup.js v4.
|
|
5
|
-
|
|
4
|
+
Rollup.js v4.19.0
|
|
5
|
+
Sat, 20 Jul 2024 05:45:44 GMT - commit 28546b5821efcb72c2eb05f422d986524647a0e3
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
8
8
|
|
package/dist/es/getLogFilter.js
CHANGED
package/dist/es/parseAst.js
CHANGED
package/dist/es/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.19.0
|
|
4
|
+
Sat, 20 Jul 2024 05:45:44 GMT - commit 28546b5821efcb72c2eb05f422d986524647a0e3
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -16,7 +16,7 @@ import { performance } from 'node:perf_hooks';
|
|
|
16
16
|
import { lstat, realpath, readdir, readFile, mkdir, writeFile } from 'node:fs/promises';
|
|
17
17
|
import * as tty from 'tty';
|
|
18
18
|
|
|
19
|
-
var version = "4.
|
|
19
|
+
var version = "4.19.0";
|
|
20
20
|
|
|
21
21
|
const comma = ','.charCodeAt(0);
|
|
22
22
|
const semicolon = ';'.charCodeAt(0);
|
|
@@ -28,6 +28,42 @@ for (let i = 0; i < chars$1.length; i++) {
|
|
|
28
28
|
intToChar[i] = c;
|
|
29
29
|
charToInt[c] = i;
|
|
30
30
|
}
|
|
31
|
+
function decodeInteger(reader, relative) {
|
|
32
|
+
let value = 0;
|
|
33
|
+
let shift = 0;
|
|
34
|
+
let integer = 0;
|
|
35
|
+
do {
|
|
36
|
+
const c = reader.next();
|
|
37
|
+
integer = charToInt[c];
|
|
38
|
+
value |= (integer & 31) << shift;
|
|
39
|
+
shift += 5;
|
|
40
|
+
} while (integer & 32);
|
|
41
|
+
const shouldNegate = value & 1;
|
|
42
|
+
value >>>= 1;
|
|
43
|
+
if (shouldNegate) {
|
|
44
|
+
value = -0x80000000 | -value;
|
|
45
|
+
}
|
|
46
|
+
return relative + value;
|
|
47
|
+
}
|
|
48
|
+
function encodeInteger(builder, num, relative) {
|
|
49
|
+
let delta = num - relative;
|
|
50
|
+
delta = delta < 0 ? (-delta << 1) | 1 : delta << 1;
|
|
51
|
+
do {
|
|
52
|
+
let clamped = delta & 0b011111;
|
|
53
|
+
delta >>>= 5;
|
|
54
|
+
if (delta > 0)
|
|
55
|
+
clamped |= 0b100000;
|
|
56
|
+
builder.write(intToChar[clamped]);
|
|
57
|
+
} while (delta > 0);
|
|
58
|
+
return num;
|
|
59
|
+
}
|
|
60
|
+
function hasMoreVlq(reader, max) {
|
|
61
|
+
if (reader.pos >= max)
|
|
62
|
+
return false;
|
|
63
|
+
return reader.peek() !== comma;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const bufLength = 1024 * 16;
|
|
31
67
|
// Provide a fallback for older environments.
|
|
32
68
|
const td = typeof TextDecoder !== 'undefined'
|
|
33
69
|
? /* #__PURE__ */ new TextDecoder()
|
|
@@ -47,74 +83,89 @@ const td = typeof TextDecoder !== 'undefined'
|
|
|
47
83
|
return out;
|
|
48
84
|
},
|
|
49
85
|
};
|
|
86
|
+
class StringWriter {
|
|
87
|
+
constructor() {
|
|
88
|
+
this.pos = 0;
|
|
89
|
+
this.out = '';
|
|
90
|
+
this.buffer = new Uint8Array(bufLength);
|
|
91
|
+
}
|
|
92
|
+
write(v) {
|
|
93
|
+
const { buffer } = this;
|
|
94
|
+
buffer[this.pos++] = v;
|
|
95
|
+
if (this.pos === bufLength) {
|
|
96
|
+
this.out += td.decode(buffer);
|
|
97
|
+
this.pos = 0;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
flush() {
|
|
101
|
+
const { buffer, out, pos } = this;
|
|
102
|
+
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
class StringReader {
|
|
106
|
+
constructor(buffer) {
|
|
107
|
+
this.pos = 0;
|
|
108
|
+
this.buffer = buffer;
|
|
109
|
+
}
|
|
110
|
+
next() {
|
|
111
|
+
return this.buffer.charCodeAt(this.pos++);
|
|
112
|
+
}
|
|
113
|
+
peek() {
|
|
114
|
+
return this.buffer.charCodeAt(this.pos);
|
|
115
|
+
}
|
|
116
|
+
indexOf(char) {
|
|
117
|
+
const { buffer, pos } = this;
|
|
118
|
+
const idx = buffer.indexOf(char, pos);
|
|
119
|
+
return idx === -1 ? buffer.length : idx;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
50
123
|
function decode(mappings) {
|
|
51
|
-
const
|
|
124
|
+
const { length } = mappings;
|
|
125
|
+
const reader = new StringReader(mappings);
|
|
52
126
|
const decoded = [];
|
|
53
|
-
let
|
|
127
|
+
let genColumn = 0;
|
|
128
|
+
let sourcesIndex = 0;
|
|
129
|
+
let sourceLine = 0;
|
|
130
|
+
let sourceColumn = 0;
|
|
131
|
+
let namesIndex = 0;
|
|
54
132
|
do {
|
|
55
|
-
const semi = indexOf(
|
|
133
|
+
const semi = reader.indexOf(';');
|
|
56
134
|
const line = [];
|
|
57
135
|
let sorted = true;
|
|
58
136
|
let lastCol = 0;
|
|
59
|
-
|
|
60
|
-
|
|
137
|
+
genColumn = 0;
|
|
138
|
+
while (reader.pos < semi) {
|
|
61
139
|
let seg;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (col < lastCol)
|
|
140
|
+
genColumn = decodeInteger(reader, genColumn);
|
|
141
|
+
if (genColumn < lastCol)
|
|
65
142
|
sorted = false;
|
|
66
|
-
lastCol =
|
|
67
|
-
if (hasMoreVlq(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (hasMoreVlq(
|
|
72
|
-
|
|
73
|
-
seg = [
|
|
143
|
+
lastCol = genColumn;
|
|
144
|
+
if (hasMoreVlq(reader, semi)) {
|
|
145
|
+
sourcesIndex = decodeInteger(reader, sourcesIndex);
|
|
146
|
+
sourceLine = decodeInteger(reader, sourceLine);
|
|
147
|
+
sourceColumn = decodeInteger(reader, sourceColumn);
|
|
148
|
+
if (hasMoreVlq(reader, semi)) {
|
|
149
|
+
namesIndex = decodeInteger(reader, namesIndex);
|
|
150
|
+
seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];
|
|
74
151
|
}
|
|
75
152
|
else {
|
|
76
|
-
seg = [
|
|
153
|
+
seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];
|
|
77
154
|
}
|
|
78
155
|
}
|
|
79
156
|
else {
|
|
80
|
-
seg = [
|
|
157
|
+
seg = [genColumn];
|
|
81
158
|
}
|
|
82
159
|
line.push(seg);
|
|
160
|
+
reader.pos++;
|
|
83
161
|
}
|
|
84
162
|
if (!sorted)
|
|
85
163
|
sort(line);
|
|
86
164
|
decoded.push(line);
|
|
87
|
-
|
|
88
|
-
} while (
|
|
165
|
+
reader.pos = semi + 1;
|
|
166
|
+
} while (reader.pos <= length);
|
|
89
167
|
return decoded;
|
|
90
168
|
}
|
|
91
|
-
function indexOf(mappings, index) {
|
|
92
|
-
const idx = mappings.indexOf(';', index);
|
|
93
|
-
return idx === -1 ? mappings.length : idx;
|
|
94
|
-
}
|
|
95
|
-
function decodeInteger(mappings, pos, state, j) {
|
|
96
|
-
let value = 0;
|
|
97
|
-
let shift = 0;
|
|
98
|
-
let integer = 0;
|
|
99
|
-
do {
|
|
100
|
-
const c = mappings.charCodeAt(pos++);
|
|
101
|
-
integer = charToInt[c];
|
|
102
|
-
value |= (integer & 31) << shift;
|
|
103
|
-
shift += 5;
|
|
104
|
-
} while (integer & 32);
|
|
105
|
-
const shouldNegate = value & 1;
|
|
106
|
-
value >>>= 1;
|
|
107
|
-
if (shouldNegate) {
|
|
108
|
-
value = -0x80000000 | -value;
|
|
109
|
-
}
|
|
110
|
-
state[j] += value;
|
|
111
|
-
return pos;
|
|
112
|
-
}
|
|
113
|
-
function hasMoreVlq(mappings, i, length) {
|
|
114
|
-
if (i >= length)
|
|
115
|
-
return false;
|
|
116
|
-
return mappings.charCodeAt(i) !== comma;
|
|
117
|
-
}
|
|
118
169
|
function sort(line) {
|
|
119
170
|
line.sort(sortComparator);
|
|
120
171
|
}
|
|
@@ -122,62 +173,34 @@ function sortComparator(a, b) {
|
|
|
122
173
|
return a[0] - b[0];
|
|
123
174
|
}
|
|
124
175
|
function encode(decoded) {
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
let pos = 0;
|
|
131
|
-
let out = '';
|
|
176
|
+
const writer = new StringWriter();
|
|
177
|
+
let sourcesIndex = 0;
|
|
178
|
+
let sourceLine = 0;
|
|
179
|
+
let sourceColumn = 0;
|
|
180
|
+
let namesIndex = 0;
|
|
132
181
|
for (let i = 0; i < decoded.length; i++) {
|
|
133
182
|
const line = decoded[i];
|
|
134
|
-
if (i > 0)
|
|
135
|
-
|
|
136
|
-
out += td.decode(buf);
|
|
137
|
-
pos = 0;
|
|
138
|
-
}
|
|
139
|
-
buf[pos++] = semicolon;
|
|
140
|
-
}
|
|
183
|
+
if (i > 0)
|
|
184
|
+
writer.write(semicolon);
|
|
141
185
|
if (line.length === 0)
|
|
142
186
|
continue;
|
|
143
|
-
|
|
187
|
+
let genColumn = 0;
|
|
144
188
|
for (let j = 0; j < line.length; j++) {
|
|
145
189
|
const segment = line[j];
|
|
146
|
-
// We can push up to 5 ints, each int can take at most 7 chars, and we
|
|
147
|
-
// may push a comma.
|
|
148
|
-
if (pos > subLength) {
|
|
149
|
-
out += td.decode(sub);
|
|
150
|
-
buf.copyWithin(0, subLength, pos);
|
|
151
|
-
pos -= subLength;
|
|
152
|
-
}
|
|
153
190
|
if (j > 0)
|
|
154
|
-
|
|
155
|
-
|
|
191
|
+
writer.write(comma);
|
|
192
|
+
genColumn = encodeInteger(writer, segment[0], genColumn);
|
|
156
193
|
if (segment.length === 1)
|
|
157
194
|
continue;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
195
|
+
sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
|
|
196
|
+
sourceLine = encodeInteger(writer, segment[2], sourceLine);
|
|
197
|
+
sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
|
|
161
198
|
if (segment.length === 4)
|
|
162
199
|
continue;
|
|
163
|
-
|
|
200
|
+
namesIndex = encodeInteger(writer, segment[4], namesIndex);
|
|
164
201
|
}
|
|
165
202
|
}
|
|
166
|
-
return
|
|
167
|
-
}
|
|
168
|
-
function encodeInteger(buf, pos, state, segment, j) {
|
|
169
|
-
const next = segment[j];
|
|
170
|
-
let num = next - state[j];
|
|
171
|
-
state[j] = next;
|
|
172
|
-
num = num < 0 ? (-num << 1) | 1 : num << 1;
|
|
173
|
-
do {
|
|
174
|
-
let clamped = num & 0b011111;
|
|
175
|
-
num >>>= 5;
|
|
176
|
-
if (num > 0)
|
|
177
|
-
clamped |= 0b100000;
|
|
178
|
-
buf[pos++] = intToChar[clamped];
|
|
179
|
-
} while (num > 0);
|
|
180
|
-
return pos;
|
|
203
|
+
return writer.flush();
|
|
181
204
|
}
|
|
182
205
|
|
|
183
206
|
class BitSet {
|
|
@@ -4676,11 +4699,12 @@ const childNodeKeys = {
|
|
|
4676
4699
|
CatchClause: ['param', 'body'],
|
|
4677
4700
|
ChainExpression: ['expression'],
|
|
4678
4701
|
ClassBody: ['body'],
|
|
4679
|
-
ClassDeclaration: ['id', 'superClass', 'body'],
|
|
4680
|
-
ClassExpression: ['id', 'superClass', 'body'],
|
|
4702
|
+
ClassDeclaration: ['decorators', 'id', 'superClass', 'body'],
|
|
4703
|
+
ClassExpression: ['decorators', 'id', 'superClass', 'body'],
|
|
4681
4704
|
ConditionalExpression: ['test', 'consequent', 'alternate'],
|
|
4682
4705
|
ContinueStatement: ['label'],
|
|
4683
4706
|
DebuggerStatement: [],
|
|
4707
|
+
Decorator: ['expression'],
|
|
4684
4708
|
DoWhileStatement: ['body', 'test'],
|
|
4685
4709
|
EmptyStatement: [],
|
|
4686
4710
|
ExportAllDeclaration: ['exported', 'source', 'attributes'],
|
|
@@ -4706,7 +4730,7 @@ const childNodeKeys = {
|
|
|
4706
4730
|
LogicalExpression: ['left', 'right'],
|
|
4707
4731
|
MemberExpression: ['object', 'property'],
|
|
4708
4732
|
MetaProperty: ['meta', 'property'],
|
|
4709
|
-
MethodDefinition: ['key', 'value'],
|
|
4733
|
+
MethodDefinition: ['decorators', 'key', 'value'],
|
|
4710
4734
|
NewExpression: ['callee', 'arguments'],
|
|
4711
4735
|
ObjectExpression: ['properties'],
|
|
4712
4736
|
ObjectPattern: ['properties'],
|
|
@@ -4715,7 +4739,7 @@ const childNodeKeys = {
|
|
|
4715
4739
|
PrivateIdentifier: [],
|
|
4716
4740
|
Program: ['body'],
|
|
4717
4741
|
Property: ['key', 'value'],
|
|
4718
|
-
PropertyDefinition: ['key', 'value'],
|
|
4742
|
+
PropertyDefinition: ['decorators', 'key', 'value'],
|
|
4719
4743
|
RestElement: ['argument'],
|
|
4720
4744
|
ReturnStatement: ['argument'],
|
|
4721
4745
|
SequenceExpression: ['expressions'],
|
|
@@ -9285,6 +9309,15 @@ class ClassBody extends NodeBase {
|
|
|
9285
9309
|
applyDeoptimizations() { }
|
|
9286
9310
|
}
|
|
9287
9311
|
|
|
9312
|
+
function checkEffectForNodes(nodes, context) {
|
|
9313
|
+
for (const node of nodes) {
|
|
9314
|
+
if (node.hasEffects(context)) {
|
|
9315
|
+
return true;
|
|
9316
|
+
}
|
|
9317
|
+
}
|
|
9318
|
+
return false;
|
|
9319
|
+
}
|
|
9320
|
+
|
|
9288
9321
|
class MethodBase extends NodeBase {
|
|
9289
9322
|
constructor() {
|
|
9290
9323
|
super(...arguments);
|
|
@@ -9362,6 +9395,9 @@ class MethodBase extends NodeBase {
|
|
|
9362
9395
|
}
|
|
9363
9396
|
|
|
9364
9397
|
class MethodDefinition extends MethodBase {
|
|
9398
|
+
hasEffects(context) {
|
|
9399
|
+
return super.hasEffects(context) || checkEffectForNodes(this.decorators, context);
|
|
9400
|
+
}
|
|
9365
9401
|
applyDeoptimizations() { }
|
|
9366
9402
|
}
|
|
9367
9403
|
|
|
@@ -9448,7 +9484,7 @@ class ClassNode extends NodeBase {
|
|
|
9448
9484
|
this.applyDeoptimizations();
|
|
9449
9485
|
const initEffect = this.superClass?.hasEffects(context) || this.body.hasEffects(context);
|
|
9450
9486
|
this.id?.markDeclarationReached();
|
|
9451
|
-
return initEffect || super.hasEffects(context);
|
|
9487
|
+
return initEffect || super.hasEffects(context) || checkEffectForNodes(this.decorators, context);
|
|
9452
9488
|
}
|
|
9453
9489
|
hasEffectsOnInteractionAtPath(path, interaction, context) {
|
|
9454
9490
|
return interaction.type === INTERACTION_CALLED && path.length === 0
|
|
@@ -9465,6 +9501,8 @@ class ClassNode extends NodeBase {
|
|
|
9465
9501
|
this.included = true;
|
|
9466
9502
|
this.superClass?.include(context, includeChildrenRecursively);
|
|
9467
9503
|
this.body.include(context, includeChildrenRecursively);
|
|
9504
|
+
for (const decorator of this.decorators)
|
|
9505
|
+
decorator.include(context, includeChildrenRecursively);
|
|
9468
9506
|
if (this.id) {
|
|
9469
9507
|
this.id.markDeclarationReached();
|
|
9470
9508
|
this.id.include();
|
|
@@ -9558,6 +9596,7 @@ class ClassDeclaration extends ClassNode {
|
|
|
9558
9596
|
}
|
|
9559
9597
|
const renderedVariable = variable.getName(getPropertyAccess);
|
|
9560
9598
|
if (renderedVariable !== name) {
|
|
9599
|
+
this.decorators.map(decorator => decorator.render(code, options));
|
|
9561
9600
|
this.superClass?.render(code, options);
|
|
9562
9601
|
this.body.render(code, {
|
|
9563
9602
|
...options,
|
|
@@ -9793,6 +9832,13 @@ class DebuggerStatement extends NodeBase {
|
|
|
9793
9832
|
}
|
|
9794
9833
|
}
|
|
9795
9834
|
|
|
9835
|
+
class Decorator extends NodeBase {
|
|
9836
|
+
hasEffects(context) {
|
|
9837
|
+
return (this.expression.hasEffects(context) ||
|
|
9838
|
+
this.expression.hasEffectsOnInteractionAtPath(EMPTY_PATH, NODE_INTERACTION_UNKNOWN_CALL, context));
|
|
9839
|
+
}
|
|
9840
|
+
}
|
|
9841
|
+
|
|
9796
9842
|
function hasLoopBodyEffects(context, body) {
|
|
9797
9843
|
const { brokenFlow, hasBreak, hasContinue, ignore } = context;
|
|
9798
9844
|
const { breaks, continues } = ignore;
|
|
@@ -11045,8 +11091,8 @@ class LogicalExpression extends NodeBase {
|
|
|
11045
11091
|
}
|
|
11046
11092
|
render(code, options, { isCalleeOfRenderedParent, preventASI, renderedParentType, renderedSurroundingElement } = BLANK) {
|
|
11047
11093
|
if (!this.left.included || !this.right.included) {
|
|
11048
|
-
const operatorPos = findFirstOccurrenceOutsideComment(code.original, this.operator, this.left.end);
|
|
11049
11094
|
if (this.right.included) {
|
|
11095
|
+
const operatorPos = findFirstOccurrenceOutsideComment(code.original, this.operator, this.left.end);
|
|
11050
11096
|
const removePos = findNonWhiteSpace(code.original, operatorPos + 2);
|
|
11051
11097
|
code.remove(this.start, removePos);
|
|
11052
11098
|
if (preventASI) {
|
|
@@ -11055,7 +11101,7 @@ class LogicalExpression extends NodeBase {
|
|
|
11055
11101
|
this.left.removeAnnotations(code);
|
|
11056
11102
|
}
|
|
11057
11103
|
else {
|
|
11058
|
-
code.remove(
|
|
11104
|
+
code.remove(this.left.end, this.end);
|
|
11059
11105
|
}
|
|
11060
11106
|
this.getUsedBranch().render(code, options, {
|
|
11061
11107
|
isCalleeOfRenderedParent,
|
|
@@ -11515,7 +11561,9 @@ class PropertyDefinition extends NodeBase {
|
|
|
11515
11561
|
: UNKNOWN_RETURN_EXPRESSION;
|
|
11516
11562
|
}
|
|
11517
11563
|
hasEffects(context) {
|
|
11518
|
-
return this.key.hasEffects(context) ||
|
|
11564
|
+
return (this.key.hasEffects(context) ||
|
|
11565
|
+
(this.static && !!this.value?.hasEffects(context)) ||
|
|
11566
|
+
checkEffectForNodes(this.decorators, context));
|
|
11519
11567
|
}
|
|
11520
11568
|
hasEffectsOnInteractionAtPath(path, interaction, context) {
|
|
11521
11569
|
return !this.value || this.value.hasEffectsOnInteractionAtPath(path, interaction, context);
|
|
@@ -12425,6 +12473,7 @@ const nodeTypeStrings = [
|
|
|
12425
12473
|
'ConditionalExpression',
|
|
12426
12474
|
'ContinueStatement',
|
|
12427
12475
|
'DebuggerStatement',
|
|
12476
|
+
'Decorator',
|
|
12428
12477
|
'ExpressionStatement',
|
|
12429
12478
|
'DoWhileStatement',
|
|
12430
12479
|
'EmptyStatement',
|
|
@@ -12506,6 +12555,7 @@ const nodeConstructors$1 = [
|
|
|
12506
12555
|
ConditionalExpression,
|
|
12507
12556
|
ContinueStatement,
|
|
12508
12557
|
DebuggerStatement,
|
|
12558
|
+
Decorator,
|
|
12509
12559
|
ExpressionStatement,
|
|
12510
12560
|
DoWhileStatement,
|
|
12511
12561
|
EmptyStatement,
|
|
@@ -12657,22 +12707,24 @@ const bufferParsers = [
|
|
|
12657
12707
|
},
|
|
12658
12708
|
function classDeclaration(node, position, buffer) {
|
|
12659
12709
|
const { scope } = node;
|
|
12660
|
-
|
|
12710
|
+
node.decorators = convertNodeList(node, scope, buffer[position], buffer);
|
|
12711
|
+
const idPosition = buffer[position + 1];
|
|
12661
12712
|
node.id =
|
|
12662
12713
|
idPosition === 0 ? null : convertNode(node, scope.parent, idPosition, buffer);
|
|
12663
|
-
const superClassPosition = buffer[position +
|
|
12714
|
+
const superClassPosition = buffer[position + 2];
|
|
12664
12715
|
node.superClass =
|
|
12665
12716
|
superClassPosition === 0 ? null : convertNode(node, scope, superClassPosition, buffer);
|
|
12666
|
-
node.body = convertNode(node, scope, buffer[position +
|
|
12717
|
+
node.body = convertNode(node, scope, buffer[position + 3], buffer);
|
|
12667
12718
|
},
|
|
12668
12719
|
function classExpression(node, position, buffer) {
|
|
12669
12720
|
const { scope } = node;
|
|
12670
|
-
|
|
12721
|
+
node.decorators = convertNodeList(node, scope, buffer[position], buffer);
|
|
12722
|
+
const idPosition = buffer[position + 1];
|
|
12671
12723
|
node.id = idPosition === 0 ? null : convertNode(node, scope, idPosition, buffer);
|
|
12672
|
-
const superClassPosition = buffer[position +
|
|
12724
|
+
const superClassPosition = buffer[position + 2];
|
|
12673
12725
|
node.superClass =
|
|
12674
12726
|
superClassPosition === 0 ? null : convertNode(node, scope, superClassPosition, buffer);
|
|
12675
|
-
node.body = convertNode(node, scope, buffer[position +
|
|
12727
|
+
node.body = convertNode(node, scope, buffer[position + 3], buffer);
|
|
12676
12728
|
},
|
|
12677
12729
|
function conditionalExpression(node, position, buffer) {
|
|
12678
12730
|
const { scope } = node;
|
|
@@ -12686,6 +12738,10 @@ const bufferParsers = [
|
|
|
12686
12738
|
node.label = labelPosition === 0 ? null : convertNode(node, scope, labelPosition, buffer);
|
|
12687
12739
|
},
|
|
12688
12740
|
function debuggerStatement() { },
|
|
12741
|
+
function decorator(node, position, buffer) {
|
|
12742
|
+
const { scope } = node;
|
|
12743
|
+
node.expression = convertNode(node, scope, buffer[position], buffer);
|
|
12744
|
+
},
|
|
12689
12745
|
function directive(node, position, buffer) {
|
|
12690
12746
|
const { scope } = node;
|
|
12691
12747
|
node.directive = buffer.convertString(buffer[position]);
|
|
@@ -12886,9 +12942,10 @@ const bufferParsers = [
|
|
|
12886
12942
|
const flags = buffer[position];
|
|
12887
12943
|
node.static = (flags & 1) === 1;
|
|
12888
12944
|
node.computed = (flags & 2) === 2;
|
|
12889
|
-
node.
|
|
12890
|
-
node.
|
|
12891
|
-
node.
|
|
12945
|
+
node.decorators = convertNodeList(node, scope, buffer[position + 1], buffer);
|
|
12946
|
+
node.key = convertNode(node, scope, buffer[position + 2], buffer);
|
|
12947
|
+
node.value = convertNode(node, scope, buffer[position + 3], buffer);
|
|
12948
|
+
node.kind = FIXED_STRINGS[buffer[position + 4]];
|
|
12892
12949
|
},
|
|
12893
12950
|
function newExpression(node, position, buffer) {
|
|
12894
12951
|
const { scope } = node;
|
|
@@ -12928,8 +12985,9 @@ const bufferParsers = [
|
|
|
12928
12985
|
const flags = buffer[position];
|
|
12929
12986
|
node.static = (flags & 1) === 1;
|
|
12930
12987
|
node.computed = (flags & 2) === 2;
|
|
12931
|
-
node.
|
|
12932
|
-
|
|
12988
|
+
node.decorators = convertNodeList(node, scope, buffer[position + 1], buffer);
|
|
12989
|
+
node.key = convertNode(node, scope, buffer[position + 2], buffer);
|
|
12990
|
+
const valuePosition = buffer[position + 3];
|
|
12933
12991
|
node.value = valuePosition === 0 ? null : convertNode(node, scope, valuePosition, buffer);
|
|
12934
12992
|
},
|
|
12935
12993
|
function restElement(node, position, buffer) {
|
|
@@ -13093,6 +13151,7 @@ const nodeConstructors = {
|
|
|
13093
13151
|
ConditionalExpression,
|
|
13094
13152
|
ContinueStatement,
|
|
13095
13153
|
DebuggerStatement,
|
|
13154
|
+
Decorator,
|
|
13096
13155
|
DoWhileStatement,
|
|
13097
13156
|
EmptyStatement,
|
|
13098
13157
|
ExportAllDeclaration,
|
|
@@ -14632,8 +14691,11 @@ function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snip
|
|
|
14632
14691
|
return `${n}${n}${mechanism}${getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings, getPropertyAccess)};`;
|
|
14633
14692
|
}
|
|
14634
14693
|
let exportBlock = '';
|
|
14635
|
-
|
|
14636
|
-
|
|
14694
|
+
if (namedExportsMode) {
|
|
14695
|
+
for (const { defaultVariableName, importPath, isChunk, name, namedExportsMode: depNamedExportsMode, namespaceVariableName, reexports } of dependencies) {
|
|
14696
|
+
if (!reexports) {
|
|
14697
|
+
continue;
|
|
14698
|
+
}
|
|
14637
14699
|
for (const specifier of reexports) {
|
|
14638
14700
|
if (specifier.reexported !== '*') {
|
|
14639
14701
|
const importName = getReexportedImportName(name, specifier.imported, depNamedExportsMode, isChunk, defaultVariableName, namespaceVariableName, interop, importPath, externalLiveBindings, getPropertyAccess);
|
|
@@ -14677,8 +14739,11 @@ function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snip
|
|
|
14677
14739
|
: `${lhs}${_}=${_}${rhs};`;
|
|
14678
14740
|
}
|
|
14679
14741
|
}
|
|
14680
|
-
|
|
14681
|
-
|
|
14742
|
+
if (namedExportsMode) {
|
|
14743
|
+
for (const { name, reexports } of dependencies) {
|
|
14744
|
+
if (!reexports) {
|
|
14745
|
+
continue;
|
|
14746
|
+
}
|
|
14682
14747
|
for (const specifier of reexports) {
|
|
14683
14748
|
if (specifier.reexported === '*') {
|
|
14684
14749
|
if (exportBlock)
|
|
@@ -18257,7 +18322,7 @@ function addModuleToManualChunk(alias, module, manualChunkAliasByEntry) {
|
|
|
18257
18322
|
|
|
18258
18323
|
function flru (max) {
|
|
18259
18324
|
var num, curr, prev;
|
|
18260
|
-
var limit = max
|
|
18325
|
+
var limit = max;
|
|
18261
18326
|
|
|
18262
18327
|
function keep(key, value) {
|
|
18263
18328
|
if (++num > limit) {
|
|
@@ -20497,7 +20562,7 @@ const getIndent = (config, compact) => {
|
|
|
20497
20562
|
return '';
|
|
20498
20563
|
}
|
|
20499
20564
|
const configIndent = config.indent;
|
|
20500
|
-
return configIndent === false ? '' : configIndent ?? true;
|
|
20565
|
+
return configIndent === false ? '' : (configIndent ?? true);
|
|
20501
20566
|
};
|
|
20502
20567
|
const ALLOWED_INTEROP_TYPES = new Set([
|
|
20503
20568
|
'compat',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.19.0
|
|
4
|
+
Sat, 20 Jul 2024 05:45:44 GMT - commit 28546b5821efcb72c2eb05f422d986524647a0e3
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -1204,27 +1204,29 @@ const nodeConverters = [
|
|
|
1204
1204
|
};
|
|
1205
1205
|
},
|
|
1206
1206
|
function classDeclaration(position, buffer) {
|
|
1207
|
-
const idPosition = buffer[position +
|
|
1208
|
-
const superClassPosition = buffer[position +
|
|
1207
|
+
const idPosition = buffer[position + 3];
|
|
1208
|
+
const superClassPosition = buffer[position + 4];
|
|
1209
1209
|
return {
|
|
1210
1210
|
type: 'ClassDeclaration',
|
|
1211
1211
|
start: buffer[position],
|
|
1212
1212
|
end: buffer[position + 1],
|
|
1213
|
+
decorators: convertNodeList(buffer[position + 2], buffer),
|
|
1213
1214
|
id: idPosition === 0 ? null : convertNode(idPosition, buffer),
|
|
1214
1215
|
superClass: superClassPosition === 0 ? null : convertNode(superClassPosition, buffer),
|
|
1215
|
-
body: convertNode(buffer[position +
|
|
1216
|
+
body: convertNode(buffer[position + 5], buffer)
|
|
1216
1217
|
};
|
|
1217
1218
|
},
|
|
1218
1219
|
function classExpression(position, buffer) {
|
|
1219
|
-
const idPosition = buffer[position +
|
|
1220
|
-
const superClassPosition = buffer[position +
|
|
1220
|
+
const idPosition = buffer[position + 3];
|
|
1221
|
+
const superClassPosition = buffer[position + 4];
|
|
1221
1222
|
return {
|
|
1222
1223
|
type: 'ClassExpression',
|
|
1223
1224
|
start: buffer[position],
|
|
1224
1225
|
end: buffer[position + 1],
|
|
1226
|
+
decorators: convertNodeList(buffer[position + 2], buffer),
|
|
1225
1227
|
id: idPosition === 0 ? null : convertNode(idPosition, buffer),
|
|
1226
1228
|
superClass: superClassPosition === 0 ? null : convertNode(superClassPosition, buffer),
|
|
1227
|
-
body: convertNode(buffer[position +
|
|
1229
|
+
body: convertNode(buffer[position + 5], buffer)
|
|
1228
1230
|
};
|
|
1229
1231
|
},
|
|
1230
1232
|
function conditionalExpression(position, buffer) {
|
|
@@ -1253,6 +1255,14 @@ const nodeConverters = [
|
|
|
1253
1255
|
end: buffer[position + 1]
|
|
1254
1256
|
};
|
|
1255
1257
|
},
|
|
1258
|
+
function decorator(position, buffer) {
|
|
1259
|
+
return {
|
|
1260
|
+
type: 'Decorator',
|
|
1261
|
+
start: buffer[position],
|
|
1262
|
+
end: buffer[position + 1],
|
|
1263
|
+
expression: convertNode(buffer[position + 2], buffer)
|
|
1264
|
+
};
|
|
1265
|
+
},
|
|
1256
1266
|
function directive(position, buffer) {
|
|
1257
1267
|
return {
|
|
1258
1268
|
type: 'ExpressionStatement',
|
|
@@ -1585,9 +1595,10 @@ const nodeConverters = [
|
|
|
1585
1595
|
end: buffer[position + 1],
|
|
1586
1596
|
static: (flags & 1) === 1,
|
|
1587
1597
|
computed: (flags & 2) === 2,
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1598
|
+
decorators: convertNodeList(buffer[position + 3], buffer),
|
|
1599
|
+
key: convertNode(buffer[position + 4], buffer),
|
|
1600
|
+
value: convertNode(buffer[position + 5], buffer),
|
|
1601
|
+
kind: FIXED_STRINGS[buffer[position + 6]]
|
|
1591
1602
|
};
|
|
1592
1603
|
},
|
|
1593
1604
|
function newExpression(position, buffer) {
|
|
@@ -1654,14 +1665,15 @@ const nodeConverters = [
|
|
|
1654
1665
|
},
|
|
1655
1666
|
function propertyDefinition(position, buffer) {
|
|
1656
1667
|
const flags = buffer[position + 2];
|
|
1657
|
-
const valuePosition = buffer[position +
|
|
1668
|
+
const valuePosition = buffer[position + 5];
|
|
1658
1669
|
return {
|
|
1659
1670
|
type: 'PropertyDefinition',
|
|
1660
1671
|
start: buffer[position],
|
|
1661
1672
|
end: buffer[position + 1],
|
|
1662
1673
|
static: (flags & 1) === 1,
|
|
1663
1674
|
computed: (flags & 2) === 2,
|
|
1664
|
-
|
|
1675
|
+
decorators: convertNodeList(buffer[position + 3], buffer),
|
|
1676
|
+
key: convertNode(buffer[position + 4], buffer),
|
|
1665
1677
|
value: valuePosition === 0 ? null : convertNode(valuePosition, buffer)
|
|
1666
1678
|
};
|
|
1667
1679
|
},
|