rollup 3.2.3 → 3.2.5
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 +59 -23
- package/dist/es/shared/watch.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- 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 +59 -23
- 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.2.
|
|
4
|
-
Tue,
|
|
3
|
+
Rollup.js v3.2.5
|
|
4
|
+
Tue, 01 Nov 2022 05:28:36 GMT - commit 465d2396ba8dabba0366461d4014998cc13a9cc2
|
|
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.2.
|
|
19
|
+
var version$1 = "3.2.5";
|
|
20
20
|
|
|
21
21
|
var charToInteger = {};
|
|
22
22
|
var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
@@ -1825,6 +1825,7 @@ class Variable extends ExpressionEntity {
|
|
|
1825
1825
|
super();
|
|
1826
1826
|
this.name = name;
|
|
1827
1827
|
this.alwaysRendered = false;
|
|
1828
|
+
this.forbiddenNames = null;
|
|
1828
1829
|
this.initReached = false;
|
|
1829
1830
|
this.isId = false;
|
|
1830
1831
|
this.isReassigned = false;
|
|
@@ -1837,6 +1838,13 @@ class Variable extends ExpressionEntity {
|
|
|
1837
1838
|
* Necessary to be able to change variable names.
|
|
1838
1839
|
*/
|
|
1839
1840
|
addReference(_identifier) { }
|
|
1841
|
+
/**
|
|
1842
|
+
* Prevent this variable from being renamed to this name to avoid name
|
|
1843
|
+
* collisions
|
|
1844
|
+
*/
|
|
1845
|
+
forbidName(name) {
|
|
1846
|
+
(this.forbiddenNames || (this.forbiddenNames = new Set())).add(name);
|
|
1847
|
+
}
|
|
1840
1848
|
getBaseVariableName() {
|
|
1841
1849
|
return this.renderBaseName || this.renderName || this.name;
|
|
1842
1850
|
}
|
|
@@ -6562,10 +6570,10 @@ function toBase64(value) {
|
|
|
6562
6570
|
return outString;
|
|
6563
6571
|
}
|
|
6564
6572
|
|
|
6565
|
-
function getSafeName(baseName, usedNames) {
|
|
6573
|
+
function getSafeName(baseName, usedNames, forbiddenNames) {
|
|
6566
6574
|
let safeName = baseName;
|
|
6567
6575
|
let count = 1;
|
|
6568
|
-
while (usedNames.has(safeName) || RESERVED_NAMES$1.has(safeName)) {
|
|
6576
|
+
while (usedNames.has(safeName) || RESERVED_NAMES$1.has(safeName) || forbiddenNames?.has(safeName)) {
|
|
6569
6577
|
safeName = `${baseName}$${toBase64(count++)}`;
|
|
6570
6578
|
}
|
|
6571
6579
|
usedNames.add(safeName);
|
|
@@ -6658,7 +6666,7 @@ class ChildScope extends Scope$1 {
|
|
|
6658
6666
|
}
|
|
6659
6667
|
for (const [name, variable] of this.variables) {
|
|
6660
6668
|
if (variable.included || variable.alwaysRendered) {
|
|
6661
|
-
variable.setRenderNames(null, getSafeName(name, usedNames));
|
|
6669
|
+
variable.setRenderNames(null, getSafeName(name, usedNames, variable.forbiddenNames));
|
|
6662
6670
|
}
|
|
6663
6671
|
}
|
|
6664
6672
|
for (const scope of this.children) {
|
|
@@ -9634,6 +9642,18 @@ class ClassDeclaration extends ClassNode {
|
|
|
9634
9642
|
}
|
|
9635
9643
|
super.render(code, options);
|
|
9636
9644
|
}
|
|
9645
|
+
applyDeoptimizations() {
|
|
9646
|
+
super.applyDeoptimizations();
|
|
9647
|
+
const { id, scope } = this;
|
|
9648
|
+
if (id) {
|
|
9649
|
+
const { name, variable } = id;
|
|
9650
|
+
for (const accessedVariable of scope.accessedOutsideVariables.values()) {
|
|
9651
|
+
if (accessedVariable !== variable) {
|
|
9652
|
+
accessedVariable.forbidName(name);
|
|
9653
|
+
}
|
|
9654
|
+
}
|
|
9655
|
+
}
|
|
9656
|
+
}
|
|
9637
9657
|
}
|
|
9638
9658
|
|
|
9639
9659
|
class ClassExpression extends ClassNode {
|
|
@@ -11014,7 +11034,7 @@ const accessedFileUrlGlobals = {
|
|
|
11014
11034
|
umd: ['document', 'require', 'URL']
|
|
11015
11035
|
};
|
|
11016
11036
|
const getResolveUrl = (path, URL = 'URL') => `new ${URL}(${path}).href`;
|
|
11017
|
-
const getRelativeUrlFromDocument = (relativePath, umd = false) => getResolveUrl(`'${relativePath}', ${umd ? `typeof document === 'undefined' ? location.href : ` : ''}document.currentScript && document.currentScript.src || document.baseURI`);
|
|
11037
|
+
const getRelativeUrlFromDocument = (relativePath, umd = false) => getResolveUrl(`'${escapeId(relativePath)}', ${umd ? `typeof document === 'undefined' ? location.href : ` : ''}document.currentScript && document.currentScript.src || document.baseURI`);
|
|
11018
11038
|
const getGenericImportMetaMechanism = (getUrl) => (property, { chunkId }) => {
|
|
11019
11039
|
const urlMechanism = getUrl(chunkId);
|
|
11020
11040
|
return property === null
|
|
@@ -11023,7 +11043,7 @@ const getGenericImportMetaMechanism = (getUrl) => (property, { chunkId }) => {
|
|
|
11023
11043
|
? urlMechanism
|
|
11024
11044
|
: 'undefined';
|
|
11025
11045
|
};
|
|
11026
|
-
const getUrlFromDocument = (chunkId, umd = false) => `${umd ? `typeof document === 'undefined' ? location.href : ` : ''}(document.currentScript && document.currentScript.src || new URL('${chunkId}', document.baseURI).href)`;
|
|
11046
|
+
const getUrlFromDocument = (chunkId, umd = false) => `${umd ? `typeof document === 'undefined' ? location.href : ` : ''}(document.currentScript && document.currentScript.src || new URL('${escapeId(chunkId)}', document.baseURI).href)`;
|
|
11027
11047
|
const relativeUrlMechanisms = {
|
|
11028
11048
|
amd: relativePath => {
|
|
11029
11049
|
if (relativePath[0] !== '.')
|
|
@@ -12124,16 +12144,21 @@ class VariableDeclarator extends NodeBase {
|
|
|
12124
12144
|
this.id.deoptimizePath(path);
|
|
12125
12145
|
}
|
|
12126
12146
|
hasEffects(context) {
|
|
12147
|
+
if (!this.deoptimized)
|
|
12148
|
+
this.applyDeoptimizations();
|
|
12127
12149
|
const initEffect = this.init?.hasEffects(context);
|
|
12128
12150
|
this.id.markDeclarationReached();
|
|
12129
12151
|
return initEffect || this.id.hasEffects(context);
|
|
12130
12152
|
}
|
|
12131
12153
|
include(context, includeChildrenRecursively) {
|
|
12154
|
+
const { deoptimized, id, init } = this;
|
|
12155
|
+
if (!deoptimized)
|
|
12156
|
+
this.applyDeoptimizations();
|
|
12132
12157
|
this.included = true;
|
|
12133
|
-
|
|
12134
|
-
|
|
12135
|
-
if (includeChildrenRecursively ||
|
|
12136
|
-
|
|
12158
|
+
init?.include(context, includeChildrenRecursively);
|
|
12159
|
+
id.markDeclarationReached();
|
|
12160
|
+
if (includeChildrenRecursively || id.shouldBeIncluded(context)) {
|
|
12161
|
+
id.include(context, includeChildrenRecursively);
|
|
12137
12162
|
}
|
|
12138
12163
|
}
|
|
12139
12164
|
render(code, options) {
|
|
@@ -12161,7 +12186,18 @@ class VariableDeclarator extends NodeBase {
|
|
|
12161
12186
|
code.appendLeft(end, `${_}=${_}void 0`);
|
|
12162
12187
|
}
|
|
12163
12188
|
}
|
|
12164
|
-
applyDeoptimizations() {
|
|
12189
|
+
applyDeoptimizations() {
|
|
12190
|
+
this.deoptimized = true;
|
|
12191
|
+
const { id, init } = this;
|
|
12192
|
+
if (init && id instanceof Identifier && init instanceof ClassExpression && !init.id) {
|
|
12193
|
+
const { name, variable } = id;
|
|
12194
|
+
for (const accessedVariable of init.scope.accessedOutsideVariables.values()) {
|
|
12195
|
+
if (accessedVariable !== variable) {
|
|
12196
|
+
accessedVariable.forbidName(name);
|
|
12197
|
+
}
|
|
12198
|
+
}
|
|
12199
|
+
}
|
|
12200
|
+
}
|
|
12165
12201
|
}
|
|
12166
12202
|
|
|
12167
12203
|
class WhileStatement extends NodeBase {
|
|
@@ -14296,7 +14332,7 @@ function deconflictImportsEsmOrSystem(usedNames, imports, dependenciesToBeDeconf
|
|
|
14296
14332
|
// This is needed for namespace reexports
|
|
14297
14333
|
for (const dependency of dependenciesToBeDeconflicted.dependencies) {
|
|
14298
14334
|
if (preserveModules || dependency instanceof ExternalChunk) {
|
|
14299
|
-
dependency.variableName = getSafeName(dependency.suggestedVariableName, usedNames);
|
|
14335
|
+
dependency.variableName = getSafeName(dependency.suggestedVariableName, usedNames, null);
|
|
14300
14336
|
}
|
|
14301
14337
|
}
|
|
14302
14338
|
for (const variable of imports) {
|
|
@@ -14310,29 +14346,29 @@ function deconflictImportsEsmOrSystem(usedNames, imports, dependenciesToBeDeconf
|
|
|
14310
14346
|
else if (module instanceof ExternalModule && name === 'default') {
|
|
14311
14347
|
variable.setRenderNames(null, getSafeName([...module.exportedVariables].some(([exportedVariable, exportedName]) => exportedName === '*' && exportedVariable.included)
|
|
14312
14348
|
? module.suggestedVariableName + '__default'
|
|
14313
|
-
: module.suggestedVariableName, usedNames));
|
|
14349
|
+
: module.suggestedVariableName, usedNames, variable.forbiddenNames));
|
|
14314
14350
|
}
|
|
14315
14351
|
else {
|
|
14316
|
-
variable.setRenderNames(null, getSafeName(name, usedNames));
|
|
14352
|
+
variable.setRenderNames(null, getSafeName(name, usedNames, variable.forbiddenNames));
|
|
14317
14353
|
}
|
|
14318
14354
|
}
|
|
14319
14355
|
for (const variable of syntheticExports) {
|
|
14320
|
-
variable.setRenderNames(null, getSafeName(variable.name, usedNames));
|
|
14356
|
+
variable.setRenderNames(null, getSafeName(variable.name, usedNames, variable.forbiddenNames));
|
|
14321
14357
|
}
|
|
14322
14358
|
}
|
|
14323
14359
|
function deconflictImportsOther(usedNames, imports, { deconflictedDefault, deconflictedNamespace, dependencies }, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule) {
|
|
14324
14360
|
for (const chunk of dependencies) {
|
|
14325
|
-
chunk.variableName = getSafeName(chunk.suggestedVariableName, usedNames);
|
|
14361
|
+
chunk.variableName = getSafeName(chunk.suggestedVariableName, usedNames, null);
|
|
14326
14362
|
}
|
|
14327
14363
|
for (const chunk of deconflictedNamespace) {
|
|
14328
|
-
chunk.namespaceVariableName = getSafeName(`${chunk.suggestedVariableName}__namespace`, usedNames);
|
|
14364
|
+
chunk.namespaceVariableName = getSafeName(`${chunk.suggestedVariableName}__namespace`, usedNames, null);
|
|
14329
14365
|
}
|
|
14330
14366
|
for (const externalModule of deconflictedDefault) {
|
|
14331
14367
|
externalModule.defaultVariableName =
|
|
14332
14368
|
deconflictedNamespace.has(externalModule) &&
|
|
14333
14369
|
canDefaultBeTakenFromNamespace(interop(externalModule.id), externalLiveBindings)
|
|
14334
14370
|
? externalModule.namespaceVariableName
|
|
14335
|
-
: getSafeName(`${externalModule.suggestedVariableName}__default`, usedNames);
|
|
14371
|
+
: getSafeName(`${externalModule.suggestedVariableName}__default`, usedNames, null);
|
|
14336
14372
|
}
|
|
14337
14373
|
for (const variable of imports) {
|
|
14338
14374
|
const module = variable.module;
|
|
@@ -14382,12 +14418,12 @@ function deconflictTopLevelVariables(usedNames, modules, includedNamespaces) {
|
|
|
14382
14418
|
// this will only happen for exports in some formats
|
|
14383
14419
|
!(variable.renderBaseName ||
|
|
14384
14420
|
(variable instanceof ExportDefaultVariable && variable.getOriginalVariable() !== variable))) {
|
|
14385
|
-
variable.setRenderNames(null, getSafeName(variable.name, usedNames));
|
|
14421
|
+
variable.setRenderNames(null, getSafeName(variable.name, usedNames, variable.forbiddenNames));
|
|
14386
14422
|
}
|
|
14387
14423
|
}
|
|
14388
14424
|
if (includedNamespaces.has(module)) {
|
|
14389
14425
|
const namespace = module.namespace;
|
|
14390
|
-
namespace.setRenderNames(null, getSafeName(namespace.name, usedNames));
|
|
14426
|
+
namespace.setRenderNames(null, getSafeName(namespace.name, usedNames, namespace.forbiddenNames));
|
|
14391
14427
|
}
|
|
14392
14428
|
}
|
|
14393
14429
|
}
|
|
@@ -15256,7 +15292,7 @@ class Chunk {
|
|
|
15256
15292
|
if (predefinedChunkName)
|
|
15257
15293
|
return predefinedChunkName;
|
|
15258
15294
|
const { preserveModulesRoot, sanitizeFileName } = this.outputOptions;
|
|
15259
|
-
const sanitizedId = sanitizeFileName(module.id.split(QUERY_HASH_REGEX, 1)[0]);
|
|
15295
|
+
const sanitizedId = sanitizeFileName(normalize(module.id.split(QUERY_HASH_REGEX, 1)[0]));
|
|
15260
15296
|
const extensionName = extname(sanitizedId);
|
|
15261
15297
|
const idWithoutExtension = NON_ASSET_EXTENSIONS.has(extensionName)
|
|
15262
15298
|
? sanitizedId.slice(0, -extensionName.length)
|
package/dist/es/shared/watch.js
CHANGED
package/dist/loadConfigFile.js
CHANGED
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.2.
|
|
4
|
-
Tue,
|
|
3
|
+
Rollup.js v3.2.5
|
|
4
|
+
Tue, 01 Nov 2022 05:28:36 GMT - commit 465d2396ba8dabba0366461d4014998cc13a9cc2
|
|
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.2.
|
|
34
|
+
var version$1 = "3.2.5";
|
|
35
35
|
|
|
36
36
|
function ensureArray$1(items) {
|
|
37
37
|
if (Array.isArray(items)) {
|
|
@@ -2964,6 +2964,7 @@ class Variable extends ExpressionEntity {
|
|
|
2964
2964
|
super();
|
|
2965
2965
|
this.name = name;
|
|
2966
2966
|
this.alwaysRendered = false;
|
|
2967
|
+
this.forbiddenNames = null;
|
|
2967
2968
|
this.initReached = false;
|
|
2968
2969
|
this.isId = false;
|
|
2969
2970
|
this.isReassigned = false;
|
|
@@ -2976,6 +2977,13 @@ class Variable extends ExpressionEntity {
|
|
|
2976
2977
|
* Necessary to be able to change variable names.
|
|
2977
2978
|
*/
|
|
2978
2979
|
addReference(_identifier) { }
|
|
2980
|
+
/**
|
|
2981
|
+
* Prevent this variable from being renamed to this name to avoid name
|
|
2982
|
+
* collisions
|
|
2983
|
+
*/
|
|
2984
|
+
forbidName(name) {
|
|
2985
|
+
(this.forbiddenNames || (this.forbiddenNames = new Set())).add(name);
|
|
2986
|
+
}
|
|
2979
2987
|
getBaseVariableName() {
|
|
2980
2988
|
return this.renderBaseName || this.renderName || this.name;
|
|
2981
2989
|
}
|
|
@@ -7073,10 +7081,10 @@ function toBase64(value) {
|
|
|
7073
7081
|
return outString;
|
|
7074
7082
|
}
|
|
7075
7083
|
|
|
7076
|
-
function getSafeName(baseName, usedNames) {
|
|
7084
|
+
function getSafeName(baseName, usedNames, forbiddenNames) {
|
|
7077
7085
|
let safeName = baseName;
|
|
7078
7086
|
let count = 1;
|
|
7079
|
-
while (usedNames.has(safeName) || RESERVED_NAMES$1.has(safeName)) {
|
|
7087
|
+
while (usedNames.has(safeName) || RESERVED_NAMES$1.has(safeName) || forbiddenNames?.has(safeName)) {
|
|
7080
7088
|
safeName = `${baseName}$${toBase64(count++)}`;
|
|
7081
7089
|
}
|
|
7082
7090
|
usedNames.add(safeName);
|
|
@@ -7169,7 +7177,7 @@ class ChildScope extends Scope$1 {
|
|
|
7169
7177
|
}
|
|
7170
7178
|
for (const [name, variable] of this.variables) {
|
|
7171
7179
|
if (variable.included || variable.alwaysRendered) {
|
|
7172
|
-
variable.setRenderNames(null, getSafeName(name, usedNames));
|
|
7180
|
+
variable.setRenderNames(null, getSafeName(name, usedNames, variable.forbiddenNames));
|
|
7173
7181
|
}
|
|
7174
7182
|
}
|
|
7175
7183
|
for (const scope of this.children) {
|
|
@@ -10145,6 +10153,18 @@ class ClassDeclaration extends ClassNode {
|
|
|
10145
10153
|
}
|
|
10146
10154
|
super.render(code, options);
|
|
10147
10155
|
}
|
|
10156
|
+
applyDeoptimizations() {
|
|
10157
|
+
super.applyDeoptimizations();
|
|
10158
|
+
const { id, scope } = this;
|
|
10159
|
+
if (id) {
|
|
10160
|
+
const { name, variable } = id;
|
|
10161
|
+
for (const accessedVariable of scope.accessedOutsideVariables.values()) {
|
|
10162
|
+
if (accessedVariable !== variable) {
|
|
10163
|
+
accessedVariable.forbidName(name);
|
|
10164
|
+
}
|
|
10165
|
+
}
|
|
10166
|
+
}
|
|
10167
|
+
}
|
|
10148
10168
|
}
|
|
10149
10169
|
|
|
10150
10170
|
class ClassExpression extends ClassNode {
|
|
@@ -11525,7 +11545,7 @@ const accessedFileUrlGlobals = {
|
|
|
11525
11545
|
umd: ['document', 'require', 'URL']
|
|
11526
11546
|
};
|
|
11527
11547
|
const getResolveUrl = (path, URL = 'URL') => `new ${URL}(${path}).href`;
|
|
11528
|
-
const getRelativeUrlFromDocument = (relativePath, umd = false) => getResolveUrl(`'${relativePath}', ${umd ? `typeof document === 'undefined' ? location.href : ` : ''}document.currentScript && document.currentScript.src || document.baseURI`);
|
|
11548
|
+
const getRelativeUrlFromDocument = (relativePath, umd = false) => getResolveUrl(`'${escapeId(relativePath)}', ${umd ? `typeof document === 'undefined' ? location.href : ` : ''}document.currentScript && document.currentScript.src || document.baseURI`);
|
|
11529
11549
|
const getGenericImportMetaMechanism = (getUrl) => (property, { chunkId }) => {
|
|
11530
11550
|
const urlMechanism = getUrl(chunkId);
|
|
11531
11551
|
return property === null
|
|
@@ -11534,7 +11554,7 @@ const getGenericImportMetaMechanism = (getUrl) => (property, { chunkId }) => {
|
|
|
11534
11554
|
? urlMechanism
|
|
11535
11555
|
: 'undefined';
|
|
11536
11556
|
};
|
|
11537
|
-
const getUrlFromDocument = (chunkId, umd = false) => `${umd ? `typeof document === 'undefined' ? location.href : ` : ''}(document.currentScript && document.currentScript.src || new URL('${chunkId}', document.baseURI).href)`;
|
|
11557
|
+
const getUrlFromDocument = (chunkId, umd = false) => `${umd ? `typeof document === 'undefined' ? location.href : ` : ''}(document.currentScript && document.currentScript.src || new URL('${escapeId(chunkId)}', document.baseURI).href)`;
|
|
11538
11558
|
const relativeUrlMechanisms = {
|
|
11539
11559
|
amd: relativePath => {
|
|
11540
11560
|
if (relativePath[0] !== '.')
|
|
@@ -12635,16 +12655,21 @@ class VariableDeclarator extends NodeBase {
|
|
|
12635
12655
|
this.id.deoptimizePath(path);
|
|
12636
12656
|
}
|
|
12637
12657
|
hasEffects(context) {
|
|
12658
|
+
if (!this.deoptimized)
|
|
12659
|
+
this.applyDeoptimizations();
|
|
12638
12660
|
const initEffect = this.init?.hasEffects(context);
|
|
12639
12661
|
this.id.markDeclarationReached();
|
|
12640
12662
|
return initEffect || this.id.hasEffects(context);
|
|
12641
12663
|
}
|
|
12642
12664
|
include(context, includeChildrenRecursively) {
|
|
12665
|
+
const { deoptimized, id, init } = this;
|
|
12666
|
+
if (!deoptimized)
|
|
12667
|
+
this.applyDeoptimizations();
|
|
12643
12668
|
this.included = true;
|
|
12644
|
-
|
|
12645
|
-
|
|
12646
|
-
if (includeChildrenRecursively ||
|
|
12647
|
-
|
|
12669
|
+
init?.include(context, includeChildrenRecursively);
|
|
12670
|
+
id.markDeclarationReached();
|
|
12671
|
+
if (includeChildrenRecursively || id.shouldBeIncluded(context)) {
|
|
12672
|
+
id.include(context, includeChildrenRecursively);
|
|
12648
12673
|
}
|
|
12649
12674
|
}
|
|
12650
12675
|
render(code, options) {
|
|
@@ -12672,7 +12697,18 @@ class VariableDeclarator extends NodeBase {
|
|
|
12672
12697
|
code.appendLeft(end, `${_}=${_}void 0`);
|
|
12673
12698
|
}
|
|
12674
12699
|
}
|
|
12675
|
-
applyDeoptimizations() {
|
|
12700
|
+
applyDeoptimizations() {
|
|
12701
|
+
this.deoptimized = true;
|
|
12702
|
+
const { id, init } = this;
|
|
12703
|
+
if (init && id instanceof Identifier && init instanceof ClassExpression && !init.id) {
|
|
12704
|
+
const { name, variable } = id;
|
|
12705
|
+
for (const accessedVariable of init.scope.accessedOutsideVariables.values()) {
|
|
12706
|
+
if (accessedVariable !== variable) {
|
|
12707
|
+
accessedVariable.forbidName(name);
|
|
12708
|
+
}
|
|
12709
|
+
}
|
|
12710
|
+
}
|
|
12711
|
+
}
|
|
12676
12712
|
}
|
|
12677
12713
|
|
|
12678
12714
|
class WhileStatement extends NodeBase {
|
|
@@ -14807,7 +14843,7 @@ function deconflictImportsEsmOrSystem(usedNames, imports, dependenciesToBeDeconf
|
|
|
14807
14843
|
// This is needed for namespace reexports
|
|
14808
14844
|
for (const dependency of dependenciesToBeDeconflicted.dependencies) {
|
|
14809
14845
|
if (preserveModules || dependency instanceof ExternalChunk) {
|
|
14810
|
-
dependency.variableName = getSafeName(dependency.suggestedVariableName, usedNames);
|
|
14846
|
+
dependency.variableName = getSafeName(dependency.suggestedVariableName, usedNames, null);
|
|
14811
14847
|
}
|
|
14812
14848
|
}
|
|
14813
14849
|
for (const variable of imports) {
|
|
@@ -14821,29 +14857,29 @@ function deconflictImportsEsmOrSystem(usedNames, imports, dependenciesToBeDeconf
|
|
|
14821
14857
|
else if (module instanceof ExternalModule && name === 'default') {
|
|
14822
14858
|
variable.setRenderNames(null, getSafeName([...module.exportedVariables].some(([exportedVariable, exportedName]) => exportedName === '*' && exportedVariable.included)
|
|
14823
14859
|
? module.suggestedVariableName + '__default'
|
|
14824
|
-
: module.suggestedVariableName, usedNames));
|
|
14860
|
+
: module.suggestedVariableName, usedNames, variable.forbiddenNames));
|
|
14825
14861
|
}
|
|
14826
14862
|
else {
|
|
14827
|
-
variable.setRenderNames(null, getSafeName(name, usedNames));
|
|
14863
|
+
variable.setRenderNames(null, getSafeName(name, usedNames, variable.forbiddenNames));
|
|
14828
14864
|
}
|
|
14829
14865
|
}
|
|
14830
14866
|
for (const variable of syntheticExports) {
|
|
14831
|
-
variable.setRenderNames(null, getSafeName(variable.name, usedNames));
|
|
14867
|
+
variable.setRenderNames(null, getSafeName(variable.name, usedNames, variable.forbiddenNames));
|
|
14832
14868
|
}
|
|
14833
14869
|
}
|
|
14834
14870
|
function deconflictImportsOther(usedNames, imports, { deconflictedDefault, deconflictedNamespace, dependencies }, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule) {
|
|
14835
14871
|
for (const chunk of dependencies) {
|
|
14836
|
-
chunk.variableName = getSafeName(chunk.suggestedVariableName, usedNames);
|
|
14872
|
+
chunk.variableName = getSafeName(chunk.suggestedVariableName, usedNames, null);
|
|
14837
14873
|
}
|
|
14838
14874
|
for (const chunk of deconflictedNamespace) {
|
|
14839
|
-
chunk.namespaceVariableName = getSafeName(`${chunk.suggestedVariableName}__namespace`, usedNames);
|
|
14875
|
+
chunk.namespaceVariableName = getSafeName(`${chunk.suggestedVariableName}__namespace`, usedNames, null);
|
|
14840
14876
|
}
|
|
14841
14877
|
for (const externalModule of deconflictedDefault) {
|
|
14842
14878
|
externalModule.defaultVariableName =
|
|
14843
14879
|
deconflictedNamespace.has(externalModule) &&
|
|
14844
14880
|
canDefaultBeTakenFromNamespace(interop(externalModule.id), externalLiveBindings)
|
|
14845
14881
|
? externalModule.namespaceVariableName
|
|
14846
|
-
: getSafeName(`${externalModule.suggestedVariableName}__default`, usedNames);
|
|
14882
|
+
: getSafeName(`${externalModule.suggestedVariableName}__default`, usedNames, null);
|
|
14847
14883
|
}
|
|
14848
14884
|
for (const variable of imports) {
|
|
14849
14885
|
const module = variable.module;
|
|
@@ -14893,12 +14929,12 @@ function deconflictTopLevelVariables(usedNames, modules, includedNamespaces) {
|
|
|
14893
14929
|
// this will only happen for exports in some formats
|
|
14894
14930
|
!(variable.renderBaseName ||
|
|
14895
14931
|
(variable instanceof ExportDefaultVariable && variable.getOriginalVariable() !== variable))) {
|
|
14896
|
-
variable.setRenderNames(null, getSafeName(variable.name, usedNames));
|
|
14932
|
+
variable.setRenderNames(null, getSafeName(variable.name, usedNames, variable.forbiddenNames));
|
|
14897
14933
|
}
|
|
14898
14934
|
}
|
|
14899
14935
|
if (includedNamespaces.has(module)) {
|
|
14900
14936
|
const namespace = module.namespace;
|
|
14901
|
-
namespace.setRenderNames(null, getSafeName(namespace.name, usedNames));
|
|
14937
|
+
namespace.setRenderNames(null, getSafeName(namespace.name, usedNames, namespace.forbiddenNames));
|
|
14902
14938
|
}
|
|
14903
14939
|
}
|
|
14904
14940
|
}
|
|
@@ -15767,7 +15803,7 @@ class Chunk {
|
|
|
15767
15803
|
if (predefinedChunkName)
|
|
15768
15804
|
return predefinedChunkName;
|
|
15769
15805
|
const { preserveModulesRoot, sanitizeFileName } = this.outputOptions;
|
|
15770
|
-
const sanitizedId = sanitizeFileName(module.id.split(QUERY_HASH_REGEX, 1)[0]);
|
|
15806
|
+
const sanitizedId = sanitizeFileName(normalize(module.id.split(QUERY_HASH_REGEX, 1)[0]));
|
|
15771
15807
|
const extensionName = node_path.extname(sanitizedId);
|
|
15772
15808
|
const idWithoutExtension = NON_ASSET_EXTENSIONS.has(extensionName)
|
|
15773
15809
|
? sanitizedId.slice(0, -extensionName.length)
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED