rollup 4.45.1 → 4.45.3
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 +34 -21
- package/dist/es/shared/parseAst.js +15 -6
- package/dist/es/shared/watch.js +2 -2
- package/dist/getLogFilter.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/native.js +1 -1
- package/dist/parseAst.js +2 -2
- 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 +15 -6
- package/dist/shared/rollup.js +34 -21
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/package.json +69 -74
package/dist/bin/rollup
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*
|
|
3
3
|
@license
|
|
4
|
-
Rollup.js v4.45.
|
|
5
|
-
|
|
4
|
+
Rollup.js v4.45.3
|
|
5
|
+
Sat, 26 Jul 2025 13:41:14 GMT - commit d6908c90c26220f490ff43b226e61288c864d06a
|
|
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.45.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.45.3
|
|
4
|
+
Sat, 26 Jul 2025 13:41:14 GMT - commit d6908c90c26220f490ff43b226e61288c864d06a
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -27,7 +27,7 @@ function _mergeNamespaces(n, m) {
|
|
|
27
27
|
return Object.defineProperty(n, Symbol.toStringTag, { value: 'Module' });
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
var version = "4.45.
|
|
30
|
+
var version = "4.45.3";
|
|
31
31
|
|
|
32
32
|
// src/vlq.ts
|
|
33
33
|
var comma = ",".charCodeAt(0);
|
|
@@ -7658,11 +7658,11 @@ function resolveNamespaceVariables(baseVariable, path, astContext) {
|
|
|
7658
7658
|
if (!baseVariable.isNamespace || baseVariable instanceof ExternalVariable)
|
|
7659
7659
|
return null;
|
|
7660
7660
|
const exportName = path[0].key;
|
|
7661
|
-
const variable = baseVariable.context.traceExport(exportName);
|
|
7661
|
+
const [variable, options] = baseVariable.context.traceExport(exportName);
|
|
7662
7662
|
if (!variable) {
|
|
7663
7663
|
if (path.length === 1) {
|
|
7664
7664
|
const fileName = baseVariable.context.fileName;
|
|
7665
|
-
astContext.log(LOGLEVEL_WARN, logMissingExport(exportName, astContext.module.id, fileName), path[0].pos);
|
|
7665
|
+
astContext.log(LOGLEVEL_WARN, logMissingExport(exportName, astContext.module.id, fileName, !!options?.missingButExportExists), path[0].pos);
|
|
7666
7666
|
return 'undefined';
|
|
7667
7667
|
}
|
|
7668
7668
|
return null;
|
|
@@ -7937,7 +7937,7 @@ class NamespaceVariable extends Variable {
|
|
|
7937
7937
|
const sortedExports = [...this.context.getExports(), ...this.context.getReexports()].sort();
|
|
7938
7938
|
for (const name of sortedExports) {
|
|
7939
7939
|
if (name[0] !== '*' && name !== this.module.info.syntheticNamedExports) {
|
|
7940
|
-
const exportedVariable = this.context.traceExport(name);
|
|
7940
|
+
const [exportedVariable] = this.context.traceExport(name);
|
|
7941
7941
|
if (exportedVariable) {
|
|
7942
7942
|
memberVariables[name] = exportedVariable;
|
|
7943
7943
|
}
|
|
@@ -9179,6 +9179,7 @@ function requireConstants () {
|
|
|
9179
9179
|
|
|
9180
9180
|
// Replace globs with equivalent patterns to reduce parsing time.
|
|
9181
9181
|
REPLACEMENTS: {
|
|
9182
|
+
__proto__: null,
|
|
9182
9183
|
'***': '*',
|
|
9183
9184
|
'**/**': '**',
|
|
9184
9185
|
'**/**/**': '**'
|
|
@@ -11558,13 +11559,18 @@ ObjectPattern.prototype.includeNode = onlyIncludeSelfNoDeoptimize;
|
|
|
11558
11559
|
ObjectPattern.prototype.applyDeoptimizations = doNotDeoptimize;
|
|
11559
11560
|
|
|
11560
11561
|
class AssignmentExpression extends NodeBase {
|
|
11562
|
+
constructor() {
|
|
11563
|
+
super(...arguments);
|
|
11564
|
+
this.isConstReassignment = false;
|
|
11565
|
+
}
|
|
11561
11566
|
hasEffects(context) {
|
|
11562
|
-
const { deoptimized, left, operator, right } = this;
|
|
11567
|
+
const { deoptimized, isConstReassignment, left, operator, right } = this;
|
|
11563
11568
|
if (!deoptimized)
|
|
11564
11569
|
this.applyDeoptimizations();
|
|
11565
11570
|
// MemberExpressions do not access the property before assignments if the
|
|
11566
11571
|
// operator is '='.
|
|
11567
|
-
return (
|
|
11572
|
+
return (isConstReassignment ||
|
|
11573
|
+
right.hasEffects(context) ||
|
|
11568
11574
|
left.hasEffectsAsAssignmentTarget(context, operator !== '=') ||
|
|
11569
11575
|
this.left.hasEffectsWhenDestructuring?.(context, EMPTY_PATH, right));
|
|
11570
11576
|
}
|
|
@@ -11572,13 +11578,14 @@ class AssignmentExpression extends NodeBase {
|
|
|
11572
11578
|
return this.right.hasEffectsOnInteractionAtPath(path, interaction, context);
|
|
11573
11579
|
}
|
|
11574
11580
|
include(context, includeChildrenRecursively) {
|
|
11575
|
-
const { deoptimized, left, right, operator } = this;
|
|
11581
|
+
const { deoptimized, isConstReassignment, left, right, operator } = this;
|
|
11576
11582
|
if (!deoptimized)
|
|
11577
11583
|
this.applyDeoptimizations();
|
|
11578
11584
|
if (!this.included)
|
|
11579
11585
|
this.includeNode(context);
|
|
11580
11586
|
const hasEffectsContext = createHasEffectsContext();
|
|
11581
11587
|
if (includeChildrenRecursively ||
|
|
11588
|
+
isConstReassignment ||
|
|
11582
11589
|
operator !== '=' ||
|
|
11583
11590
|
left.included ||
|
|
11584
11591
|
left.hasEffectsAsAssignmentTarget(hasEffectsContext, false) ||
|
|
@@ -11598,7 +11605,8 @@ class AssignmentExpression extends NodeBase {
|
|
|
11598
11605
|
if (this.left instanceof Identifier) {
|
|
11599
11606
|
const variable = this.scope.variables.get(this.left.name);
|
|
11600
11607
|
if (variable?.kind === 'const') {
|
|
11601
|
-
this.
|
|
11608
|
+
this.isConstReassignment = true;
|
|
11609
|
+
this.scope.context.log(LOGLEVEL_WARN, logConstVariableReassignError(), this.left.start);
|
|
11602
11610
|
}
|
|
11603
11611
|
}
|
|
11604
11612
|
this.left.setAssignedValue(this.right);
|
|
@@ -16989,9 +16997,9 @@ class Module {
|
|
|
16989
16997
|
// export { foo } from './other'
|
|
16990
16998
|
const reexportDeclaration = this.reexportDescriptions.get(name);
|
|
16991
16999
|
if (reexportDeclaration) {
|
|
16992
|
-
const [variable] = getVariableForExportNameRecursive(reexportDeclaration.module, reexportDeclaration.localName, importerForSideEffects, false, searchedNamesAndModules);
|
|
17000
|
+
const [variable, options] = getVariableForExportNameRecursive(reexportDeclaration.module, reexportDeclaration.localName, importerForSideEffects, false, searchedNamesAndModules);
|
|
16993
17001
|
if (!variable) {
|
|
16994
|
-
return this.error(logMissingExport(reexportDeclaration.localName, this.id, reexportDeclaration.module.id), reexportDeclaration.start);
|
|
17002
|
+
return this.error(logMissingExport(reexportDeclaration.localName, this.id, reexportDeclaration.module.id, !!options?.missingButExportExists), reexportDeclaration.start);
|
|
16995
17003
|
}
|
|
16996
17004
|
if (importerForSideEffects) {
|
|
16997
17005
|
setAlternativeExporterIfCyclic(variable, importerForSideEffects, this);
|
|
@@ -17011,6 +17019,9 @@ class Module {
|
|
|
17011
17019
|
importerForSideEffects,
|
|
17012
17020
|
searchedNamesAndModules
|
|
17013
17021
|
});
|
|
17022
|
+
if (!variable) {
|
|
17023
|
+
return [null, { missingButExportExists: true }];
|
|
17024
|
+
}
|
|
17014
17025
|
if (importerForSideEffects) {
|
|
17015
17026
|
setAlternativeExporterIfCyclic(variable, importerForSideEffects, this);
|
|
17016
17027
|
getOrCreate(importerForSideEffects.sideEffectDependenciesByVariable, variable, (getNewSet)).add(this);
|
|
@@ -17201,7 +17212,7 @@ class Module {
|
|
|
17201
17212
|
newlyIncludedVariableInits: this.graph.newlyIncludedVariableInits,
|
|
17202
17213
|
options: this.options,
|
|
17203
17214
|
requestTreeshakingPass: () => (this.graph.needsTreeshakingPass = true),
|
|
17204
|
-
traceExport: (name) => this.getVariableForExportName(name)
|
|
17215
|
+
traceExport: (name) => this.getVariableForExportName(name),
|
|
17205
17216
|
traceVariable: this.traceVariable.bind(this),
|
|
17206
17217
|
usesTopLevelAwait: false
|
|
17207
17218
|
};
|
|
@@ -17274,9 +17285,9 @@ class Module {
|
|
|
17274
17285
|
if (otherModule instanceof Module && importDescription.name === '*') {
|
|
17275
17286
|
return otherModule.namespace;
|
|
17276
17287
|
}
|
|
17277
|
-
const [declaration] = getVariableForExportNameRecursive(otherModule, importDescription.name, importerForSideEffects || this, isExportAllSearch, searchedNamesAndModules);
|
|
17288
|
+
const [declaration, options] = getVariableForExportNameRecursive(otherModule, importDescription.name, importerForSideEffects || this, isExportAllSearch, searchedNamesAndModules);
|
|
17278
17289
|
if (!declaration) {
|
|
17279
|
-
return this.error(logMissingExport(importDescription.name, this.id, otherModule.id), importDescription.start);
|
|
17290
|
+
return this.error(logMissingExport(importDescription.name, this.id, otherModule.id, !!options?.missingButExportExists), importDescription.start);
|
|
17280
17291
|
}
|
|
17281
17292
|
return declaration;
|
|
17282
17293
|
}
|
|
@@ -17494,11 +17505,11 @@ class Module {
|
|
|
17494
17505
|
if (module.info.syntheticNamedExports === name) {
|
|
17495
17506
|
continue;
|
|
17496
17507
|
}
|
|
17497
|
-
const [variable,
|
|
17508
|
+
const [variable, options] = getVariableForExportNameRecursive(module, name, importerForSideEffects, true,
|
|
17498
17509
|
// We are creating a copy to handle the case where the same binding is
|
|
17499
17510
|
// imported through different namespace reexports gracefully
|
|
17500
17511
|
copyNameToModulesMap(searchedNamesAndModules));
|
|
17501
|
-
if (module instanceof ExternalModule || indirectExternal) {
|
|
17512
|
+
if (module instanceof ExternalModule || options?.indirectExternal) {
|
|
17502
17513
|
foundExternalDeclarations.add(variable);
|
|
17503
17514
|
}
|
|
17504
17515
|
else if (variable instanceof SyntheticNamedExportVariable) {
|
|
@@ -17526,7 +17537,7 @@ class Module {
|
|
|
17526
17537
|
if (foundDeclarationList.length > 1) {
|
|
17527
17538
|
this.options.onLog(LOGLEVEL_WARN, logAmbiguousExternalNamespaces(name, this.id, usedDeclaration.module.id, foundDeclarationList.map(declaration => declaration.module.id)));
|
|
17528
17539
|
}
|
|
17529
|
-
return [usedDeclaration, true];
|
|
17540
|
+
return [usedDeclaration, { indirectExternal: true }];
|
|
17530
17541
|
}
|
|
17531
17542
|
if (foundSyntheticDeclaration) {
|
|
17532
17543
|
return [foundSyntheticDeclaration];
|
|
@@ -22602,9 +22613,11 @@ class Graph {
|
|
|
22602
22613
|
warnForMissingExports() {
|
|
22603
22614
|
for (const module of this.modules) {
|
|
22604
22615
|
for (const importDescription of module.importDescriptions.values()) {
|
|
22605
|
-
if (importDescription.name !== '*'
|
|
22606
|
-
|
|
22607
|
-
|
|
22616
|
+
if (importDescription.name !== '*') {
|
|
22617
|
+
const [variable, options] = importDescription.module.getVariableForExportName(importDescription.name);
|
|
22618
|
+
if (!variable) {
|
|
22619
|
+
module.log(LOGLEVEL_WARN, logMissingExport(importDescription.name, module.id, importDescription.module.id, !!options?.missingButExportExists), importDescription.start);
|
|
22620
|
+
}
|
|
22608
22621
|
}
|
|
22609
22622
|
}
|
|
22610
22623
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.45.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.45.3
|
|
4
|
+
Sat, 26 Jul 2025 13:41:14 GMT - commit d6908c90c26220f490ff43b226e61288c864d06a
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -764,16 +764,25 @@ function logMissingEntryExport(binding, exporter) {
|
|
|
764
764
|
url: getRollupUrl(URL_NAME_IS_NOT_EXPORTED)
|
|
765
765
|
};
|
|
766
766
|
}
|
|
767
|
-
function logMissingExport(binding, importingModule, exporter) {
|
|
768
|
-
const
|
|
769
|
-
return {
|
|
767
|
+
function logMissingExport(binding, importingModule, exporter, missingButExportExists) {
|
|
768
|
+
const baseLog = {
|
|
770
769
|
binding,
|
|
771
770
|
code: MISSING_EXPORT,
|
|
772
771
|
exporter,
|
|
773
772
|
id: importingModule,
|
|
774
|
-
message: `"${binding}" is not exported by "${relativeId(exporter)}", imported by "${relativeId(importingModule)}".${isJson ? ' (Note that you need @rollup/plugin-json to import JSON files)' : ''}`,
|
|
775
773
|
url: getRollupUrl(URL_NAME_IS_NOT_EXPORTED)
|
|
776
774
|
};
|
|
775
|
+
if (missingButExportExists) {
|
|
776
|
+
return {
|
|
777
|
+
...baseLog,
|
|
778
|
+
message: `Exported variable "${binding}" is not defined in "${relativeId(exporter)}", but it is imported by "${relativeId(importingModule)}".`
|
|
779
|
+
};
|
|
780
|
+
}
|
|
781
|
+
const isJson = extname(exporter) === '.json';
|
|
782
|
+
return {
|
|
783
|
+
...baseLog,
|
|
784
|
+
message: `"${binding}" is not exported by "${relativeId(exporter)}", imported by "${relativeId(importingModule)}".${isJson ? ' (Note that you need @rollup/plugin-json to import JSON files)' : ''}`
|
|
785
|
+
};
|
|
777
786
|
}
|
|
778
787
|
function logMissingGlobalName(externalId, guess) {
|
|
779
788
|
return {
|
package/dist/es/shared/watch.js
CHANGED
package/dist/getLogFilter.js
CHANGED
package/dist/loadConfigFile.js
CHANGED
package/dist/native.js
CHANGED
|
@@ -21,7 +21,7 @@ const bindingsByPlatformAndArch = {
|
|
|
21
21
|
arm: { base: 'linux-arm-gnueabihf', musl: 'linux-arm-musleabihf' },
|
|
22
22
|
arm64: { base: 'linux-arm64-gnu', musl: 'linux-arm64-musl' },
|
|
23
23
|
loong64: { base: 'linux-loongarch64-gnu', musl: null },
|
|
24
|
-
ppc64: { base: 'linux-
|
|
24
|
+
ppc64: { base: 'linux-ppc64-gnu', musl: null },
|
|
25
25
|
riscv64: { base: 'linux-riscv64-gnu', musl: 'linux-riscv64-musl' },
|
|
26
26
|
s390x: { base: 'linux-s390x-gnu', musl: null },
|
|
27
27
|
x64: { base: 'linux-x64-gnu', musl: 'linux-x64-musl' }
|
package/dist/parseAst.js
CHANGED
package/dist/rollup.js
CHANGED
package/dist/shared/index.js
CHANGED
package/dist/shared/parseAst.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.45.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.45.3
|
|
4
|
+
Sat, 26 Jul 2025 13:41:14 GMT - commit d6908c90c26220f490ff43b226e61288c864d06a
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -694,16 +694,25 @@ function logMissingEntryExport(binding, exporter) {
|
|
|
694
694
|
url: getRollupUrl(URL_NAME_IS_NOT_EXPORTED)
|
|
695
695
|
};
|
|
696
696
|
}
|
|
697
|
-
function logMissingExport(binding, importingModule, exporter) {
|
|
698
|
-
const
|
|
699
|
-
return {
|
|
697
|
+
function logMissingExport(binding, importingModule, exporter, missingButExportExists) {
|
|
698
|
+
const baseLog = {
|
|
700
699
|
binding,
|
|
701
700
|
code: MISSING_EXPORT,
|
|
702
701
|
exporter,
|
|
703
702
|
id: importingModule,
|
|
704
|
-
message: `"${binding}" is not exported by "${relativeId(exporter)}", imported by "${relativeId(importingModule)}".${isJson ? ' (Note that you need @rollup/plugin-json to import JSON files)' : ''}`,
|
|
705
703
|
url: getRollupUrl(URL_NAME_IS_NOT_EXPORTED)
|
|
706
704
|
};
|
|
705
|
+
if (missingButExportExists) {
|
|
706
|
+
return {
|
|
707
|
+
...baseLog,
|
|
708
|
+
message: `Exported variable "${binding}" is not defined in "${relativeId(exporter)}", but it is imported by "${relativeId(importingModule)}".`
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
const isJson = path.extname(exporter) === '.json';
|
|
712
|
+
return {
|
|
713
|
+
...baseLog,
|
|
714
|
+
message: `"${binding}" is not exported by "${relativeId(exporter)}", imported by "${relativeId(importingModule)}".${isJson ? ' (Note that you need @rollup/plugin-json to import JSON files)' : ''}`
|
|
715
|
+
};
|
|
707
716
|
}
|
|
708
717
|
function logMissingExternalConfig(file) {
|
|
709
718
|
return {
|
package/dist/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.45.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.45.3
|
|
4
|
+
Sat, 26 Jul 2025 13:41:14 GMT - commit d6908c90c26220f490ff43b226e61288c864d06a
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -42,7 +42,7 @@ function _mergeNamespaces(n, m) {
|
|
|
42
42
|
|
|
43
43
|
const promises__namespace = /*#__PURE__*/_interopNamespaceDefault(promises);
|
|
44
44
|
|
|
45
|
-
var version = "4.45.
|
|
45
|
+
var version = "4.45.3";
|
|
46
46
|
|
|
47
47
|
function ensureArray$1(items) {
|
|
48
48
|
if (Array.isArray(items)) {
|
|
@@ -1076,6 +1076,7 @@ function requireConstants () {
|
|
|
1076
1076
|
|
|
1077
1077
|
// Replace globs with equivalent patterns to reduce parsing time.
|
|
1078
1078
|
REPLACEMENTS: {
|
|
1079
|
+
__proto__: null,
|
|
1079
1080
|
'***': '*',
|
|
1080
1081
|
'**/**': '**',
|
|
1081
1082
|
'**/**/**': '**'
|
|
@@ -11433,11 +11434,11 @@ function resolveNamespaceVariables(baseVariable, path, astContext) {
|
|
|
11433
11434
|
if (!baseVariable.isNamespace || baseVariable instanceof ExternalVariable)
|
|
11434
11435
|
return null;
|
|
11435
11436
|
const exportName = path[0].key;
|
|
11436
|
-
const variable = baseVariable.context.traceExport(exportName);
|
|
11437
|
+
const [variable, options] = baseVariable.context.traceExport(exportName);
|
|
11437
11438
|
if (!variable) {
|
|
11438
11439
|
if (path.length === 1) {
|
|
11439
11440
|
const fileName = baseVariable.context.fileName;
|
|
11440
|
-
astContext.log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logMissingExport(exportName, astContext.module.id, fileName), path[0].pos);
|
|
11441
|
+
astContext.log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logMissingExport(exportName, astContext.module.id, fileName, !!options?.missingButExportExists), path[0].pos);
|
|
11441
11442
|
return 'undefined';
|
|
11442
11443
|
}
|
|
11443
11444
|
return null;
|
|
@@ -11712,7 +11713,7 @@ class NamespaceVariable extends Variable {
|
|
|
11712
11713
|
const sortedExports = [...this.context.getExports(), ...this.context.getReexports()].sort();
|
|
11713
11714
|
for (const name of sortedExports) {
|
|
11714
11715
|
if (name[0] !== '*' && name !== this.module.info.syntheticNamedExports) {
|
|
11715
|
-
const exportedVariable = this.context.traceExport(name);
|
|
11716
|
+
const [exportedVariable] = this.context.traceExport(name);
|
|
11716
11717
|
if (exportedVariable) {
|
|
11717
11718
|
memberVariables[name] = exportedVariable;
|
|
11718
11719
|
}
|
|
@@ -13167,13 +13168,18 @@ ObjectPattern.prototype.includeNode = onlyIncludeSelfNoDeoptimize;
|
|
|
13167
13168
|
ObjectPattern.prototype.applyDeoptimizations = doNotDeoptimize;
|
|
13168
13169
|
|
|
13169
13170
|
class AssignmentExpression extends NodeBase {
|
|
13171
|
+
constructor() {
|
|
13172
|
+
super(...arguments);
|
|
13173
|
+
this.isConstReassignment = false;
|
|
13174
|
+
}
|
|
13170
13175
|
hasEffects(context) {
|
|
13171
|
-
const { deoptimized, left, operator, right } = this;
|
|
13176
|
+
const { deoptimized, isConstReassignment, left, operator, right } = this;
|
|
13172
13177
|
if (!deoptimized)
|
|
13173
13178
|
this.applyDeoptimizations();
|
|
13174
13179
|
// MemberExpressions do not access the property before assignments if the
|
|
13175
13180
|
// operator is '='.
|
|
13176
|
-
return (
|
|
13181
|
+
return (isConstReassignment ||
|
|
13182
|
+
right.hasEffects(context) ||
|
|
13177
13183
|
left.hasEffectsAsAssignmentTarget(context, operator !== '=') ||
|
|
13178
13184
|
this.left.hasEffectsWhenDestructuring?.(context, EMPTY_PATH, right));
|
|
13179
13185
|
}
|
|
@@ -13181,13 +13187,14 @@ class AssignmentExpression extends NodeBase {
|
|
|
13181
13187
|
return this.right.hasEffectsOnInteractionAtPath(path, interaction, context);
|
|
13182
13188
|
}
|
|
13183
13189
|
include(context, includeChildrenRecursively) {
|
|
13184
|
-
const { deoptimized, left, right, operator } = this;
|
|
13190
|
+
const { deoptimized, isConstReassignment, left, right, operator } = this;
|
|
13185
13191
|
if (!deoptimized)
|
|
13186
13192
|
this.applyDeoptimizations();
|
|
13187
13193
|
if (!this.included)
|
|
13188
13194
|
this.includeNode(context);
|
|
13189
13195
|
const hasEffectsContext = createHasEffectsContext();
|
|
13190
13196
|
if (includeChildrenRecursively ||
|
|
13197
|
+
isConstReassignment ||
|
|
13191
13198
|
operator !== '=' ||
|
|
13192
13199
|
left.included ||
|
|
13193
13200
|
left.hasEffectsAsAssignmentTarget(hasEffectsContext, false) ||
|
|
@@ -13207,7 +13214,8 @@ class AssignmentExpression extends NodeBase {
|
|
|
13207
13214
|
if (this.left instanceof Identifier) {
|
|
13208
13215
|
const variable = this.scope.variables.get(this.left.name);
|
|
13209
13216
|
if (variable?.kind === 'const') {
|
|
13210
|
-
this.
|
|
13217
|
+
this.isConstReassignment = true;
|
|
13218
|
+
this.scope.context.log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logConstVariableReassignError(), this.left.start);
|
|
13211
13219
|
}
|
|
13212
13220
|
}
|
|
13213
13221
|
this.left.setAssignedValue(this.right);
|
|
@@ -18591,9 +18599,9 @@ class Module {
|
|
|
18591
18599
|
// export { foo } from './other'
|
|
18592
18600
|
const reexportDeclaration = this.reexportDescriptions.get(name);
|
|
18593
18601
|
if (reexportDeclaration) {
|
|
18594
|
-
const [variable] = getVariableForExportNameRecursive(reexportDeclaration.module, reexportDeclaration.localName, importerForSideEffects, false, searchedNamesAndModules);
|
|
18602
|
+
const [variable, options] = getVariableForExportNameRecursive(reexportDeclaration.module, reexportDeclaration.localName, importerForSideEffects, false, searchedNamesAndModules);
|
|
18595
18603
|
if (!variable) {
|
|
18596
|
-
return this.error(parseAst_js.logMissingExport(reexportDeclaration.localName, this.id, reexportDeclaration.module.id), reexportDeclaration.start);
|
|
18604
|
+
return this.error(parseAst_js.logMissingExport(reexportDeclaration.localName, this.id, reexportDeclaration.module.id, !!options?.missingButExportExists), reexportDeclaration.start);
|
|
18597
18605
|
}
|
|
18598
18606
|
if (importerForSideEffects) {
|
|
18599
18607
|
setAlternativeExporterIfCyclic(variable, importerForSideEffects, this);
|
|
@@ -18613,6 +18621,9 @@ class Module {
|
|
|
18613
18621
|
importerForSideEffects,
|
|
18614
18622
|
searchedNamesAndModules
|
|
18615
18623
|
});
|
|
18624
|
+
if (!variable) {
|
|
18625
|
+
return [null, { missingButExportExists: true }];
|
|
18626
|
+
}
|
|
18616
18627
|
if (importerForSideEffects) {
|
|
18617
18628
|
setAlternativeExporterIfCyclic(variable, importerForSideEffects, this);
|
|
18618
18629
|
getOrCreate(importerForSideEffects.sideEffectDependenciesByVariable, variable, (getNewSet)).add(this);
|
|
@@ -18803,7 +18814,7 @@ class Module {
|
|
|
18803
18814
|
newlyIncludedVariableInits: this.graph.newlyIncludedVariableInits,
|
|
18804
18815
|
options: this.options,
|
|
18805
18816
|
requestTreeshakingPass: () => (this.graph.needsTreeshakingPass = true),
|
|
18806
|
-
traceExport: (name) => this.getVariableForExportName(name)
|
|
18817
|
+
traceExport: (name) => this.getVariableForExportName(name),
|
|
18807
18818
|
traceVariable: this.traceVariable.bind(this),
|
|
18808
18819
|
usesTopLevelAwait: false
|
|
18809
18820
|
};
|
|
@@ -18876,9 +18887,9 @@ class Module {
|
|
|
18876
18887
|
if (otherModule instanceof Module && importDescription.name === '*') {
|
|
18877
18888
|
return otherModule.namespace;
|
|
18878
18889
|
}
|
|
18879
|
-
const [declaration] = getVariableForExportNameRecursive(otherModule, importDescription.name, importerForSideEffects || this, isExportAllSearch, searchedNamesAndModules);
|
|
18890
|
+
const [declaration, options] = getVariableForExportNameRecursive(otherModule, importDescription.name, importerForSideEffects || this, isExportAllSearch, searchedNamesAndModules);
|
|
18880
18891
|
if (!declaration) {
|
|
18881
|
-
return this.error(parseAst_js.logMissingExport(importDescription.name, this.id, otherModule.id), importDescription.start);
|
|
18892
|
+
return this.error(parseAst_js.logMissingExport(importDescription.name, this.id, otherModule.id, !!options?.missingButExportExists), importDescription.start);
|
|
18882
18893
|
}
|
|
18883
18894
|
return declaration;
|
|
18884
18895
|
}
|
|
@@ -19096,11 +19107,11 @@ class Module {
|
|
|
19096
19107
|
if (module.info.syntheticNamedExports === name) {
|
|
19097
19108
|
continue;
|
|
19098
19109
|
}
|
|
19099
|
-
const [variable,
|
|
19110
|
+
const [variable, options] = getVariableForExportNameRecursive(module, name, importerForSideEffects, true,
|
|
19100
19111
|
// We are creating a copy to handle the case where the same binding is
|
|
19101
19112
|
// imported through different namespace reexports gracefully
|
|
19102
19113
|
copyNameToModulesMap(searchedNamesAndModules));
|
|
19103
|
-
if (module instanceof ExternalModule || indirectExternal) {
|
|
19114
|
+
if (module instanceof ExternalModule || options?.indirectExternal) {
|
|
19104
19115
|
foundExternalDeclarations.add(variable);
|
|
19105
19116
|
}
|
|
19106
19117
|
else if (variable instanceof SyntheticNamedExportVariable) {
|
|
@@ -19128,7 +19139,7 @@ class Module {
|
|
|
19128
19139
|
if (foundDeclarationList.length > 1) {
|
|
19129
19140
|
this.options.onLog(parseAst_js.LOGLEVEL_WARN, parseAst_js.logAmbiguousExternalNamespaces(name, this.id, usedDeclaration.module.id, foundDeclarationList.map(declaration => declaration.module.id)));
|
|
19130
19141
|
}
|
|
19131
|
-
return [usedDeclaration, true];
|
|
19142
|
+
return [usedDeclaration, { indirectExternal: true }];
|
|
19132
19143
|
}
|
|
19133
19144
|
if (foundSyntheticDeclaration) {
|
|
19134
19145
|
return [foundSyntheticDeclaration];
|
|
@@ -22973,9 +22984,11 @@ class Graph {
|
|
|
22973
22984
|
warnForMissingExports() {
|
|
22974
22985
|
for (const module of this.modules) {
|
|
22975
22986
|
for (const importDescription of module.importDescriptions.values()) {
|
|
22976
|
-
if (importDescription.name !== '*'
|
|
22977
|
-
|
|
22978
|
-
|
|
22987
|
+
if (importDescription.name !== '*') {
|
|
22988
|
+
const [variable, options] = importDescription.module.getVariableForExportName(importDescription.name);
|
|
22989
|
+
if (!variable) {
|
|
22990
|
+
module.log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logMissingExport(importDescription.name, module.id, importDescription.module.id, !!options?.missingButExportExists), importDescription.start);
|
|
22991
|
+
}
|
|
22979
22992
|
}
|
|
22980
22993
|
}
|
|
22981
22994
|
}
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rollup",
|
|
3
|
-
"version": "4.45.
|
|
3
|
+
"version": "4.45.3",
|
|
4
4
|
"description": "Next-generation ES module bundler",
|
|
5
5
|
"main": "dist/rollup.js",
|
|
6
6
|
"module": "dist/es/rollup.js",
|
|
@@ -9,40 +9,35 @@
|
|
|
9
9
|
"rollup": "dist/bin/rollup"
|
|
10
10
|
},
|
|
11
11
|
"napi": {
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"x86_64-unknown-freebsd",
|
|
37
|
-
"x86_64-unknown-linux-gnu",
|
|
38
|
-
"x86_64-unknown-linux-musl"
|
|
39
|
-
]
|
|
40
|
-
}
|
|
12
|
+
"binaryName": "rollup",
|
|
13
|
+
"packageName": "@rollup/rollup",
|
|
14
|
+
"targets": [
|
|
15
|
+
"aarch64-apple-darwin",
|
|
16
|
+
"aarch64-linux-android",
|
|
17
|
+
"aarch64-pc-windows-msvc",
|
|
18
|
+
"aarch64-unknown-freebsd",
|
|
19
|
+
"aarch64-unknown-linux-gnu",
|
|
20
|
+
"aarch64-unknown-linux-musl",
|
|
21
|
+
"armv7-linux-androideabi",
|
|
22
|
+
"armv7-unknown-linux-gnueabihf",
|
|
23
|
+
"armv7-unknown-linux-musleabihf",
|
|
24
|
+
"i686-pc-windows-msvc",
|
|
25
|
+
"loongarch64-unknown-linux-gnu",
|
|
26
|
+
"riscv64gc-unknown-linux-gnu",
|
|
27
|
+
"riscv64gc-unknown-linux-musl",
|
|
28
|
+
"powerpc64le-unknown-linux-gnu",
|
|
29
|
+
"s390x-unknown-linux-gnu",
|
|
30
|
+
"x86_64-apple-darwin",
|
|
31
|
+
"x86_64-pc-windows-msvc",
|
|
32
|
+
"x86_64-unknown-freebsd",
|
|
33
|
+
"x86_64-unknown-linux-gnu",
|
|
34
|
+
"x86_64-unknown-linux-musl"
|
|
35
|
+
]
|
|
41
36
|
},
|
|
42
37
|
"scripts": {
|
|
43
38
|
"build": "concurrently -c green,blue \"npm run build:wasm\" \"npm:build:ast-converters\" && concurrently -c green,blue \"npm run build:napi -- --release\" \"npm:build:js\" && npm run build:copy-native",
|
|
44
39
|
"build:quick": "concurrently -c green,blue 'npm:build:napi' 'npm:build:cjs' && npm run build:copy-native",
|
|
45
|
-
"build:napi": "napi build --platform --dts native.d.ts --js
|
|
40
|
+
"build:napi": "napi build --platform --dts native.d.ts --no-js --output-dir . --manifest-path rust/bindings_napi/Cargo.toml",
|
|
46
41
|
"build:wasm": "cross-env RUSTFLAGS=\"-C opt-level=z\" wasm-pack build rust/bindings_wasm --out-dir ../../wasm --target web --no-pack && shx rm wasm/.gitignore",
|
|
47
42
|
"build:wasm:node": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm-node --target nodejs --no-pack && shx rm wasm-node/.gitignore",
|
|
48
43
|
"update:napi": "npm run build:napi && npm run build:copy-native",
|
|
@@ -75,7 +70,7 @@
|
|
|
75
70
|
"prepare": "husky && node scripts/check-release.js || npm run build:prepare",
|
|
76
71
|
"prepublishOnly": "node scripts/check-release.js && node scripts/prepublish.js",
|
|
77
72
|
"postpublish": "node scripts/postpublish.js",
|
|
78
|
-
"prepublish:napi": "napi prepublish --
|
|
73
|
+
"prepublish:napi": "napi prepublish --no-gh-release",
|
|
79
74
|
"release": "node scripts/prepare-release.js",
|
|
80
75
|
"release:docs": "git fetch --update-head-ok origin master:master && git branch --force documentation-published master && git push origin documentation-published",
|
|
81
76
|
"test": "npm run build && npm run test:all",
|
|
@@ -109,26 +104,26 @@
|
|
|
109
104
|
"homepage": "https://rollupjs.org/",
|
|
110
105
|
"optionalDependencies": {
|
|
111
106
|
"fsevents": "~2.3.2",
|
|
112
|
-
"@rollup/rollup-darwin-arm64": "4.45.
|
|
113
|
-
"@rollup/rollup-android-arm64": "4.45.
|
|
114
|
-
"@rollup/rollup-win32-arm64-msvc": "4.45.
|
|
115
|
-
"@rollup/rollup-freebsd-arm64": "4.45.
|
|
116
|
-
"@rollup/rollup-linux-arm64-gnu": "4.45.
|
|
117
|
-
"@rollup/rollup-linux-arm64-musl": "4.45.
|
|
118
|
-
"@rollup/rollup-android-arm-eabi": "4.45.
|
|
119
|
-
"@rollup/rollup-linux-arm-gnueabihf": "4.45.
|
|
120
|
-
"@rollup/rollup-linux-arm-musleabihf": "4.45.
|
|
121
|
-
"@rollup/rollup-win32-ia32-msvc": "4.45.
|
|
122
|
-
"@rollup/rollup-linux-loongarch64-gnu": "4.45.
|
|
123
|
-
"@rollup/rollup-linux-riscv64-gnu": "4.45.
|
|
124
|
-
"@rollup/rollup-linux-riscv64-musl": "4.45.
|
|
125
|
-
"@rollup/rollup-linux-
|
|
126
|
-
"@rollup/rollup-linux-s390x-gnu": "4.45.
|
|
127
|
-
"@rollup/rollup-darwin-x64": "4.45.
|
|
128
|
-
"@rollup/rollup-win32-x64-msvc": "4.45.
|
|
129
|
-
"@rollup/rollup-freebsd-x64": "4.45.
|
|
130
|
-
"@rollup/rollup-linux-x64-gnu": "4.45.
|
|
131
|
-
"@rollup/rollup-linux-x64-musl": "4.45.
|
|
107
|
+
"@rollup/rollup-darwin-arm64": "4.45.3",
|
|
108
|
+
"@rollup/rollup-android-arm64": "4.45.3",
|
|
109
|
+
"@rollup/rollup-win32-arm64-msvc": "4.45.3",
|
|
110
|
+
"@rollup/rollup-freebsd-arm64": "4.45.3",
|
|
111
|
+
"@rollup/rollup-linux-arm64-gnu": "4.45.3",
|
|
112
|
+
"@rollup/rollup-linux-arm64-musl": "4.45.3",
|
|
113
|
+
"@rollup/rollup-android-arm-eabi": "4.45.3",
|
|
114
|
+
"@rollup/rollup-linux-arm-gnueabihf": "4.45.3",
|
|
115
|
+
"@rollup/rollup-linux-arm-musleabihf": "4.45.3",
|
|
116
|
+
"@rollup/rollup-win32-ia32-msvc": "4.45.3",
|
|
117
|
+
"@rollup/rollup-linux-loongarch64-gnu": "4.45.3",
|
|
118
|
+
"@rollup/rollup-linux-riscv64-gnu": "4.45.3",
|
|
119
|
+
"@rollup/rollup-linux-riscv64-musl": "4.45.3",
|
|
120
|
+
"@rollup/rollup-linux-ppc64-gnu": "4.45.3",
|
|
121
|
+
"@rollup/rollup-linux-s390x-gnu": "4.45.3",
|
|
122
|
+
"@rollup/rollup-darwin-x64": "4.45.3",
|
|
123
|
+
"@rollup/rollup-win32-x64-msvc": "4.45.3",
|
|
124
|
+
"@rollup/rollup-freebsd-x64": "4.45.3",
|
|
125
|
+
"@rollup/rollup-linux-x64-gnu": "4.45.3",
|
|
126
|
+
"@rollup/rollup-linux-x64-musl": "4.45.3"
|
|
132
127
|
},
|
|
133
128
|
"dependencies": {
|
|
134
129
|
"@types/estree": "1.0.8"
|
|
@@ -142,12 +137,12 @@
|
|
|
142
137
|
"@codemirror/language": "^6.11.2",
|
|
143
138
|
"@codemirror/search": "^6.5.11",
|
|
144
139
|
"@codemirror/state": "^6.5.2",
|
|
145
|
-
"@codemirror/view": "^6.38.
|
|
146
|
-
"@eslint/js": "^9.
|
|
147
|
-
"@inquirer/prompts": "^7.
|
|
148
|
-
"@jridgewell/sourcemap-codec": "^1.5.
|
|
140
|
+
"@codemirror/view": "^6.38.1",
|
|
141
|
+
"@eslint/js": "^9.31.0",
|
|
142
|
+
"@inquirer/prompts": "^7.7.1",
|
|
143
|
+
"@jridgewell/sourcemap-codec": "^1.5.4",
|
|
149
144
|
"@mermaid-js/mermaid-cli": "^11.6.0",
|
|
150
|
-
"@napi-rs/cli": "^
|
|
145
|
+
"@napi-rs/cli": "^3.0.1",
|
|
151
146
|
"@rollup/plugin-alias": "^5.1.1",
|
|
152
147
|
"@rollup/plugin-buble": "^1.0.3",
|
|
153
148
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
@@ -157,13 +152,13 @@
|
|
|
157
152
|
"@rollup/plugin-terser": "^0.4.4",
|
|
158
153
|
"@rollup/plugin-typescript": "^12.1.4",
|
|
159
154
|
"@rollup/pluginutils": "^5.2.0",
|
|
160
|
-
"@shikijs/vitepress-twoslash": "^3.
|
|
155
|
+
"@shikijs/vitepress-twoslash": "^3.8.1",
|
|
161
156
|
"@types/mocha": "^10.0.10",
|
|
162
|
-
"@types/node": "^20.19.
|
|
163
|
-
"@types/picomatch": "^4.0.
|
|
157
|
+
"@types/node": "^20.19.9",
|
|
158
|
+
"@types/picomatch": "^4.0.1",
|
|
164
159
|
"@types/semver": "^7.7.0",
|
|
165
160
|
"@types/yargs-parser": "^21.0.3",
|
|
166
|
-
"@vue/language-server": "^
|
|
161
|
+
"@vue/language-server": "^3.0.3",
|
|
167
162
|
"acorn": "^8.15.0",
|
|
168
163
|
"acorn-import-assertions": "^1.9.0",
|
|
169
164
|
"acorn-jsx": "^5.3.2",
|
|
@@ -176,16 +171,16 @@
|
|
|
176
171
|
"date-time": "^4.0.0",
|
|
177
172
|
"es5-shim": "^4.6.7",
|
|
178
173
|
"es6-shim": "^0.35.8",
|
|
179
|
-
"eslint": "^9.
|
|
180
|
-
"eslint-config-prettier": "^10.1.
|
|
181
|
-
"eslint-plugin-prettier": "^5.5.
|
|
182
|
-
"eslint-plugin-unicorn": "^
|
|
183
|
-
"eslint-plugin-vue": "^10.
|
|
174
|
+
"eslint": "^9.31.0",
|
|
175
|
+
"eslint-config-prettier": "^10.1.8",
|
|
176
|
+
"eslint-plugin-prettier": "^5.5.3",
|
|
177
|
+
"eslint-plugin-unicorn": "^60.0.0",
|
|
178
|
+
"eslint-plugin-vue": "^10.3.0",
|
|
184
179
|
"fixturify": "^3.0.0",
|
|
185
180
|
"flru": "^1.0.2",
|
|
186
181
|
"fs-extra": "^11.3.0",
|
|
187
182
|
"github-api": "^3.4.0",
|
|
188
|
-
"globals": "^16.
|
|
183
|
+
"globals": "^16.3.0",
|
|
189
184
|
"husky": "^9.1.7",
|
|
190
185
|
"is-reference": "^3.0.3",
|
|
191
186
|
"lint-staged": "^16.1.2",
|
|
@@ -196,14 +191,14 @@
|
|
|
196
191
|
"nodemon": "^3.1.10",
|
|
197
192
|
"nyc": "^17.1.0",
|
|
198
193
|
"picocolors": "^1.1.1",
|
|
199
|
-
"picomatch": "^4.0.
|
|
194
|
+
"picomatch": "^4.0.3",
|
|
200
195
|
"pinia": "^3.0.3",
|
|
201
196
|
"prettier": "^3.6.2",
|
|
202
|
-
"prettier-plugin-organize-imports": "^4.
|
|
197
|
+
"prettier-plugin-organize-imports": "^4.2.0",
|
|
203
198
|
"pretty-bytes": "^7.0.0",
|
|
204
199
|
"pretty-ms": "^9.2.0",
|
|
205
200
|
"requirejs": "^2.3.7",
|
|
206
|
-
"rollup": "^4.
|
|
201
|
+
"rollup": "^4.45.1",
|
|
207
202
|
"rollup-plugin-license": "^3.6.0",
|
|
208
203
|
"rollup-plugin-string": "^3.0.0",
|
|
209
204
|
"semver": "^7.7.2",
|
|
@@ -215,12 +210,12 @@
|
|
|
215
210
|
"terser": "^5.43.1",
|
|
216
211
|
"tslib": "^2.8.1",
|
|
217
212
|
"typescript": "^5.8.3",
|
|
218
|
-
"typescript-eslint": "^8.
|
|
219
|
-
"vite": "^7.0.
|
|
213
|
+
"typescript-eslint": "^8.38.0",
|
|
214
|
+
"vite": "^7.0.5",
|
|
220
215
|
"vitepress": "^1.6.3",
|
|
221
|
-
"vue": "^3.5.
|
|
216
|
+
"vue": "^3.5.18",
|
|
222
217
|
"vue-eslint-parser": "^10.2.0",
|
|
223
|
-
"vue-tsc": "^2.2.
|
|
218
|
+
"vue-tsc": "^2.2.12",
|
|
224
219
|
"wasm-pack": "^0.13.1",
|
|
225
220
|
"yargs-parser": "^21.1.1"
|
|
226
221
|
},
|