@rollup/wasm-node 4.52.5 → 4.53.1
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/LICENSE.md +1 -1
- 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 +111 -98
- package/dist/es/shared/parseAst.js +2 -2
- package/dist/es/shared/watch.js +100 -100
- package/dist/getLogFilter.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/parseAst.js +2 -2
- package/dist/rollup.d.ts +3 -0
- package/dist/rollup.js +2 -2
- package/dist/shared/fsevents-importer.js +2 -2
- package/dist/shared/index.js +100 -100
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/parseAst.js +2 -2
- package/dist/shared/rollup.js +111 -98
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/dist/wasm-node/bindings_wasm.js +13 -13
- package/dist/wasm-node/bindings_wasm_bg.wasm +0 -0
- package/package.json +30 -25
package/dist/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.53.1
|
|
4
|
+
Fri, 07 Nov 2025 21:55:39 GMT - commit e3bdcdfe5633a6835dc4c61f8cf93a682406d965
|
|
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
|
+
var version = "4.53.1";
|
|
46
46
|
|
|
47
47
|
function ensureArray$1(items) {
|
|
48
48
|
if (Array.isArray(items)) {
|
|
@@ -1165,7 +1165,7 @@ var hasRequiredUtils;
|
|
|
1165
1165
|
function requireUtils () {
|
|
1166
1166
|
if (hasRequiredUtils) return utils;
|
|
1167
1167
|
hasRequiredUtils = 1;
|
|
1168
|
-
(function (exports) {
|
|
1168
|
+
(function (exports$1) {
|
|
1169
1169
|
|
|
1170
1170
|
const {
|
|
1171
1171
|
REGEX_BACKSLASH,
|
|
@@ -1174,13 +1174,13 @@ function requireUtils () {
|
|
|
1174
1174
|
REGEX_SPECIAL_CHARS_GLOBAL
|
|
1175
1175
|
} = /*@__PURE__*/ requireConstants();
|
|
1176
1176
|
|
|
1177
|
-
exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
|
|
1178
|
-
exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
|
|
1179
|
-
exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
|
|
1180
|
-
exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
|
|
1181
|
-
exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
|
|
1177
|
+
exports$1.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
|
|
1178
|
+
exports$1.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
|
|
1179
|
+
exports$1.isRegexChar = str => str.length === 1 && exports$1.hasRegexChars(str);
|
|
1180
|
+
exports$1.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
|
|
1181
|
+
exports$1.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
|
|
1182
1182
|
|
|
1183
|
-
exports.isWindows = () => {
|
|
1183
|
+
exports$1.isWindows = () => {
|
|
1184
1184
|
if (typeof navigator !== 'undefined' && navigator.platform) {
|
|
1185
1185
|
const platform = navigator.platform.toLowerCase();
|
|
1186
1186
|
return platform === 'win32' || platform === 'windows';
|
|
@@ -1193,20 +1193,20 @@ function requireUtils () {
|
|
|
1193
1193
|
return false;
|
|
1194
1194
|
};
|
|
1195
1195
|
|
|
1196
|
-
exports.removeBackslashes = str => {
|
|
1196
|
+
exports$1.removeBackslashes = str => {
|
|
1197
1197
|
return str.replace(REGEX_REMOVE_BACKSLASH, match => {
|
|
1198
1198
|
return match === '\\' ? '' : match;
|
|
1199
1199
|
});
|
|
1200
1200
|
};
|
|
1201
1201
|
|
|
1202
|
-
exports.escapeLast = (input, char, lastIdx) => {
|
|
1202
|
+
exports$1.escapeLast = (input, char, lastIdx) => {
|
|
1203
1203
|
const idx = input.lastIndexOf(char, lastIdx);
|
|
1204
1204
|
if (idx === -1) return input;
|
|
1205
|
-
if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
|
|
1205
|
+
if (input[idx - 1] === '\\') return exports$1.escapeLast(input, char, idx - 1);
|
|
1206
1206
|
return `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
1207
1207
|
};
|
|
1208
1208
|
|
|
1209
|
-
exports.removePrefix = (input, state = {}) => {
|
|
1209
|
+
exports$1.removePrefix = (input, state = {}) => {
|
|
1210
1210
|
let output = input;
|
|
1211
1211
|
if (output.startsWith('./')) {
|
|
1212
1212
|
output = output.slice(2);
|
|
@@ -1215,7 +1215,7 @@ function requireUtils () {
|
|
|
1215
1215
|
return output;
|
|
1216
1216
|
};
|
|
1217
1217
|
|
|
1218
|
-
exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
1218
|
+
exports$1.wrapOutput = (input, state = {}, options = {}) => {
|
|
1219
1219
|
const prepend = options.contains ? '' : '^';
|
|
1220
1220
|
const append = options.contains ? '' : '$';
|
|
1221
1221
|
|
|
@@ -1226,7 +1226,7 @@ function requireUtils () {
|
|
|
1226
1226
|
return output;
|
|
1227
1227
|
};
|
|
1228
1228
|
|
|
1229
|
-
exports.basename = (path, { windows } = {}) => {
|
|
1229
|
+
exports$1.basename = (path, { windows } = {}) => {
|
|
1230
1230
|
const segs = path.split(windows ? /[\\/]/ : '/');
|
|
1231
1231
|
const last = segs[segs.length - 1];
|
|
1232
1232
|
|
|
@@ -6291,6 +6291,7 @@ const RESERVED_NAMES = new Set([
|
|
|
6291
6291
|
'enum',
|
|
6292
6292
|
'eval',
|
|
6293
6293
|
'export',
|
|
6294
|
+
'exports',
|
|
6294
6295
|
'extends',
|
|
6295
6296
|
'false',
|
|
6296
6297
|
'finally',
|
|
@@ -6403,6 +6404,7 @@ class ExternalModule {
|
|
|
6403
6404
|
isIncluded: null,
|
|
6404
6405
|
meta,
|
|
6405
6406
|
moduleSideEffects,
|
|
6407
|
+
safeVariableNames: null,
|
|
6406
6408
|
syntheticNamedExports: false
|
|
6407
6409
|
};
|
|
6408
6410
|
}
|
|
@@ -9365,13 +9367,10 @@ class ChildScope extends Scope {
|
|
|
9365
9367
|
this.parent.addReturnExpression(expression);
|
|
9366
9368
|
}
|
|
9367
9369
|
}
|
|
9368
|
-
addUsedOutsideNames(usedNames,
|
|
9370
|
+
addUsedOutsideNames(usedNames, accessedGlobalsByScope) {
|
|
9369
9371
|
for (const variable of this.accessedOutsideVariables.values()) {
|
|
9370
9372
|
if (variable.included) {
|
|
9371
9373
|
usedNames.add(variable.getBaseVariableName());
|
|
9372
|
-
if (format === 'system' && exportNamesByVariable.has(variable)) {
|
|
9373
|
-
usedNames.add('exports');
|
|
9374
|
-
}
|
|
9375
9374
|
}
|
|
9376
9375
|
}
|
|
9377
9376
|
const accessedGlobals = accessedGlobalsByScope.get(this);
|
|
@@ -9386,7 +9385,7 @@ class ChildScope extends Scope {
|
|
|
9386
9385
|
}
|
|
9387
9386
|
deconflict(format, exportNamesByVariable, accessedGlobalsByScope) {
|
|
9388
9387
|
const usedNames = new Set();
|
|
9389
|
-
this.addUsedOutsideNames(usedNames,
|
|
9388
|
+
this.addUsedOutsideNames(usedNames, accessedGlobalsByScope);
|
|
9390
9389
|
if (this.accessedDynamicImports) {
|
|
9391
9390
|
for (const importExpression of this.accessedDynamicImports) {
|
|
9392
9391
|
if (importExpression.inlineNamespace) {
|
|
@@ -10677,6 +10676,13 @@ function getFunctionIdInsertPosition(code, start) {
|
|
|
10677
10676
|
return declarationEnd + generatorStarPos + 1;
|
|
10678
10677
|
}
|
|
10679
10678
|
class ExportDefaultDeclaration extends NodeBase {
|
|
10679
|
+
bind() {
|
|
10680
|
+
super.bind();
|
|
10681
|
+
const name = this.declarationName || this.scope.context.getModuleName();
|
|
10682
|
+
// Check if there's already a variable with the same name in the scope. This
|
|
10683
|
+
// can cause inconsistencies when using the cache.
|
|
10684
|
+
this.variable.name = this.scope.variables.get(name) ? `${name}_default` : name;
|
|
10685
|
+
}
|
|
10680
10686
|
include(context, includeChildrenRecursively) {
|
|
10681
10687
|
this.included = true;
|
|
10682
10688
|
this.declaration.include(context, includeChildrenRecursively);
|
|
@@ -10693,7 +10699,7 @@ class ExportDefaultDeclaration extends NodeBase {
|
|
|
10693
10699
|
const declaration = this.declaration;
|
|
10694
10700
|
this.declarationName =
|
|
10695
10701
|
(declaration.id && declaration.id.name) || this.declaration.name;
|
|
10696
|
-
this.variable = this.scope.addExportDefaultDeclaration(this
|
|
10702
|
+
this.variable = this.scope.addExportDefaultDeclaration(this, this.scope.context);
|
|
10697
10703
|
this.scope.context.addExport(this);
|
|
10698
10704
|
}
|
|
10699
10705
|
removeAnnotations(code) {
|
|
@@ -11622,8 +11628,8 @@ class UndefinedVariable extends Variable {
|
|
|
11622
11628
|
}
|
|
11623
11629
|
|
|
11624
11630
|
class ExportDefaultVariable extends LocalVariable {
|
|
11625
|
-
constructor(
|
|
11626
|
-
super(
|
|
11631
|
+
constructor(exportDefaultDeclaration, context) {
|
|
11632
|
+
super('default', exportDefaultDeclaration, exportDefaultDeclaration.declaration, EMPTY_PATH, context, 'other');
|
|
11627
11633
|
this.hasId = false;
|
|
11628
11634
|
this.originalId = null;
|
|
11629
11635
|
this.originalVariable = null;
|
|
@@ -11931,10 +11937,10 @@ function getCompleteAmdId(options, chunkId) {
|
|
|
11931
11937
|
return options.id ?? '';
|
|
11932
11938
|
}
|
|
11933
11939
|
|
|
11934
|
-
function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal, mechanism = 'return ') {
|
|
11940
|
+
function getExportBlock$1(exports$1, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal, mechanism = 'return ') {
|
|
11935
11941
|
const { _, getDirectReturnFunction, getFunctionIntro, getPropertyAccess, n, s } = snippets;
|
|
11936
11942
|
if (!namedExportsMode) {
|
|
11937
|
-
return `${n}${n}${mechanism}${getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings, getPropertyAccess)};`;
|
|
11943
|
+
return `${n}${n}${mechanism}${getSingleDefaultExport(exports$1, dependencies, interop, externalLiveBindings, getPropertyAccess)};`;
|
|
11938
11944
|
}
|
|
11939
11945
|
let exportBlock = '';
|
|
11940
11946
|
if (namedExportsMode) {
|
|
@@ -11971,7 +11977,7 @@ function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snip
|
|
|
11971
11977
|
}
|
|
11972
11978
|
}
|
|
11973
11979
|
}
|
|
11974
|
-
for (const { exported, local } of exports) {
|
|
11980
|
+
for (const { exported, local } of exports$1) {
|
|
11975
11981
|
const lhs = `exports${getPropertyAccess(exported)}`;
|
|
11976
11982
|
const rhs = local;
|
|
11977
11983
|
if (lhs !== rhs) {
|
|
@@ -12018,9 +12024,9 @@ function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snip
|
|
|
12018
12024
|
}
|
|
12019
12025
|
return '';
|
|
12020
12026
|
}
|
|
12021
|
-
function getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings, getPropertyAccess) {
|
|
12022
|
-
if (exports.length > 0) {
|
|
12023
|
-
return exports[0].local;
|
|
12027
|
+
function getSingleDefaultExport(exports$1, dependencies, interop, externalLiveBindings, getPropertyAccess) {
|
|
12028
|
+
if (exports$1.length > 0) {
|
|
12029
|
+
return exports$1[0].local;
|
|
12024
12030
|
}
|
|
12025
12031
|
else {
|
|
12026
12032
|
for (const { defaultVariableName, importPath, isChunk, name, namedExportsMode: depNamedExportsMode, namespaceVariableName, reexports } of dependencies) {
|
|
@@ -12281,12 +12287,12 @@ function warnOnBuiltins(log, dependencies) {
|
|
|
12281
12287
|
log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logMissingNodeBuiltins(externalBuiltins));
|
|
12282
12288
|
}
|
|
12283
12289
|
|
|
12284
|
-
function amd(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, id, indent: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, log, outro, snippets }, { amd, esModule, externalLiveBindings, freeze, generatedCode: { symbols }, interop, reexportProtoFromExternal, strict }) {
|
|
12290
|
+
function amd(magicString, { accessedGlobals, dependencies, exports: exports$1, hasDefaultExport, hasExports, id, indent: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, log, outro, snippets }, { amd, esModule, externalLiveBindings, freeze, generatedCode: { symbols }, interop, reexportProtoFromExternal, strict }) {
|
|
12285
12291
|
warnOnBuiltins(log, dependencies);
|
|
12286
12292
|
const deps = dependencies.map(m => `'${updateExtensionForRelativeAmdId(m.importPath, amd.forceJsExtensionForImports)}'`);
|
|
12287
12293
|
const parameters = dependencies.map(m => m.name);
|
|
12288
12294
|
const { n, getNonArrowFunctionIntro, _ } = snippets;
|
|
12289
|
-
if (hasExports && (namedExportsMode || exports[0]?.local === 'exports.default')) {
|
|
12295
|
+
if (hasExports && (namedExportsMode || exports$1[0]?.local === 'exports.default')) {
|
|
12290
12296
|
parameters.unshift(`exports`);
|
|
12291
12297
|
deps.unshift(`'exports'`);
|
|
12292
12298
|
}
|
|
@@ -12303,7 +12309,7 @@ function amd(magicString, { accessedGlobals, dependencies, exports, hasDefaultEx
|
|
|
12303
12309
|
(deps.length > 0 ? `[${deps.join(`,${_}`)}],${_}` : ``);
|
|
12304
12310
|
const useStrict = strict ? `${_}'use strict';` : '';
|
|
12305
12311
|
magicString.prepend(`${intro}${getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets)}`);
|
|
12306
|
-
const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal);
|
|
12312
|
+
const exportBlock = getExportBlock$1(exports$1, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal);
|
|
12307
12313
|
let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && (esModule === true || (esModule === 'if-default-prop' && hasDefaultExport)), isModuleFacade && symbols, snippets);
|
|
12308
12314
|
if (namespaceMarkers) {
|
|
12309
12315
|
namespaceMarkers = n + n + namespaceMarkers;
|
|
@@ -12320,7 +12326,7 @@ function amd(magicString, { accessedGlobals, dependencies, exports, hasDefaultEx
|
|
|
12320
12326
|
.append(`${n}${n}}));`);
|
|
12321
12327
|
}
|
|
12322
12328
|
|
|
12323
|
-
function cjs(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, indent: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, outro, snippets }, { compact, esModule, externalLiveBindings, freeze, interop, generatedCode: { symbols }, reexportProtoFromExternal, strict }) {
|
|
12329
|
+
function cjs(magicString, { accessedGlobals, dependencies, exports: exports$1, hasDefaultExport, hasExports, indent: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, outro, snippets }, { compact, esModule, externalLiveBindings, freeze, interop, generatedCode: { symbols }, reexportProtoFromExternal, strict }) {
|
|
12324
12330
|
const { _, n } = snippets;
|
|
12325
12331
|
const useStrict = strict ? `'use strict';${n}${n}` : '';
|
|
12326
12332
|
let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && (esModule === true || (esModule === 'if-default-prop' && hasDefaultExport)), isModuleFacade && symbols, snippets);
|
|
@@ -12330,7 +12336,7 @@ function cjs(magicString, { accessedGlobals, dependencies, exports, hasDefaultEx
|
|
|
12330
12336
|
const importBlock = getImportBlock$1(dependencies, snippets, compact);
|
|
12331
12337
|
const interopBlock = getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets);
|
|
12332
12338
|
magicString.prepend(`${useStrict}${intro}${namespaceMarkers}${importBlock}${interopBlock}`);
|
|
12333
|
-
const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal, `module.exports${_}=${_}`);
|
|
12339
|
+
const exportBlock = getExportBlock$1(exports$1, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal, `module.exports${_}=${_}`);
|
|
12334
12340
|
magicString.append(`${exportBlock}${outro}`);
|
|
12335
12341
|
}
|
|
12336
12342
|
function getImportBlock$1(dependencies, { _, cnst, n }, compact) {
|
|
@@ -12356,7 +12362,7 @@ function getImportBlock$1(dependencies, { _, cnst, n }, compact) {
|
|
|
12356
12362
|
return '';
|
|
12357
12363
|
}
|
|
12358
12364
|
|
|
12359
|
-
function es(magicString, { accessedGlobals, indent: t, intro, outro, dependencies, exports, snippets }, { externalLiveBindings, freeze, generatedCode: { symbols }, importAttributesKey }) {
|
|
12365
|
+
function es(magicString, { accessedGlobals, indent: t, intro, outro, dependencies, exports: exports$1, snippets }, { externalLiveBindings, freeze, generatedCode: { symbols }, importAttributesKey }) {
|
|
12360
12366
|
const { n } = snippets;
|
|
12361
12367
|
const importBlock = getImportBlock(dependencies, importAttributesKey, snippets);
|
|
12362
12368
|
if (importBlock.length > 0)
|
|
@@ -12364,7 +12370,7 @@ function es(magicString, { accessedGlobals, indent: t, intro, outro, dependencie
|
|
|
12364
12370
|
intro += getHelpersBlock(null, accessedGlobals, t, snippets, externalLiveBindings, freeze, symbols);
|
|
12365
12371
|
if (intro)
|
|
12366
12372
|
magicString.prepend(intro);
|
|
12367
|
-
const exportBlock = getExportBlock(exports, snippets);
|
|
12373
|
+
const exportBlock = getExportBlock(exports$1, snippets);
|
|
12368
12374
|
if (exportBlock.length > 0)
|
|
12369
12375
|
magicString.append(n + n + exportBlock.join(n).trim());
|
|
12370
12376
|
if (outro)
|
|
@@ -12449,11 +12455,11 @@ function getImportBlock(dependencies, importAttributesKey, { _ }) {
|
|
|
12449
12455
|
}
|
|
12450
12456
|
return importBlock;
|
|
12451
12457
|
}
|
|
12452
|
-
function getExportBlock(exports, { _, cnst }) {
|
|
12458
|
+
function getExportBlock(exports$1, { _, cnst }) {
|
|
12453
12459
|
const exportBlock = [];
|
|
12454
|
-
const exportDeclaration = new Array(exports.length);
|
|
12460
|
+
const exportDeclaration = new Array(exports$1.length);
|
|
12455
12461
|
let index = 0;
|
|
12456
|
-
for (const specifier of exports) {
|
|
12462
|
+
for (const specifier of exports$1) {
|
|
12457
12463
|
if (specifier.expression) {
|
|
12458
12464
|
exportBlock.push(`${cnst} ${specifier.local}${_}=${_}${specifier.expression};`);
|
|
12459
12465
|
}
|
|
@@ -12531,7 +12537,7 @@ function trimEmptyImports(dependencies) {
|
|
|
12531
12537
|
return [];
|
|
12532
12538
|
}
|
|
12533
12539
|
|
|
12534
|
-
function iife(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, indent: t, intro, namedExportsMode, log, outro, snippets }, { compact, esModule, extend, freeze, externalLiveBindings, reexportProtoFromExternal, globals, interop, name, generatedCode: { symbols }, strict }) {
|
|
12540
|
+
function iife(magicString, { accessedGlobals, dependencies, exports: exports$1, hasDefaultExport, hasExports, indent: t, intro, namedExportsMode, log, outro, snippets }, { compact, esModule, extend, freeze, externalLiveBindings, reexportProtoFromExternal, globals, interop, name, generatedCode: { symbols }, strict }) {
|
|
12535
12541
|
const { _, getNonArrowFunctionIntro, getPropertyAccess, n } = snippets;
|
|
12536
12542
|
const isNamespaced = name && name.includes('.');
|
|
12537
12543
|
const useVariableAssignment = !extend && !isNamespaced;
|
|
@@ -12545,7 +12551,7 @@ function iife(magicString, { accessedGlobals, dependencies, exports, hasDefaultE
|
|
|
12545
12551
|
if (hasExports && !name) {
|
|
12546
12552
|
log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logMissingNameOptionForIifeExport());
|
|
12547
12553
|
}
|
|
12548
|
-
if (hasExports && (namedExportsMode || exports[0]?.local === 'exports.default')) {
|
|
12554
|
+
if (hasExports && (namedExportsMode || exports$1[0]?.local === 'exports.default')) {
|
|
12549
12555
|
if (extend) {
|
|
12550
12556
|
deps.unshift(`this${keypath(name, getPropertyAccess)}${_}=${_}this${keypath(name, getPropertyAccess)}${_}||${_}{}`);
|
|
12551
12557
|
parameters.unshift('exports');
|
|
@@ -12576,7 +12582,7 @@ function iife(magicString, { accessedGlobals, dependencies, exports, hasDefaultE
|
|
|
12576
12582
|
if (hasExports && !extend && namedExportsMode) {
|
|
12577
12583
|
wrapperOutro = `${n}${n}${t}return exports;${wrapperOutro}`;
|
|
12578
12584
|
}
|
|
12579
|
-
const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal);
|
|
12585
|
+
const exportBlock = getExportBlock$1(exports$1, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal);
|
|
12580
12586
|
let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule === true || (esModule === 'if-default-prop' && hasDefaultExport), symbols, snippets);
|
|
12581
12587
|
if (namespaceMarkers) {
|
|
12582
12588
|
namespaceMarkers = n + n + namespaceMarkers;
|
|
@@ -12590,9 +12596,9 @@ function iife(magicString, { accessedGlobals, dependencies, exports, hasDefaultE
|
|
|
12590
12596
|
|
|
12591
12597
|
const MISSING_EXPORT_SHIM_VARIABLE = '_missingExportShim';
|
|
12592
12598
|
|
|
12593
|
-
function system(magicString, { accessedGlobals, dependencies, exports, hasExports, indent: t, intro, snippets, outro, usesTopLevelAwait }, { externalLiveBindings, freeze, name, generatedCode: { symbols }, strict, systemNullSetters }) {
|
|
12599
|
+
function system(magicString, { accessedGlobals, dependencies, exports: exports$1, hasExports, indent: t, intro, snippets, outro, usesTopLevelAwait }, { externalLiveBindings, freeze, name, generatedCode: { symbols }, strict, systemNullSetters }) {
|
|
12594
12600
|
const { _, getFunctionIntro, getNonArrowFunctionIntro, n, s } = snippets;
|
|
12595
|
-
const { importBindings, setters, starExcludes } = analyzeDependencies(dependencies, exports, t, snippets);
|
|
12601
|
+
const { importBindings, setters, starExcludes } = analyzeDependencies(dependencies, exports$1, t, snippets);
|
|
12596
12602
|
const registeredName = name ? `'${name}',${_}` : '';
|
|
12597
12603
|
const wrapperParameters = accessedGlobals.has('module')
|
|
12598
12604
|
? ['exports', 'module']
|
|
@@ -12629,15 +12635,15 @@ function system(magicString, { accessedGlobals, dependencies, exports, hasExport
|
|
|
12629
12635
|
magicString
|
|
12630
12636
|
.prepend(intro +
|
|
12631
12637
|
getHelpersBlock(null, accessedGlobals, t, snippets, externalLiveBindings, freeze, symbols) +
|
|
12632
|
-
getHoistedExportsBlock(exports, t, snippets))
|
|
12638
|
+
getHoistedExportsBlock(exports$1, t, snippets))
|
|
12633
12639
|
.append(`${outro}${n}${n}` +
|
|
12634
|
-
getSyntheticExportsBlock(exports, t, snippets) +
|
|
12635
|
-
getMissingExportsBlock(exports, t, snippets))
|
|
12640
|
+
getSyntheticExportsBlock(exports$1, t, snippets) +
|
|
12641
|
+
getMissingExportsBlock(exports$1, t, snippets))
|
|
12636
12642
|
.indent(`${t}${t}${t}`)
|
|
12637
12643
|
.append(wrapperEnd)
|
|
12638
12644
|
.prepend(wrapperStart);
|
|
12639
12645
|
}
|
|
12640
|
-
function analyzeDependencies(dependencies, exports, t, { _, cnst, getObject, getPropertyAccess, n }) {
|
|
12646
|
+
function analyzeDependencies(dependencies, exports$1, t, { _, cnst, getObject, getPropertyAccess, n }) {
|
|
12641
12647
|
const importBindings = [];
|
|
12642
12648
|
const setters = [];
|
|
12643
12649
|
let starExcludes = null;
|
|
@@ -12671,7 +12677,7 @@ function analyzeDependencies(dependencies, exports, t, { _, cnst, getObject, get
|
|
|
12671
12677
|
if (reexportedNames.length > 1 || hasStarReexport) {
|
|
12672
12678
|
if (hasStarReexport) {
|
|
12673
12679
|
if (!starExcludes) {
|
|
12674
|
-
starExcludes = getStarExcludes({ dependencies, exports });
|
|
12680
|
+
starExcludes = getStarExcludes({ dependencies, exports: exports$1 });
|
|
12675
12681
|
}
|
|
12676
12682
|
reexportedNames.unshift([null, `__proto__:${_}null`]);
|
|
12677
12683
|
const exportMapping = getObject(reexportedNames, { lineBreakIndent: null });
|
|
@@ -12691,8 +12697,8 @@ function analyzeDependencies(dependencies, exports, t, { _, cnst, getObject, get
|
|
|
12691
12697
|
}
|
|
12692
12698
|
return { importBindings, setters, starExcludes };
|
|
12693
12699
|
}
|
|
12694
|
-
const getStarExcludes = ({ dependencies, exports }) => {
|
|
12695
|
-
const starExcludes = new Set(exports.map(expt => expt.exported));
|
|
12700
|
+
const getStarExcludes = ({ dependencies, exports: exports$1 }) => {
|
|
12701
|
+
const starExcludes = new Set(exports$1.map(expt => expt.exported));
|
|
12696
12702
|
starExcludes.add('default');
|
|
12697
12703
|
for (const { reexports } of dependencies) {
|
|
12698
12704
|
if (reexports) {
|
|
@@ -12718,24 +12724,24 @@ const getStarExcludesBlock = (starExcludes, t, { _, cnst, getObject, n }) => {
|
|
|
12718
12724
|
return '';
|
|
12719
12725
|
};
|
|
12720
12726
|
const getImportBindingsBlock = (importBindings, t, { _, n }) => (importBindings.length > 0 ? `${n}${t}var ${importBindings.join(`,${_}`)};` : '');
|
|
12721
|
-
const getHoistedExportsBlock = (exports, t, snippets) => getExportsBlock(exports.filter(expt => expt.hoisted).map(expt => ({ name: expt.exported, value: expt.local })), t, snippets);
|
|
12722
|
-
function getExportsBlock(exports, t, { _, n }) {
|
|
12723
|
-
if (exports.length === 0) {
|
|
12727
|
+
const getHoistedExportsBlock = (exports$1, t, snippets) => getExportsBlock(exports$1.filter(expt => expt.hoisted).map(expt => ({ name: expt.exported, value: expt.local })), t, snippets);
|
|
12728
|
+
function getExportsBlock(exports$1, t, { _, n }) {
|
|
12729
|
+
if (exports$1.length === 0) {
|
|
12724
12730
|
return '';
|
|
12725
12731
|
}
|
|
12726
|
-
if (exports.length === 1) {
|
|
12727
|
-
return `exports(${JSON.stringify(exports[0].name)},${_}${exports[0].value});${n}${n}`;
|
|
12732
|
+
if (exports$1.length === 1) {
|
|
12733
|
+
return `exports(${JSON.stringify(exports$1[0].name)},${_}${exports$1[0].value});${n}${n}`;
|
|
12728
12734
|
}
|
|
12729
12735
|
return (`exports({${n}` +
|
|
12730
|
-
exports
|
|
12736
|
+
exports$1
|
|
12731
12737
|
.map(({ name, value }) => `${t}${stringifyObjectKeyIfNeeded(name)}:${_}${value}`)
|
|
12732
12738
|
.join(`,${n}`) +
|
|
12733
12739
|
`${n}});${n}${n}`);
|
|
12734
12740
|
}
|
|
12735
|
-
const getSyntheticExportsBlock = (exports, t, snippets) => getExportsBlock(exports
|
|
12741
|
+
const getSyntheticExportsBlock = (exports$1, t, snippets) => getExportsBlock(exports$1
|
|
12736
12742
|
.filter(expt => expt.expression)
|
|
12737
12743
|
.map(expt => ({ name: expt.exported, value: expt.local })), t, snippets);
|
|
12738
|
-
const getMissingExportsBlock = (exports, t, snippets) => getExportsBlock(exports
|
|
12744
|
+
const getMissingExportsBlock = (exports$1, t, snippets) => getExportsBlock(exports$1
|
|
12739
12745
|
.filter(expt => expt.local === MISSING_EXPORT_SHIM_VARIABLE)
|
|
12740
12746
|
.map(expt => ({ name: expt.exported, value: MISSING_EXPORT_SHIM_VARIABLE })), t, snippets);
|
|
12741
12747
|
|
|
@@ -12751,7 +12757,7 @@ function safeAccess(name, globalVariable, { _, getPropertyAccess }) {
|
|
|
12751
12757
|
.map(part => (propertyPath += getPropertyAccess(part)))
|
|
12752
12758
|
.join(`${_}&&${_}`);
|
|
12753
12759
|
}
|
|
12754
|
-
function umd(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, id, indent: t, intro, namedExportsMode, log, outro, snippets }, { amd, compact, esModule, extend, externalLiveBindings, freeze, interop, name, generatedCode: { symbols }, globals, noConflict, reexportProtoFromExternal, strict }) {
|
|
12760
|
+
function umd(magicString, { accessedGlobals, dependencies, exports: exports$1, hasDefaultExport, hasExports, id, indent: t, intro, namedExportsMode, log, outro, snippets }, { amd, compact, esModule, extend, externalLiveBindings, freeze, interop, name, generatedCode: { symbols }, globals, noConflict, reexportProtoFromExternal, strict }) {
|
|
12755
12761
|
const { _, cnst, getFunctionIntro, getNonArrowFunctionIntro, getPropertyAccess, n, s } = snippets;
|
|
12756
12762
|
const factoryVariable = compact ? 'f' : 'factory';
|
|
12757
12763
|
const globalVariable = compact ? 'g' : 'global';
|
|
@@ -12765,7 +12771,7 @@ function umd(magicString, { accessedGlobals, dependencies, exports, hasDefaultEx
|
|
|
12765
12771
|
const globalDeps = trimmedImports.map(module => globalProperty(module.globalName, globalVariable, getPropertyAccess));
|
|
12766
12772
|
const factoryParameters = trimmedImports.map(m => m.name);
|
|
12767
12773
|
if ((hasExports || noConflict) &&
|
|
12768
|
-
(namedExportsMode || (hasExports && exports[0]?.local === 'exports.default'))) {
|
|
12774
|
+
(namedExportsMode || (hasExports && exports$1[0]?.local === 'exports.default'))) {
|
|
12769
12775
|
amdDeps.unshift(`'exports'`);
|
|
12770
12776
|
cjsDeps.unshift(`exports`);
|
|
12771
12777
|
globalDeps.unshift(assignToDeepVariable(name, globalVariable, globals, `${extend ? `${globalProperty(name, globalVariable, getPropertyAccess)}${_}||${_}` : ''}{}`, snippets, log));
|
|
@@ -12833,7 +12839,7 @@ function umd(magicString, { accessedGlobals, dependencies, exports, hasDefaultEx
|
|
|
12833
12839
|
})}{${useStrict}${n}`;
|
|
12834
12840
|
const wrapperOutro = n + n + '}));';
|
|
12835
12841
|
magicString.prepend(`${intro}${getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets)}`);
|
|
12836
|
-
const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal);
|
|
12842
|
+
const exportBlock = getExportBlock$1(exports$1, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal);
|
|
12837
12843
|
let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule === true || (esModule === 'if-default-prop' && hasDefaultExport), symbols, snippets);
|
|
12838
12844
|
if (namespaceMarkers) {
|
|
12839
12845
|
namespaceMarkers = n + n + namespaceMarkers;
|
|
@@ -16649,8 +16655,8 @@ class ModuleScope extends ChildScope {
|
|
|
16649
16655
|
}
|
|
16650
16656
|
return super.addDeclaration(identifier, context, init, destructuredInitPath, kind);
|
|
16651
16657
|
}
|
|
16652
|
-
addExportDefaultDeclaration(
|
|
16653
|
-
const variable = new ExportDefaultVariable(
|
|
16658
|
+
addExportDefaultDeclaration(exportDefaultDeclaration, context) {
|
|
16659
|
+
const variable = new ExportDefaultVariable(exportDefaultDeclaration, context);
|
|
16654
16660
|
this.variables.set('default', variable);
|
|
16655
16661
|
return variable;
|
|
16656
16662
|
}
|
|
@@ -18439,7 +18445,7 @@ class Module {
|
|
|
18439
18445
|
this.preserveSignature = this.options.preserveEntrySignatures;
|
|
18440
18446
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
18441
18447
|
const module = this;
|
|
18442
|
-
const { dynamicImports, dynamicImporters, exportAllSources, exports, implicitlyLoadedAfter, implicitlyLoadedBefore, importers, reexportDescriptions, sourcesWithAttributes } = this;
|
|
18448
|
+
const { dynamicImports, dynamicImporters, exportAllSources, exports: exports$1, implicitlyLoadedAfter, implicitlyLoadedBefore, importers, reexportDescriptions, sourcesWithAttributes } = this;
|
|
18443
18449
|
this.info = {
|
|
18444
18450
|
ast: null,
|
|
18445
18451
|
attributes,
|
|
@@ -18458,7 +18464,7 @@ class Module {
|
|
|
18458
18464
|
return dynamicImporters.sort();
|
|
18459
18465
|
},
|
|
18460
18466
|
get exportedBindings() {
|
|
18461
|
-
const exportBindings = { '.': [...exports.keys()] };
|
|
18467
|
+
const exportBindings = { '.': [...exports$1.keys()] };
|
|
18462
18468
|
for (const [name, { source }] of reexportDescriptions) {
|
|
18463
18469
|
(exportBindings[source] ??= []).push(name);
|
|
18464
18470
|
}
|
|
@@ -18469,7 +18475,7 @@ class Module {
|
|
|
18469
18475
|
},
|
|
18470
18476
|
get exports() {
|
|
18471
18477
|
return [
|
|
18472
|
-
...exports.keys(),
|
|
18478
|
+
...exports$1.keys(),
|
|
18473
18479
|
...reexportDescriptions.keys(),
|
|
18474
18480
|
...[...exportAllSources].map(() => '*')
|
|
18475
18481
|
];
|
|
@@ -18509,6 +18515,7 @@ class Module {
|
|
|
18509
18515
|
},
|
|
18510
18516
|
meta: { ...meta },
|
|
18511
18517
|
moduleSideEffects,
|
|
18518
|
+
safeVariableNames: null,
|
|
18512
18519
|
syntheticNamedExports
|
|
18513
18520
|
};
|
|
18514
18521
|
}
|
|
@@ -18859,13 +18866,14 @@ class Module {
|
|
|
18859
18866
|
}
|
|
18860
18867
|
return { source, usesTopLevelAwait };
|
|
18861
18868
|
}
|
|
18862
|
-
async setSource({ ast, code, customTransformCache, originalCode, originalSourcemap, resolvedIds, sourcemapChain, transformDependencies, transformFiles, ...moduleOptions }) {
|
|
18869
|
+
async setSource({ ast, code, customTransformCache, originalCode, originalSourcemap, resolvedIds, sourcemapChain, transformDependencies, transformFiles, safeVariableNames, ...moduleOptions }) {
|
|
18863
18870
|
timeStart('generate ast', 3);
|
|
18864
18871
|
if (code.startsWith('#!')) {
|
|
18865
18872
|
const shebangEndPosition = code.indexOf('\n');
|
|
18866
18873
|
this.shebang = code.slice(2, shebangEndPosition);
|
|
18867
18874
|
}
|
|
18868
18875
|
this.info.code = code;
|
|
18876
|
+
this.info.safeVariableNames = safeVariableNames;
|
|
18869
18877
|
this.originalCode = originalCode;
|
|
18870
18878
|
// We need to call decodedSourcemap on the input in case they were hydrated from json in the cache and don't
|
|
18871
18879
|
// have the lazy evaluation cache configured. Right now this isn't enforced by the type system because the
|
|
@@ -18972,6 +18980,7 @@ class Module {
|
|
|
18972
18980
|
originalCode: this.originalCode,
|
|
18973
18981
|
originalSourcemap: this.originalSourcemap,
|
|
18974
18982
|
resolvedIds: this.resolvedIds,
|
|
18983
|
+
safeVariableNames: this.info.safeVariableNames,
|
|
18975
18984
|
sourcemapChain: this.sourcemapChain,
|
|
18976
18985
|
syntheticNamedExports: this.info.syntheticNamedExports,
|
|
18977
18986
|
transformDependencies: this.transformDependencies,
|
|
@@ -19390,7 +19399,7 @@ const DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT = {
|
|
|
19390
19399
|
function deconflictChunk(modules, dependenciesToBeDeconflicted, imports, usedNames, format, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports, exportNamesByVariable, accessedGlobalsByScope, includedNamespaces) {
|
|
19391
19400
|
const reversedModules = [...modules].reverse();
|
|
19392
19401
|
for (const module of reversedModules) {
|
|
19393
|
-
module.scope.addUsedOutsideNames(usedNames,
|
|
19402
|
+
module.scope.addUsedOutsideNames(usedNames, accessedGlobalsByScope);
|
|
19394
19403
|
}
|
|
19395
19404
|
deconflictTopLevelVariables(usedNames, reversedModules, includedNamespaces);
|
|
19396
19405
|
DECONFLICT_IMPORTED_VARIABLES_BY_FORMAT[format](usedNames, imports, dependenciesToBeDeconflicted, interop, preserveModules, externalLiveBindings, chunkByModule, externalChunkByModule, syntheticExports);
|
|
@@ -19483,12 +19492,22 @@ function deconflictImportsOther(usedNames, imports, { deconflictedDefault, decon
|
|
|
19483
19492
|
}
|
|
19484
19493
|
function deconflictTopLevelVariables(usedNames, modules, includedNamespaces) {
|
|
19485
19494
|
for (const module of modules) {
|
|
19495
|
+
module.info.safeVariableNames ||= {};
|
|
19486
19496
|
for (const variable of module.scope.variables.values()) {
|
|
19487
19497
|
if (variable.included &&
|
|
19488
19498
|
// this will only happen for exports in some formats
|
|
19489
19499
|
!(variable.renderBaseName ||
|
|
19490
19500
|
(variable instanceof ExportDefaultVariable && variable.getOriginalVariable() !== variable))) {
|
|
19501
|
+
// We need to make sure that variables that corresponding to object
|
|
19502
|
+
// prototype methods are not accidentally matched.
|
|
19503
|
+
const cachedSafeVariableName = Object.getOwnPropertyDescriptor(module.info.safeVariableNames, variable.name)?.value;
|
|
19504
|
+
if (cachedSafeVariableName && !usedNames.has(cachedSafeVariableName)) {
|
|
19505
|
+
usedNames.add(cachedSafeVariableName);
|
|
19506
|
+
variable.setRenderNames(null, cachedSafeVariableName);
|
|
19507
|
+
continue;
|
|
19508
|
+
}
|
|
19491
19509
|
variable.setRenderNames(null, getSafeName(variable.name, usedNames, variable.forbiddenNames));
|
|
19510
|
+
module.info.safeVariableNames[variable.name] = variable.renderName;
|
|
19492
19511
|
}
|
|
19493
19512
|
}
|
|
19494
19513
|
if (includedNamespaces.has(module)) {
|
|
@@ -19498,9 +19517,9 @@ function deconflictTopLevelVariables(usedNames, modules, includedNamespaces) {
|
|
|
19498
19517
|
}
|
|
19499
19518
|
}
|
|
19500
19519
|
|
|
19501
|
-
function assignExportsToMangledNames(exports, exportsByName, exportNamesByVariable) {
|
|
19520
|
+
function assignExportsToMangledNames(exports$1, exportsByName, exportNamesByVariable) {
|
|
19502
19521
|
let nameIndex = 0;
|
|
19503
|
-
for (const variable of exports) {
|
|
19522
|
+
for (const variable of exports$1) {
|
|
19504
19523
|
let [exportName] = variable.name;
|
|
19505
19524
|
if (exportsByName.has(exportName)) {
|
|
19506
19525
|
do {
|
|
@@ -19516,8 +19535,8 @@ function assignExportsToMangledNames(exports, exportsByName, exportNamesByVariab
|
|
|
19516
19535
|
exportNamesByVariable.set(variable, [exportName]);
|
|
19517
19536
|
}
|
|
19518
19537
|
}
|
|
19519
|
-
function assignExportsToNames(exports, exportsByName, exportNamesByVariable) {
|
|
19520
|
-
for (const variable of exports) {
|
|
19538
|
+
function assignExportsToNames(exports$1, exportsByName, exportNamesByVariable) {
|
|
19539
|
+
for (const variable of exports$1) {
|
|
19521
19540
|
let nameIndex = 0;
|
|
19522
19541
|
let exportName = variable.name;
|
|
19523
19542
|
while (exportsByName.has(exportName)) {
|
|
@@ -19624,6 +19643,16 @@ function addStaticDependencies(module, staticDependencies, handledModules, chunk
|
|
|
19624
19643
|
}
|
|
19625
19644
|
}
|
|
19626
19645
|
|
|
19646
|
+
const RESERVED_USED_NAMES = [
|
|
19647
|
+
'Object',
|
|
19648
|
+
'Promise',
|
|
19649
|
+
'module',
|
|
19650
|
+
'exports',
|
|
19651
|
+
'require',
|
|
19652
|
+
'__filename',
|
|
19653
|
+
'__dirname',
|
|
19654
|
+
...HELPER_NAMES
|
|
19655
|
+
];
|
|
19627
19656
|
const NON_ASSET_EXTENSIONS = new Set([
|
|
19628
19657
|
'.js',
|
|
19629
19658
|
'.jsx',
|
|
@@ -20176,7 +20205,7 @@ class Chunk {
|
|
|
20176
20205
|
return 'chunk';
|
|
20177
20206
|
}
|
|
20178
20207
|
getChunkExportDeclarations(format) {
|
|
20179
|
-
const exports = [];
|
|
20208
|
+
const exports$1 = [];
|
|
20180
20209
|
for (const exportName of this.getExportNames()) {
|
|
20181
20210
|
if (exportName[0] === '*')
|
|
20182
20211
|
continue;
|
|
@@ -20221,14 +20250,14 @@ class Chunk {
|
|
|
20221
20250
|
local = variable.renderName;
|
|
20222
20251
|
}
|
|
20223
20252
|
}
|
|
20224
|
-
exports.push({
|
|
20253
|
+
exports$1.push({
|
|
20225
20254
|
exported: exportName,
|
|
20226
20255
|
expression,
|
|
20227
20256
|
hoisted,
|
|
20228
20257
|
local
|
|
20229
20258
|
});
|
|
20230
20259
|
}
|
|
20231
|
-
return exports;
|
|
20260
|
+
return exports$1;
|
|
20232
20261
|
}
|
|
20233
20262
|
getDependenciesToBeDeconflicted(addNonNamespacesAndInteropHelpers, addDependenciesWithoutBindings, interop) {
|
|
20234
20263
|
const dependencies = new Set();
|
|
@@ -20645,32 +20674,13 @@ class Chunk {
|
|
|
20645
20674
|
break;
|
|
20646
20675
|
}
|
|
20647
20676
|
}
|
|
20648
|
-
const usedNames = new Set(
|
|
20677
|
+
const usedNames = new Set(RESERVED_USED_NAMES);
|
|
20649
20678
|
if (this.needsExportsShim) {
|
|
20650
20679
|
usedNames.add(MISSING_EXPORT_SHIM_VARIABLE);
|
|
20651
20680
|
}
|
|
20652
20681
|
if (symbols) {
|
|
20653
20682
|
usedNames.add('Symbol');
|
|
20654
20683
|
}
|
|
20655
|
-
switch (format) {
|
|
20656
|
-
case 'system': {
|
|
20657
|
-
usedNames.add('module').add('exports');
|
|
20658
|
-
break;
|
|
20659
|
-
}
|
|
20660
|
-
case 'es': {
|
|
20661
|
-
break;
|
|
20662
|
-
}
|
|
20663
|
-
case 'cjs': {
|
|
20664
|
-
usedNames.add('module').add('require').add('__filename').add('__dirname');
|
|
20665
|
-
}
|
|
20666
|
-
// fallthrough
|
|
20667
|
-
default: {
|
|
20668
|
-
usedNames.add('exports');
|
|
20669
|
-
for (const helper of HELPER_NAMES) {
|
|
20670
|
-
usedNames.add(helper);
|
|
20671
|
-
}
|
|
20672
|
-
}
|
|
20673
|
-
}
|
|
20674
20684
|
deconflictChunk(this.orderedModules, this.getDependenciesToBeDeconflicted(format !== 'es' && format !== 'system', format === 'amd' || format === 'umd' || format === 'iife', interop), this.imports, usedNames, format, interop, preserveModules, externalLiveBindings, this.chunkByModule, this.externalChunkByModule, syntheticExports, this.exportNamesByVariable, this.accessedGlobalsByScope, this.includedNamespaces);
|
|
20675
20685
|
}
|
|
20676
20686
|
setImportMetaResolutions(fileName) {
|
|
@@ -22426,6 +22436,7 @@ async function transform(source, module, pluginDriver, log) {
|
|
|
22426
22436
|
customTransformCache,
|
|
22427
22437
|
originalCode,
|
|
22428
22438
|
originalSourcemap,
|
|
22439
|
+
safeVariableNames: null,
|
|
22429
22440
|
sourcemapChain,
|
|
22430
22441
|
transformDependencies
|
|
22431
22442
|
};
|
|
@@ -23676,7 +23687,9 @@ async function rollupInternal(rawInputOptions, watcher) {
|
|
|
23676
23687
|
});
|
|
23677
23688
|
timeEnd('BUILD', 1);
|
|
23678
23689
|
const result = {
|
|
23679
|
-
cache
|
|
23690
|
+
get cache() {
|
|
23691
|
+
return useCache ? graph.getCache() : undefined;
|
|
23692
|
+
},
|
|
23680
23693
|
async close() {
|
|
23681
23694
|
if (result.closed)
|
|
23682
23695
|
return;
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED