rollup 2.50.2 → 2.50.6
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 +47 -0
- package/dist/bin/rollup +2 -2
- package/dist/es/rollup.browser.js +3 -3
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/rollup.js +124 -59
- package/dist/es/shared/watch.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/rollup.browser.js +3 -3
- package/dist/rollup.browser.js.map +1 -1
- package/dist/rollup.js +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/mergeOptions.js +2 -2
- package/dist/shared/rollup.js +124 -59
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/package.json +1 -1
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.50.
|
|
4
|
-
Thu,
|
|
3
|
+
Rollup.js v2.50.6
|
|
4
|
+
Thu, 03 Jun 2021 04:54:09 GMT - commit 9f69fe3f53ae50dffe932529a3503e619292d31a
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
@@ -14,7 +14,7 @@ import * as fs from 'fs';
|
|
|
14
14
|
import { lstatSync, realpathSync, readdirSync } from 'fs';
|
|
15
15
|
import { EventEmitter } from 'events';
|
|
16
16
|
|
|
17
|
-
var version$1 = "2.50.
|
|
17
|
+
var version$1 = "2.50.6";
|
|
18
18
|
|
|
19
19
|
var charToInteger = {};
|
|
20
20
|
var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
@@ -3397,10 +3397,11 @@ const knownGlobals = {
|
|
|
3397
3397
|
Promise: {
|
|
3398
3398
|
__proto__: null,
|
|
3399
3399
|
[ValueProperties]: IMPURE,
|
|
3400
|
-
all:
|
|
3400
|
+
all: O,
|
|
3401
3401
|
prototype: O,
|
|
3402
|
-
race:
|
|
3403
|
-
|
|
3402
|
+
race: O,
|
|
3403
|
+
reject: O,
|
|
3404
|
+
resolve: O
|
|
3404
3405
|
},
|
|
3405
3406
|
propertyIsEnumerable: O,
|
|
3406
3407
|
Proxy: O,
|
|
@@ -4194,6 +4195,7 @@ class Identifier extends NodeBase {
|
|
|
4194
4195
|
this.deoptimized = true;
|
|
4195
4196
|
if (this.variable !== null && this.variable instanceof LocalVariable) {
|
|
4196
4197
|
this.variable.consolidateInitializers();
|
|
4198
|
+
this.context.requestTreeshakingPass();
|
|
4197
4199
|
}
|
|
4198
4200
|
}
|
|
4199
4201
|
disallowImportReassignment() {
|
|
@@ -4985,11 +4987,22 @@ class SpreadElement extends NodeBase {
|
|
|
4985
4987
|
this.argument.deoptimizeThisOnEventAtPath(event, [UnknownKey, ...path], thisParameter, recursionTracker);
|
|
4986
4988
|
}
|
|
4987
4989
|
}
|
|
4990
|
+
hasEffects(context) {
|
|
4991
|
+
if (!this.deoptimized)
|
|
4992
|
+
this.applyDeoptimizations();
|
|
4993
|
+
const { propertyReadSideEffects } = this.context.options
|
|
4994
|
+
.treeshake;
|
|
4995
|
+
return (this.argument.hasEffects(context) ||
|
|
4996
|
+
(propertyReadSideEffects &&
|
|
4997
|
+
(propertyReadSideEffects === 'always' ||
|
|
4998
|
+
this.argument.hasEffectsWhenAccessedAtPath(UNKNOWN_PATH, context))));
|
|
4999
|
+
}
|
|
4988
5000
|
applyDeoptimizations() {
|
|
4989
5001
|
this.deoptimized = true;
|
|
4990
5002
|
// Only properties of properties of the argument could become subject to reassignment
|
|
4991
5003
|
// This will also reassign the return values of iterators
|
|
4992
5004
|
this.argument.deoptimizePath([UnknownKey, UnknownKey]);
|
|
5005
|
+
this.context.requestTreeshakingPass();
|
|
4993
5006
|
}
|
|
4994
5007
|
}
|
|
4995
5008
|
|
|
@@ -5139,6 +5152,7 @@ class RestElement extends NodeBase {
|
|
|
5139
5152
|
this.deoptimized = true;
|
|
5140
5153
|
if (this.declarationInit !== null) {
|
|
5141
5154
|
this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]);
|
|
5155
|
+
this.context.requestTreeshakingPass();
|
|
5142
5156
|
}
|
|
5143
5157
|
}
|
|
5144
5158
|
}
|
|
@@ -5176,7 +5190,7 @@ class FunctionNode extends NodeBase {
|
|
|
5176
5190
|
}
|
|
5177
5191
|
}
|
|
5178
5192
|
getReturnExpressionWhenCalledAtPath(path) {
|
|
5179
|
-
return path.length === 0 ? this.scope.getReturnExpression() : UNKNOWN_EXPRESSION;
|
|
5193
|
+
return !this.async && path.length === 0 ? this.scope.getReturnExpression() : UNKNOWN_EXPRESSION;
|
|
5180
5194
|
}
|
|
5181
5195
|
hasEffects() {
|
|
5182
5196
|
return this.id !== null && this.id.hasEffects();
|
|
@@ -5195,6 +5209,17 @@ class FunctionNode extends NodeBase {
|
|
|
5195
5209
|
hasEffectsWhenCalledAtPath(path, callOptions, context) {
|
|
5196
5210
|
if (path.length > 0)
|
|
5197
5211
|
return true;
|
|
5212
|
+
if (this.async) {
|
|
5213
|
+
const { propertyReadSideEffects } = this.context.options
|
|
5214
|
+
.treeshake;
|
|
5215
|
+
const returnExpression = this.scope.getReturnExpression();
|
|
5216
|
+
if (returnExpression.hasEffectsWhenCalledAtPath(['then'], { args: NO_ARGS, thisParam: null, withNew: false }, context) ||
|
|
5217
|
+
(propertyReadSideEffects &&
|
|
5218
|
+
(propertyReadSideEffects === 'always' ||
|
|
5219
|
+
returnExpression.hasEffectsWhenAccessedAtPath(['then'], context)))) {
|
|
5220
|
+
return true;
|
|
5221
|
+
}
|
|
5222
|
+
}
|
|
5198
5223
|
for (const param of this.params) {
|
|
5199
5224
|
if (param.hasEffects(context))
|
|
5200
5225
|
return true;
|
|
@@ -5934,7 +5959,7 @@ class ArrowFunctionExpression extends NodeBase {
|
|
|
5934
5959
|
// Arrow functions do not mutate their context
|
|
5935
5960
|
deoptimizeThisOnEventAtPath() { }
|
|
5936
5961
|
getReturnExpressionWhenCalledAtPath(path) {
|
|
5937
|
-
return path.length === 0 ? this.scope.getReturnExpression() : UNKNOWN_EXPRESSION;
|
|
5962
|
+
return !this.async && path.length === 0 ? this.scope.getReturnExpression() : UNKNOWN_EXPRESSION;
|
|
5938
5963
|
}
|
|
5939
5964
|
hasEffects() {
|
|
5940
5965
|
return false;
|
|
@@ -5948,6 +5973,17 @@ class ArrowFunctionExpression extends NodeBase {
|
|
|
5948
5973
|
hasEffectsWhenCalledAtPath(path, _callOptions, context) {
|
|
5949
5974
|
if (path.length > 0)
|
|
5950
5975
|
return true;
|
|
5976
|
+
if (this.async) {
|
|
5977
|
+
const { propertyReadSideEffects } = this.context.options
|
|
5978
|
+
.treeshake;
|
|
5979
|
+
const returnExpression = this.scope.getReturnExpression();
|
|
5980
|
+
if (returnExpression.hasEffectsWhenCalledAtPath(['then'], { args: NO_ARGS, thisParam: null, withNew: false }, context) ||
|
|
5981
|
+
(propertyReadSideEffects &&
|
|
5982
|
+
(propertyReadSideEffects === 'always' ||
|
|
5983
|
+
returnExpression.hasEffectsWhenAccessedAtPath(['then'], context)))) {
|
|
5984
|
+
return true;
|
|
5985
|
+
}
|
|
5986
|
+
}
|
|
5951
5987
|
for (const param of this.params) {
|
|
5952
5988
|
if (param.hasEffects(context))
|
|
5953
5989
|
return true;
|
|
@@ -6068,6 +6104,7 @@ class AssignmentExpression extends NodeBase {
|
|
|
6068
6104
|
this.deoptimized = true;
|
|
6069
6105
|
this.left.deoptimizePath(EMPTY_PATH);
|
|
6070
6106
|
this.right.deoptimizePath(UNKNOWN_PATH);
|
|
6107
|
+
this.context.requestTreeshakingPass();
|
|
6071
6108
|
}
|
|
6072
6109
|
}
|
|
6073
6110
|
|
|
@@ -6096,12 +6133,20 @@ class AssignmentPattern extends NodeBase {
|
|
|
6096
6133
|
this.deoptimized = true;
|
|
6097
6134
|
this.left.deoptimizePath(EMPTY_PATH);
|
|
6098
6135
|
this.right.deoptimizePath(UNKNOWN_PATH);
|
|
6136
|
+
this.context.requestTreeshakingPass();
|
|
6099
6137
|
}
|
|
6100
6138
|
}
|
|
6101
6139
|
|
|
6102
6140
|
class AwaitExpression extends NodeBase {
|
|
6103
6141
|
hasEffects(context) {
|
|
6104
|
-
|
|
6142
|
+
const { propertyReadSideEffects } = this.context.options
|
|
6143
|
+
.treeshake;
|
|
6144
|
+
return (!context.ignore.returnAwaitYield ||
|
|
6145
|
+
this.argument.hasEffects(context) ||
|
|
6146
|
+
this.argument.hasEffectsWhenCalledAtPath(['then'], { args: NO_ARGS, thisParam: null, withNew: false }, context) ||
|
|
6147
|
+
(propertyReadSideEffects &&
|
|
6148
|
+
(propertyReadSideEffects === 'always' ||
|
|
6149
|
+
this.argument.hasEffectsWhenAccessedAtPath(['then'], context))));
|
|
6105
6150
|
}
|
|
6106
6151
|
include(context, includeChildrenRecursively) {
|
|
6107
6152
|
if (!this.included) {
|
|
@@ -6382,10 +6427,9 @@ class MemberExpression extends NodeBase {
|
|
|
6382
6427
|
this.propertyKey = getResolvablePropertyKey(this);
|
|
6383
6428
|
}
|
|
6384
6429
|
render(code, options, { renderedParentType, isCalleeOfRenderedParent, renderedSurroundingElement } = BLANK) {
|
|
6385
|
-
const isCalleeOfDifferentParent = renderedParentType === CallExpression$1 && isCalleeOfRenderedParent;
|
|
6386
6430
|
if (this.variable || this.replacement) {
|
|
6387
6431
|
let replacement = this.variable ? this.variable.getName() : this.replacement;
|
|
6388
|
-
if (
|
|
6432
|
+
if (renderedParentType && isCalleeOfRenderedParent)
|
|
6389
6433
|
replacement = '0, ' + replacement;
|
|
6390
6434
|
code.overwrite(this.start, this.end, replacement, {
|
|
6391
6435
|
contentOnly: true,
|
|
@@ -6393,7 +6437,7 @@ class MemberExpression extends NodeBase {
|
|
|
6393
6437
|
});
|
|
6394
6438
|
}
|
|
6395
6439
|
else {
|
|
6396
|
-
if (
|
|
6440
|
+
if (renderedParentType && isCalleeOfRenderedParent) {
|
|
6397
6441
|
code.appendRight(this.start, '0, ');
|
|
6398
6442
|
}
|
|
6399
6443
|
const surroundingElement = renderedParentType || renderedSurroundingElement;
|
|
@@ -6417,6 +6461,7 @@ class MemberExpression extends NodeBase {
|
|
|
6417
6461
|
if (this.parent instanceof AssignmentExpression) {
|
|
6418
6462
|
this.object.deoptimizeThisOnEventAtPath(EVENT_ASSIGNED, [this.propertyKey], this.object, SHARED_RECURSION_TRACKER);
|
|
6419
6463
|
}
|
|
6464
|
+
this.context.requestTreeshakingPass();
|
|
6420
6465
|
}
|
|
6421
6466
|
}
|
|
6422
6467
|
disallowNamespaceReassignment() {
|
|
@@ -6601,7 +6646,10 @@ class CallExpression extends NodeBase {
|
|
|
6601
6646
|
}
|
|
6602
6647
|
render(code, options, { renderedParentType, renderedSurroundingElement } = BLANK) {
|
|
6603
6648
|
const surroundingELement = renderedParentType || renderedSurroundingElement;
|
|
6604
|
-
this.callee.render(code, options,
|
|
6649
|
+
this.callee.render(code, options, {
|
|
6650
|
+
isCalleeOfRenderedParent: true,
|
|
6651
|
+
renderedSurroundingElement: surroundingELement
|
|
6652
|
+
});
|
|
6605
6653
|
if (this.arguments.length > 0) {
|
|
6606
6654
|
if (this.arguments[this.arguments.length - 1].included) {
|
|
6607
6655
|
for (const arg of this.arguments) {
|
|
@@ -6635,6 +6683,7 @@ class CallExpression extends NodeBase {
|
|
|
6635
6683
|
// This will make sure all properties of parameters behave as "unknown"
|
|
6636
6684
|
argument.deoptimizePath(UNKNOWN_PATH);
|
|
6637
6685
|
}
|
|
6686
|
+
this.context.requestTreeshakingPass();
|
|
6638
6687
|
}
|
|
6639
6688
|
getReturnExpression(recursionTracker = SHARED_RECURSION_TRACKER) {
|
|
6640
6689
|
if (this.returnExpression === null) {
|
|
@@ -6647,12 +6696,14 @@ class CallExpression extends NodeBase {
|
|
|
6647
6696
|
|
|
6648
6697
|
class CatchScope extends ParameterScope {
|
|
6649
6698
|
addDeclaration(identifier, context, init, isHoisted) {
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
return super.addDeclaration(identifier, context, init, false);
|
|
6699
|
+
const existingParameter = this.variables.get(identifier.name);
|
|
6700
|
+
if (existingParameter) {
|
|
6701
|
+
existingParameter.addDeclaration(identifier, init);
|
|
6702
|
+
return existingParameter;
|
|
6655
6703
|
}
|
|
6704
|
+
// as parameters are handled differently, all remaining declarations are
|
|
6705
|
+
// hoisted
|
|
6706
|
+
return this.parent.addDeclaration(identifier, context, init, isHoisted);
|
|
6656
6707
|
}
|
|
6657
6708
|
}
|
|
6658
6709
|
|
|
@@ -6660,17 +6711,19 @@ class CatchClause extends NodeBase {
|
|
|
6660
6711
|
createScope(parentScope) {
|
|
6661
6712
|
this.scope = new CatchScope(parentScope, this.context);
|
|
6662
6713
|
}
|
|
6663
|
-
|
|
6664
|
-
|
|
6714
|
+
parseNode(esTreeNode) {
|
|
6715
|
+
// Parameters need to be declared first as the logic is that hoisted body
|
|
6716
|
+
// variables are associated with outside vars unless there is a parameter,
|
|
6717
|
+
// in which case they are associated with the parameter
|
|
6718
|
+
const { param } = esTreeNode;
|
|
6719
|
+
if (param) {
|
|
6720
|
+
this.param = new (this.context.nodeConstructors[param.type] ||
|
|
6721
|
+
this.context.nodeConstructors.UnknownNode)(param, this, this.scope);
|
|
6665
6722
|
this.param.declare('parameter', UNKNOWN_EXPRESSION);
|
|
6666
6723
|
}
|
|
6667
|
-
}
|
|
6668
|
-
parseNode(esTreeNode) {
|
|
6669
|
-
this.body = new this.context.nodeConstructors.BlockStatement(esTreeNode.body, this, this.scope);
|
|
6670
6724
|
super.parseNode(esTreeNode);
|
|
6671
6725
|
}
|
|
6672
6726
|
}
|
|
6673
|
-
CatchClause.prototype.preventChildBlockScope = true;
|
|
6674
6727
|
|
|
6675
6728
|
class ChainExpression extends NodeBase {
|
|
6676
6729
|
}
|
|
@@ -6867,7 +6920,7 @@ class ConditionalExpression extends NodeBase {
|
|
|
6867
6920
|
usedBranch.includeCallArguments(context, args);
|
|
6868
6921
|
}
|
|
6869
6922
|
}
|
|
6870
|
-
render(code, options, { isCalleeOfRenderedParent, renderedParentType,
|
|
6923
|
+
render(code, options, { isCalleeOfRenderedParent, preventASI, renderedParentType, renderedSurroundingElement } = BLANK) {
|
|
6871
6924
|
const usedBranch = this.getUsedBranch();
|
|
6872
6925
|
if (!this.test.included) {
|
|
6873
6926
|
const colonPos = findFirstOccurrenceOutsideComment(code.original, ':', this.consequent.end);
|
|
@@ -6883,16 +6936,16 @@ class ConditionalExpression extends NodeBase {
|
|
|
6883
6936
|
}
|
|
6884
6937
|
removeAnnotations(this, code);
|
|
6885
6938
|
usedBranch.render(code, options, {
|
|
6886
|
-
isCalleeOfRenderedParent
|
|
6887
|
-
? isCalleeOfRenderedParent
|
|
6888
|
-
: this.parent.callee === this,
|
|
6939
|
+
isCalleeOfRenderedParent,
|
|
6889
6940
|
preventASI: true,
|
|
6890
|
-
|
|
6941
|
+
...(renderedSurroundingElement
|
|
6942
|
+
? { renderedSurroundingElement }
|
|
6943
|
+
: { renderedParentType: renderedParentType || this.parent.type })
|
|
6891
6944
|
});
|
|
6892
6945
|
}
|
|
6893
6946
|
else {
|
|
6894
6947
|
this.test.render(code, options, {
|
|
6895
|
-
renderedSurroundingElement: renderedParentType
|
|
6948
|
+
renderedSurroundingElement: renderedParentType || renderedSurroundingElement
|
|
6896
6949
|
});
|
|
6897
6950
|
this.consequent.render(code, options);
|
|
6898
6951
|
this.alternate.render(code, options);
|
|
@@ -7040,6 +7093,7 @@ class ForInStatement extends NodeBase {
|
|
|
7040
7093
|
applyDeoptimizations() {
|
|
7041
7094
|
this.deoptimized = true;
|
|
7042
7095
|
this.left.deoptimizePath(EMPTY_PATH);
|
|
7096
|
+
this.context.requestTreeshakingPass();
|
|
7043
7097
|
}
|
|
7044
7098
|
}
|
|
7045
7099
|
|
|
@@ -7079,6 +7133,7 @@ class ForOfStatement extends NodeBase {
|
|
|
7079
7133
|
applyDeoptimizations() {
|
|
7080
7134
|
this.deoptimized = true;
|
|
7081
7135
|
this.left.deoptimizePath(EMPTY_PATH);
|
|
7136
|
+
this.context.requestTreeshakingPass();
|
|
7082
7137
|
}
|
|
7083
7138
|
}
|
|
7084
7139
|
|
|
@@ -7720,11 +7775,11 @@ class LogicalExpression extends NodeBase {
|
|
|
7720
7775
|
}
|
|
7721
7776
|
removeAnnotations(this, code);
|
|
7722
7777
|
this.getUsedBranch().render(code, options, {
|
|
7723
|
-
isCalleeOfRenderedParent
|
|
7724
|
-
? isCalleeOfRenderedParent
|
|
7725
|
-
: this.parent.callee === this,
|
|
7778
|
+
isCalleeOfRenderedParent,
|
|
7726
7779
|
preventASI,
|
|
7727
|
-
|
|
7780
|
+
...(renderedSurroundingElement
|
|
7781
|
+
? { renderedSurroundingElement }
|
|
7782
|
+
: { renderedParentType: renderedParentType || this.parent.type })
|
|
7728
7783
|
});
|
|
7729
7784
|
}
|
|
7730
7785
|
else {
|
|
@@ -8328,6 +8383,7 @@ class NewExpression extends NodeBase {
|
|
|
8328
8383
|
// This will make sure all properties of parameters behave as "unknown"
|
|
8329
8384
|
argument.deoptimizePath(UNKNOWN_PATH);
|
|
8330
8385
|
}
|
|
8386
|
+
this.context.requestTreeshakingPass();
|
|
8331
8387
|
}
|
|
8332
8388
|
}
|
|
8333
8389
|
|
|
@@ -8373,6 +8429,7 @@ class ObjectExpression extends NodeBase {
|
|
|
8373
8429
|
if (this.objectEntity !== null) {
|
|
8374
8430
|
return this.objectEntity;
|
|
8375
8431
|
}
|
|
8432
|
+
let prototype = OBJECT_PROTOTYPE;
|
|
8376
8433
|
const properties = [];
|
|
8377
8434
|
for (const property of this.properties) {
|
|
8378
8435
|
if (property instanceof SpreadElement) {
|
|
@@ -8396,13 +8453,16 @@ class ObjectExpression extends NodeBase {
|
|
|
8396
8453
|
? property.key.name
|
|
8397
8454
|
: String(property.key.value);
|
|
8398
8455
|
if (key === '__proto__' && property.kind === 'init') {
|
|
8399
|
-
|
|
8456
|
+
prototype =
|
|
8457
|
+
property.value instanceof Literal && property.value.value === null
|
|
8458
|
+
? null
|
|
8459
|
+
: property.value;
|
|
8400
8460
|
continue;
|
|
8401
8461
|
}
|
|
8402
8462
|
}
|
|
8403
8463
|
properties.push({ key, kind: property.kind, property });
|
|
8404
8464
|
}
|
|
8405
|
-
return (this.objectEntity = new ObjectEntity(properties,
|
|
8465
|
+
return (this.objectEntity = new ObjectEntity(properties, prototype));
|
|
8406
8466
|
}
|
|
8407
8467
|
}
|
|
8408
8468
|
|
|
@@ -8474,6 +8534,7 @@ class Property extends MethodBase {
|
|
|
8474
8534
|
this.deoptimized = true;
|
|
8475
8535
|
if (this.declarationInit !== null) {
|
|
8476
8536
|
this.declarationInit.deoptimizePath([UnknownKey, UnknownKey]);
|
|
8537
|
+
this.context.requestTreeshakingPass();
|
|
8477
8538
|
}
|
|
8478
8539
|
}
|
|
8479
8540
|
}
|
|
@@ -8542,13 +8603,10 @@ class ReturnStatement extends NodeBase {
|
|
|
8542
8603
|
|
|
8543
8604
|
class SequenceExpression extends NodeBase {
|
|
8544
8605
|
deoptimizePath(path) {
|
|
8545
|
-
|
|
8546
|
-
this.expressions[this.expressions.length - 1].deoptimizePath(path);
|
|
8606
|
+
this.expressions[this.expressions.length - 1].deoptimizePath(path);
|
|
8547
8607
|
}
|
|
8548
8608
|
deoptimizeThisOnEventAtPath(event, path, thisParameter, recursionTracker) {
|
|
8549
|
-
|
|
8550
|
-
this.expressions[this.expressions.length - 1].deoptimizeThisOnEventAtPath(event, path, thisParameter, recursionTracker);
|
|
8551
|
-
}
|
|
8609
|
+
this.expressions[this.expressions.length - 1].deoptimizeThisOnEventAtPath(event, path, thisParameter, recursionTracker);
|
|
8552
8610
|
}
|
|
8553
8611
|
getLiteralValueAtPath(path, recursionTracker, origin) {
|
|
8554
8612
|
return this.expressions[this.expressions.length - 1].getLiteralValueAtPath(path, recursionTracker, origin);
|
|
@@ -8565,8 +8623,7 @@ class SequenceExpression extends NodeBase {
|
|
|
8565
8623
|
this.expressions[this.expressions.length - 1].hasEffectsWhenAccessedAtPath(path, context));
|
|
8566
8624
|
}
|
|
8567
8625
|
hasEffectsWhenAssignedAtPath(path, context) {
|
|
8568
|
-
return
|
|
8569
|
-
this.expressions[this.expressions.length - 1].hasEffectsWhenAssignedAtPath(path, context));
|
|
8626
|
+
return this.expressions[this.expressions.length - 1].hasEffectsWhenAssignedAtPath(path, context);
|
|
8570
8627
|
}
|
|
8571
8628
|
hasEffectsWhenCalledAtPath(path, callOptions, context) {
|
|
8572
8629
|
return this.expressions[this.expressions.length - 1].hasEffectsWhenCalledAtPath(path, callOptions, context);
|
|
@@ -8595,13 +8652,18 @@ class SequenceExpression extends NodeBase {
|
|
|
8595
8652
|
if (includedNodes === 1 && preventASI) {
|
|
8596
8653
|
removeLineBreaks(code, start, node.start);
|
|
8597
8654
|
}
|
|
8598
|
-
if (
|
|
8599
|
-
node
|
|
8600
|
-
|
|
8601
|
-
|
|
8602
|
-
: this.parent.
|
|
8603
|
-
|
|
8604
|
-
}
|
|
8655
|
+
if (includedNodes === 1) {
|
|
8656
|
+
if (node === lastNode) {
|
|
8657
|
+
node.render(code, options, {
|
|
8658
|
+
isCalleeOfRenderedParent,
|
|
8659
|
+
renderedParentType: renderedParentType || this.parent.type
|
|
8660
|
+
});
|
|
8661
|
+
}
|
|
8662
|
+
else {
|
|
8663
|
+
node.render(code, options, {
|
|
8664
|
+
renderedSurroundingElement: renderedParentType || this.parent.type
|
|
8665
|
+
});
|
|
8666
|
+
}
|
|
8605
8667
|
}
|
|
8606
8668
|
else {
|
|
8607
8669
|
node.render(code, options);
|
|
@@ -8748,13 +8810,6 @@ class TaggedTemplateExpression extends NodeBase {
|
|
|
8748
8810
|
message: `Cannot call a namespace ('${name}')`
|
|
8749
8811
|
}, this.start);
|
|
8750
8812
|
}
|
|
8751
|
-
if (name === 'eval') {
|
|
8752
|
-
this.context.warn({
|
|
8753
|
-
code: 'EVAL',
|
|
8754
|
-
message: `Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification`,
|
|
8755
|
-
url: 'https://rollupjs.org/guide/en/#avoiding-eval'
|
|
8756
|
-
}, this.start);
|
|
8757
|
-
}
|
|
8758
8813
|
}
|
|
8759
8814
|
}
|
|
8760
8815
|
hasEffects(context) {
|
|
@@ -8768,6 +8823,10 @@ class TaggedTemplateExpression extends NodeBase {
|
|
|
8768
8823
|
withNew: false
|
|
8769
8824
|
};
|
|
8770
8825
|
}
|
|
8826
|
+
render(code, options) {
|
|
8827
|
+
this.tag.render(code, options, { isCalleeOfRenderedParent: true });
|
|
8828
|
+
this.quasi.render(code, options);
|
|
8829
|
+
}
|
|
8771
8830
|
}
|
|
8772
8831
|
|
|
8773
8832
|
class TemplateElement extends NodeBase {
|
|
@@ -9039,6 +9098,7 @@ class UnaryExpression extends NodeBase {
|
|
|
9039
9098
|
this.deoptimized = true;
|
|
9040
9099
|
if (this.operator === 'delete') {
|
|
9041
9100
|
this.argument.deoptimizePath(EMPTY_PATH);
|
|
9101
|
+
this.context.requestTreeshakingPass();
|
|
9042
9102
|
}
|
|
9043
9103
|
}
|
|
9044
9104
|
}
|
|
@@ -9107,6 +9167,7 @@ class UpdateExpression extends NodeBase {
|
|
|
9107
9167
|
const variable = this.scope.findVariable(this.argument.name);
|
|
9108
9168
|
variable.isReassigned = true;
|
|
9109
9169
|
}
|
|
9170
|
+
this.context.requestTreeshakingPass();
|
|
9110
9171
|
}
|
|
9111
9172
|
}
|
|
9112
9173
|
|
|
@@ -9192,9 +9253,12 @@ class YieldExpression extends NodeBase {
|
|
|
9192
9253
|
}
|
|
9193
9254
|
}
|
|
9194
9255
|
applyDeoptimizations() {
|
|
9195
|
-
var _a;
|
|
9196
9256
|
this.deoptimized = true;
|
|
9197
|
-
|
|
9257
|
+
const { argument } = this;
|
|
9258
|
+
if (argument) {
|
|
9259
|
+
argument.deoptimizePath(UNKNOWN_PATH);
|
|
9260
|
+
this.context.requestTreeshakingPass();
|
|
9261
|
+
}
|
|
9198
9262
|
}
|
|
9199
9263
|
}
|
|
9200
9264
|
|
|
@@ -10060,6 +10124,7 @@ class Module {
|
|
|
10060
10124
|
moduleContext: this.context,
|
|
10061
10125
|
nodeConstructors,
|
|
10062
10126
|
options: this.options,
|
|
10127
|
+
requestTreeshakingPass: () => (this.graph.needsTreeshakingPass = true),
|
|
10063
10128
|
traceExport: this.getVariableForExportName.bind(this),
|
|
10064
10129
|
traceVariable: this.traceVariable.bind(this),
|
|
10065
10130
|
usesTopLevelAwait: false,
|
package/dist/es/shared/watch.js
CHANGED
package/dist/loadConfigFile.js
CHANGED