rollup 3.4.0-0 → 3.4.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/rollup.js +2 -2
- package/dist/es/shared/rollup.js +5 -37
- package/dist/es/shared/watch.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/rollup.d.ts +0 -1
- package/dist/rollup.js +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/rollup.js +9 -41
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/package.json +1 -1
package/dist/bin/rollup
CHANGED
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 v3.4.0
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.4.0
|
|
4
|
+
Tue, 22 Nov 2022 05:15:54 GMT - commit 780e3421e8a498f3248fd7d8506e97fcee8dd1e6
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -16,7 +16,7 @@ import { promises } from 'node:fs';
|
|
|
16
16
|
import { EventEmitter } from 'node:events';
|
|
17
17
|
import * as tty from 'tty';
|
|
18
18
|
|
|
19
|
-
var version$1 = "3.4.0
|
|
19
|
+
var version$1 = "3.4.0";
|
|
20
20
|
|
|
21
21
|
var charToInteger = {};
|
|
22
22
|
var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
@@ -6840,19 +6840,6 @@ function is_reference (node, parent) {
|
|
|
6840
6840
|
return false;
|
|
6841
6841
|
}
|
|
6842
6842
|
|
|
6843
|
-
const PureFunctionKey = Symbol('PureFunction');
|
|
6844
|
-
const getPureFunctions = ({ treeshake }) => {
|
|
6845
|
-
const pureFunctions = Object.create(null);
|
|
6846
|
-
for (const functionName of treeshake ? treeshake.manualPureFunctions : []) {
|
|
6847
|
-
let currentFunctions = pureFunctions;
|
|
6848
|
-
for (const pathSegment of functionName.split('.')) {
|
|
6849
|
-
currentFunctions = currentFunctions[pathSegment] || (currentFunctions[pathSegment] = Object.create(null));
|
|
6850
|
-
}
|
|
6851
|
-
currentFunctions[PureFunctionKey] = true;
|
|
6852
|
-
}
|
|
6853
|
-
return pureFunctions;
|
|
6854
|
-
};
|
|
6855
|
-
|
|
6856
6843
|
/* eslint sort-keys: "off" */
|
|
6857
6844
|
const ValueProperties = Symbol('Value Properties');
|
|
6858
6845
|
const getTruthyLiteralValue = () => UnknownTruthyValue;
|
|
@@ -7031,6 +7018,7 @@ const knownGlobals = {
|
|
|
7031
7018
|
// deoptimizes everything anyway
|
|
7032
7019
|
defineProperty: MUTATES_ARG_WITHOUT_ACCESSOR,
|
|
7033
7020
|
defineProperties: MUTATES_ARG_WITHOUT_ACCESSOR,
|
|
7021
|
+
freeze: MUTATES_ARG_WITHOUT_ACCESSOR,
|
|
7034
7022
|
getOwnPropertyDescriptor: PF,
|
|
7035
7023
|
getOwnPropertyNames: PF,
|
|
7036
7024
|
getOwnPropertySymbols: PF,
|
|
@@ -7846,15 +7834,13 @@ class Identifier extends NodeBase {
|
|
|
7846
7834
|
switch (interaction.type) {
|
|
7847
7835
|
case INTERACTION_ACCESSED: {
|
|
7848
7836
|
return (this.variable !== null &&
|
|
7849
|
-
!this.isPureFunction(path) &&
|
|
7850
7837
|
this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(path, interaction, context));
|
|
7851
7838
|
}
|
|
7852
7839
|
case INTERACTION_ASSIGNED: {
|
|
7853
7840
|
return (path.length > 0 ? this.getVariableRespectingTDZ() : this.variable).hasEffectsOnInteractionAtPath(path, interaction, context);
|
|
7854
7841
|
}
|
|
7855
7842
|
case INTERACTION_CALLED: {
|
|
7856
|
-
return
|
|
7857
|
-
this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(path, interaction, context));
|
|
7843
|
+
return this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(path, interaction, context);
|
|
7858
7844
|
}
|
|
7859
7845
|
}
|
|
7860
7846
|
}
|
|
@@ -7936,18 +7922,6 @@ class Identifier extends NodeBase {
|
|
|
7936
7922
|
}
|
|
7937
7923
|
return this.variable;
|
|
7938
7924
|
}
|
|
7939
|
-
isPureFunction(path) {
|
|
7940
|
-
let currentPureFunction = this.context.manualPureFunctions[this.name];
|
|
7941
|
-
for (const segment of path) {
|
|
7942
|
-
if (currentPureFunction) {
|
|
7943
|
-
currentPureFunction = currentPureFunction[segment];
|
|
7944
|
-
}
|
|
7945
|
-
else {
|
|
7946
|
-
return false;
|
|
7947
|
-
}
|
|
7948
|
-
}
|
|
7949
|
-
return currentPureFunction?.[PureFunctionKey];
|
|
7950
|
-
}
|
|
7951
7925
|
}
|
|
7952
7926
|
function closestParentFunctionOrProgram(node) {
|
|
7953
7927
|
while (node && !/^Program|Function/.test(node.type)) {
|
|
@@ -13182,7 +13156,6 @@ class Module {
|
|
|
13182
13156
|
includeDynamicImport: this.includeDynamicImport.bind(this),
|
|
13183
13157
|
includeVariableInModule: this.includeVariableInModule.bind(this),
|
|
13184
13158
|
magicString: this.magicString,
|
|
13185
|
-
manualPureFunctions: this.graph.pureFunctions,
|
|
13186
13159
|
module: this,
|
|
13187
13160
|
moduleContext: this.context,
|
|
13188
13161
|
options: this.options,
|
|
@@ -23504,7 +23477,6 @@ class Graph {
|
|
|
23504
23477
|
this.acornParser = Parser.extend(...options.acornInjectPlugins);
|
|
23505
23478
|
this.moduleLoader = new ModuleLoader(this, this.modulesById, this.options, this.pluginDriver);
|
|
23506
23479
|
this.fileOperationQueue = new Queue(options.maxParallelFileOps);
|
|
23507
|
-
this.pureFunctions = getPureFunctions(options);
|
|
23508
23480
|
}
|
|
23509
23481
|
async build() {
|
|
23510
23482
|
timeStart('generate module graph', 2);
|
|
@@ -24004,7 +23976,6 @@ const treeshakePresets = {
|
|
|
24004
23976
|
recommended: {
|
|
24005
23977
|
annotations: true,
|
|
24006
23978
|
correctVarValueBeforeDeclaration: false,
|
|
24007
|
-
manualPureFunctions: EMPTY_ARRAY,
|
|
24008
23979
|
moduleSideEffects: () => true,
|
|
24009
23980
|
propertyReadSideEffects: true,
|
|
24010
23981
|
tryCatchDeoptimization: true,
|
|
@@ -24013,7 +23984,6 @@ const treeshakePresets = {
|
|
|
24013
23984
|
safest: {
|
|
24014
23985
|
annotations: true,
|
|
24015
23986
|
correctVarValueBeforeDeclaration: true,
|
|
24016
|
-
manualPureFunctions: EMPTY_ARRAY,
|
|
24017
23987
|
moduleSideEffects: () => true,
|
|
24018
23988
|
propertyReadSideEffects: true,
|
|
24019
23989
|
tryCatchDeoptimization: true,
|
|
@@ -24022,7 +23992,6 @@ const treeshakePresets = {
|
|
|
24022
23992
|
smallest: {
|
|
24023
23993
|
annotations: true,
|
|
24024
23994
|
correctVarValueBeforeDeclaration: false,
|
|
24025
|
-
manualPureFunctions: EMPTY_ARRAY,
|
|
24026
23995
|
moduleSideEffects: () => false,
|
|
24027
23996
|
propertyReadSideEffects: false,
|
|
24028
23997
|
tryCatchDeoptimization: false,
|
|
@@ -24219,7 +24188,6 @@ const getTreeshake = (config) => {
|
|
|
24219
24188
|
return {
|
|
24220
24189
|
annotations: configWithPreset.annotations !== false,
|
|
24221
24190
|
correctVarValueBeforeDeclaration: configWithPreset.correctVarValueBeforeDeclaration === true,
|
|
24222
|
-
manualPureFunctions: configWithPreset.manualPureFunctions ?? EMPTY_ARRAY,
|
|
24223
24191
|
moduleSideEffects: getHasModuleSideEffects(configWithPreset.moduleSideEffects),
|
|
24224
24192
|
propertyReadSideEffects: configWithPreset.propertyReadSideEffects === 'always'
|
|
24225
24193
|
? 'always'
|
package/dist/es/shared/watch.js
CHANGED
package/dist/loadConfigFile.js
CHANGED
package/dist/rollup.d.ts
CHANGED
|
@@ -466,7 +466,6 @@ type TreeshakingPreset = 'smallest' | 'safest' | 'recommended';
|
|
|
466
466
|
export interface NormalizedTreeshakingOptions {
|
|
467
467
|
annotations: boolean;
|
|
468
468
|
correctVarValueBeforeDeclaration: boolean;
|
|
469
|
-
manualPureFunctions: readonly string[];
|
|
470
469
|
moduleSideEffects: HasModuleSideEffects;
|
|
471
470
|
propertyReadSideEffects: boolean | 'always';
|
|
472
471
|
tryCatchDeoptimization: boolean;
|
package/dist/rollup.js
CHANGED
package/dist/shared/index.js
CHANGED
package/dist/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v3.4.0
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.4.0
|
|
4
|
+
Tue, 22 Nov 2022 05:15:54 GMT - commit 780e3421e8a498f3248fd7d8506e97fcee8dd1e6
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -31,7 +31,7 @@ function _interopNamespaceDefault(e) {
|
|
|
31
31
|
|
|
32
32
|
const tty__namespace = /*#__PURE__*/_interopNamespaceDefault(tty);
|
|
33
33
|
|
|
34
|
-
var version$1 = "3.4.0
|
|
34
|
+
var version$1 = "3.4.0";
|
|
35
35
|
|
|
36
36
|
function ensureArray$1(items) {
|
|
37
37
|
if (Array.isArray(items)) {
|
|
@@ -50,10 +50,6 @@ async function asyncFlatten(array) {
|
|
|
50
50
|
return array;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
const BLANK = Object.freeze(Object.create(null));
|
|
54
|
-
const EMPTY_OBJECT = Object.freeze({});
|
|
55
|
-
const EMPTY_ARRAY = Object.freeze([]);
|
|
56
|
-
|
|
57
53
|
function getLocator$1(source, options) {
|
|
58
54
|
if (options === void 0) { options = {}; }
|
|
59
55
|
var offsetLine = options.offsetLine || 0;
|
|
@@ -818,7 +814,6 @@ const treeshakePresets = {
|
|
|
818
814
|
recommended: {
|
|
819
815
|
annotations: true,
|
|
820
816
|
correctVarValueBeforeDeclaration: false,
|
|
821
|
-
manualPureFunctions: EMPTY_ARRAY,
|
|
822
817
|
moduleSideEffects: () => true,
|
|
823
818
|
propertyReadSideEffects: true,
|
|
824
819
|
tryCatchDeoptimization: true,
|
|
@@ -827,7 +822,6 @@ const treeshakePresets = {
|
|
|
827
822
|
safest: {
|
|
828
823
|
annotations: true,
|
|
829
824
|
correctVarValueBeforeDeclaration: true,
|
|
830
|
-
manualPureFunctions: EMPTY_ARRAY,
|
|
831
825
|
moduleSideEffects: () => true,
|
|
832
826
|
propertyReadSideEffects: true,
|
|
833
827
|
tryCatchDeoptimization: true,
|
|
@@ -836,7 +830,6 @@ const treeshakePresets = {
|
|
|
836
830
|
smallest: {
|
|
837
831
|
annotations: true,
|
|
838
832
|
correctVarValueBeforeDeclaration: false,
|
|
839
|
-
manualPureFunctions: EMPTY_ARRAY,
|
|
840
833
|
moduleSideEffects: () => false,
|
|
841
834
|
propertyReadSideEffects: false,
|
|
842
835
|
tryCatchDeoptimization: false,
|
|
@@ -3042,6 +3035,10 @@ class ExternalVariable extends Variable {
|
|
|
3042
3035
|
}
|
|
3043
3036
|
}
|
|
3044
3037
|
|
|
3038
|
+
const BLANK = Object.freeze(Object.create(null));
|
|
3039
|
+
const EMPTY_OBJECT = Object.freeze({});
|
|
3040
|
+
const EMPTY_ARRAY = Object.freeze([]);
|
|
3041
|
+
|
|
3045
3042
|
const RESERVED_NAMES = new Set([
|
|
3046
3043
|
'await',
|
|
3047
3044
|
'break',
|
|
@@ -7355,19 +7352,6 @@ function is_reference (node, parent) {
|
|
|
7355
7352
|
return false;
|
|
7356
7353
|
}
|
|
7357
7354
|
|
|
7358
|
-
const PureFunctionKey = Symbol('PureFunction');
|
|
7359
|
-
const getPureFunctions = ({ treeshake }) => {
|
|
7360
|
-
const pureFunctions = Object.create(null);
|
|
7361
|
-
for (const functionName of treeshake ? treeshake.manualPureFunctions : []) {
|
|
7362
|
-
let currentFunctions = pureFunctions;
|
|
7363
|
-
for (const pathSegment of functionName.split('.')) {
|
|
7364
|
-
currentFunctions = currentFunctions[pathSegment] || (currentFunctions[pathSegment] = Object.create(null));
|
|
7365
|
-
}
|
|
7366
|
-
currentFunctions[PureFunctionKey] = true;
|
|
7367
|
-
}
|
|
7368
|
-
return pureFunctions;
|
|
7369
|
-
};
|
|
7370
|
-
|
|
7371
7355
|
/* eslint sort-keys: "off" */
|
|
7372
7356
|
const ValueProperties = Symbol('Value Properties');
|
|
7373
7357
|
const getTruthyLiteralValue = () => UnknownTruthyValue;
|
|
@@ -7546,6 +7530,7 @@ const knownGlobals = {
|
|
|
7546
7530
|
// deoptimizes everything anyway
|
|
7547
7531
|
defineProperty: MUTATES_ARG_WITHOUT_ACCESSOR,
|
|
7548
7532
|
defineProperties: MUTATES_ARG_WITHOUT_ACCESSOR,
|
|
7533
|
+
freeze: MUTATES_ARG_WITHOUT_ACCESSOR,
|
|
7549
7534
|
getOwnPropertyDescriptor: PF,
|
|
7550
7535
|
getOwnPropertyNames: PF,
|
|
7551
7536
|
getOwnPropertySymbols: PF,
|
|
@@ -8361,15 +8346,13 @@ class Identifier extends NodeBase {
|
|
|
8361
8346
|
switch (interaction.type) {
|
|
8362
8347
|
case INTERACTION_ACCESSED: {
|
|
8363
8348
|
return (this.variable !== null &&
|
|
8364
|
-
!this.isPureFunction(path) &&
|
|
8365
8349
|
this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(path, interaction, context));
|
|
8366
8350
|
}
|
|
8367
8351
|
case INTERACTION_ASSIGNED: {
|
|
8368
8352
|
return (path.length > 0 ? this.getVariableRespectingTDZ() : this.variable).hasEffectsOnInteractionAtPath(path, interaction, context);
|
|
8369
8353
|
}
|
|
8370
8354
|
case INTERACTION_CALLED: {
|
|
8371
|
-
return
|
|
8372
|
-
this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(path, interaction, context));
|
|
8355
|
+
return this.getVariableRespectingTDZ().hasEffectsOnInteractionAtPath(path, interaction, context);
|
|
8373
8356
|
}
|
|
8374
8357
|
}
|
|
8375
8358
|
}
|
|
@@ -8451,18 +8434,6 @@ class Identifier extends NodeBase {
|
|
|
8451
8434
|
}
|
|
8452
8435
|
return this.variable;
|
|
8453
8436
|
}
|
|
8454
|
-
isPureFunction(path) {
|
|
8455
|
-
let currentPureFunction = this.context.manualPureFunctions[this.name];
|
|
8456
|
-
for (const segment of path) {
|
|
8457
|
-
if (currentPureFunction) {
|
|
8458
|
-
currentPureFunction = currentPureFunction[segment];
|
|
8459
|
-
}
|
|
8460
|
-
else {
|
|
8461
|
-
return false;
|
|
8462
|
-
}
|
|
8463
|
-
}
|
|
8464
|
-
return currentPureFunction?.[PureFunctionKey];
|
|
8465
|
-
}
|
|
8466
8437
|
}
|
|
8467
8438
|
function closestParentFunctionOrProgram(node) {
|
|
8468
8439
|
while (node && !/^Program|Function/.test(node.type)) {
|
|
@@ -13697,7 +13668,6 @@ class Module {
|
|
|
13697
13668
|
includeDynamicImport: this.includeDynamicImport.bind(this),
|
|
13698
13669
|
includeVariableInModule: this.includeVariableInModule.bind(this),
|
|
13699
13670
|
magicString: this.magicString,
|
|
13700
|
-
manualPureFunctions: this.graph.pureFunctions,
|
|
13701
13671
|
module: this,
|
|
13702
13672
|
moduleContext: this.context,
|
|
13703
13673
|
options: this.options,
|
|
@@ -24019,7 +23989,6 @@ class Graph {
|
|
|
24019
23989
|
this.acornParser = Parser.extend(...options.acornInjectPlugins);
|
|
24020
23990
|
this.moduleLoader = new ModuleLoader(this, this.modulesById, this.options, this.pluginDriver);
|
|
24021
23991
|
this.fileOperationQueue = new Queue(options.maxParallelFileOps);
|
|
24022
|
-
this.pureFunctions = getPureFunctions(options);
|
|
24023
23992
|
}
|
|
24024
23993
|
async build() {
|
|
24025
23994
|
timeStart('generate module graph', 2);
|
|
@@ -24637,7 +24606,6 @@ const getTreeshake = (config) => {
|
|
|
24637
24606
|
return {
|
|
24638
24607
|
annotations: configWithPreset.annotations !== false,
|
|
24639
24608
|
correctVarValueBeforeDeclaration: configWithPreset.correctVarValueBeforeDeclaration === true,
|
|
24640
|
-
manualPureFunctions: configWithPreset.manualPureFunctions ?? EMPTY_ARRAY,
|
|
24641
24609
|
moduleSideEffects: getHasModuleSideEffects(configWithPreset.moduleSideEffects),
|
|
24642
24610
|
propertyReadSideEffects: configWithPreset.propertyReadSideEffects === 'always'
|
|
24643
24611
|
? 'always'
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED