@rollup/wasm-node 4.9.6 → 4.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/rollup +88 -50
- 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 +107 -50
- package/dist/es/shared/parseAst.js +14 -4
- package/dist/es/shared/watch.js +6 -3
- package/dist/getLogFilter.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/native.js +8 -1
- package/dist/parseAst.js +2 -2
- package/dist/rollup.d.ts +6 -0
- package/dist/rollup.js +2 -2
- package/dist/shared/fsevents-importer.js +2 -2
- package/dist/shared/index.js +6 -3
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/parseAst.js +14 -3
- package/dist/shared/rollup.js +105 -48
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/dist/wasm-node/bindings_wasm.js +57 -14
- package/dist/wasm-node/bindings_wasm_bg.wasm +0 -0
- package/package.json +27 -26
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.11.0
|
|
4
|
+
Thu, 15 Feb 2024 06:09:01 GMT - commit 90ad652b745c5fe7167d92b4ad671cc387577a99
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
8
8
|
Released under the MIT License.
|
|
9
9
|
*/
|
|
10
|
-
import { normalize, getImportPath, LOGLEVEL_WARN, logUnusedExternalImports, ANNOTATION_KEY, INVALID_ANNOTATION_KEY, logInvalidAnnotation, logRedeclarationError, logDuplicateArgumentNameError, logIllegalImportReassignment, logModuleLevelDirective, logMissingExport, logCannotCallNamespace, logEval, LOGLEVEL_INFO, logFirstSideEffect, locate, logThisIsUndefined, logImportAttributeIsInvalid, logImportOptionsAreInvalid, error, logSyntheticNamedExportsNeedNamespaceExport, logMissingEntryExport, logInvalidFormatForTopLevelAwait, logDuplicateExportError, logInvalidSourcemapForError, augmentCodeLocation, logInconsistentImportAttributes, logNamespaceConflict, logAmbiguousExternalNamespaces, logShimmedExport, parseAst, logModuleParseError, parseAstAsync, logCircularReexport, logMissingNodeBuiltins, logIllegalIdentifierAsName, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, logAddonNotGenerated, logIncompatibleExportOptionValue, logMixedExport, logFailedValidation, isPathFragment, logCyclicCrossChunkReexport, getAliasName, logUnexpectedNamedImport, isAbsolute as isAbsolute$1, relative as relative$1, logUnexpectedNamespaceReexport, logEmptyChunk, logMissingGlobalName, logOptimizeChunkStatus, logSourcemapBroken, logConflictingSourcemapSources, logChunkInvalid, logInvalidOption, URL_OUTPUT_FORMAT, URL_OUTPUT_DIR, URL_OUTPUT_SOURCEMAPFILE, URL_OUTPUT_AMD_ID, logCannotAssignModuleToChunk, logAnonymousPluginCache, logDuplicatePluginName, LOGLEVEL_ERROR, logLevelPriority, relativeId, LOGLEVEL_DEBUG, logUnknownOption, printQuotedStringList, logInvalidSetAssetSourceCall, logPluginError, logNoTransformMapOrAstWithoutCode, logBadLoader, logExternalModulesCannotBeTransformedToModules, logInternalIdCannotBeExternal, isRelative, logUnresolvedImport, logUnresolvedImportTreatedAsExternal, logExternalSyntheticExports, logUnresolvedEntry, logUnresolvedImplicitDependant, logExternalModulesCannotBeIncludedInManualChunks, logEntryCannotBeExternal, logImplicitDependantCannotBeExternal, logNoAssetSourceSet, logFileReferenceIdNotFoundForFilename, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logInvalidRollupPhaseForChunkEmission, logFileNameConflict, logAssetNotFinalisedForFileName, logChunkNotGeneratedForFileName, logInvalidLogPosition, logInputHookInOutputPlugin, logInvalidFunctionPluginHook, logInvalidAddonPluginHook, logImplicitDependantIsNotIncluded, logCircularDependency, URL_TREESHAKE_MODULESIDEEFFECTS, URL_TREESHAKE, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_PRESERVEENTRYSIGNATURES, URL_OUTPUT_AMD_BASEPATH, logInvalidExportOptionValue, warnDeprecation, URL_OUTPUT_INTEROP, URL_OUTPUT_MANUALCHUNKS, isValidUrl, addTrailingSlashIfMissed, URL_OUTPUT_SOURCEMAPBASEURL, URL_OUTPUT_GENERATEDCODE, URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, logAlreadyClosed, logMissingFileOrDirOption, logCannotEmitFromOptionsHook, URL_WATCH } from './parseAst.js';
|
|
10
|
+
import { normalize, getImportPath, LOGLEVEL_WARN, logUnusedExternalImports, ANNOTATION_KEY, INVALID_ANNOTATION_KEY, logInvalidAnnotation, logRedeclarationError, logDuplicateArgumentNameError, logIllegalImportReassignment, logModuleLevelDirective, logConstVariableReassignError, logMissingExport, logCannotCallNamespace, logEval, LOGLEVEL_INFO, logFirstSideEffect, locate, logThisIsUndefined, logImportAttributeIsInvalid, logImportOptionsAreInvalid, error, logSyntheticNamedExportsNeedNamespaceExport, logMissingEntryExport, logInvalidFormatForTopLevelAwait, logDuplicateExportError, logInvalidSourcemapForError, augmentCodeLocation, logInconsistentImportAttributes, logNamespaceConflict, logAmbiguousExternalNamespaces, logShimmedExport, parseAst, logModuleParseError, parseAstAsync, logCircularReexport, logMissingNodeBuiltins, logIllegalIdentifierAsName, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, logAddonNotGenerated, logIncompatibleExportOptionValue, logMixedExport, logFailedValidation, isPathFragment, logCyclicCrossChunkReexport, getAliasName, logUnexpectedNamedImport, isAbsolute as isAbsolute$1, relative as relative$1, logUnexpectedNamespaceReexport, logEmptyChunk, logMissingGlobalName, logOptimizeChunkStatus, logSourcemapBroken, logConflictingSourcemapSources, logChunkInvalid, logInvalidOption, URL_OUTPUT_FORMAT, URL_OUTPUT_DIR, URL_OUTPUT_SOURCEMAPFILE, URL_OUTPUT_AMD_ID, logCannotAssignModuleToChunk, logAnonymousPluginCache, logDuplicatePluginName, LOGLEVEL_ERROR, logLevelPriority, relativeId, LOGLEVEL_DEBUG, logUnknownOption, printQuotedStringList, logInvalidSetAssetSourceCall, logPluginError, logNoTransformMapOrAstWithoutCode, logBadLoader, logExternalModulesCannotBeTransformedToModules, logInternalIdCannotBeExternal, isRelative, logUnresolvedImport, logUnresolvedImportTreatedAsExternal, logExternalSyntheticExports, logUnresolvedEntry, logUnresolvedImplicitDependant, logExternalModulesCannotBeIncludedInManualChunks, logEntryCannotBeExternal, logImplicitDependantCannotBeExternal, logNoAssetSourceSet, logFileReferenceIdNotFoundForFilename, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logInvalidRollupPhaseForChunkEmission, logFileNameConflict, logAssetNotFinalisedForFileName, logChunkNotGeneratedForFileName, logInvalidLogPosition, logInputHookInOutputPlugin, logInvalidFunctionPluginHook, logInvalidAddonPluginHook, logImplicitDependantIsNotIncluded, logCircularDependency, URL_TREESHAKE_MODULESIDEEFFECTS, URL_TREESHAKE, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_PRESERVEENTRYSIGNATURES, URL_OUTPUT_AMD_BASEPATH, logInvalidExportOptionValue, warnDeprecation, URL_OUTPUT_INTEROP, URL_OUTPUT_MANUALCHUNKS, isValidUrl, addTrailingSlashIfMissed, URL_OUTPUT_SOURCEMAPBASEURL, URL_OUTPUT_GENERATEDCODE, URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, logAlreadyClosed, logMissingFileOrDirOption, logCannotEmitFromOptionsHook, URL_WATCH } from './parseAst.js';
|
|
11
11
|
import { relative, dirname, basename, extname, resolve as resolve$1 } from 'node:path';
|
|
12
12
|
import require$$0$1, { win32, posix, isAbsolute, resolve } from 'path';
|
|
13
13
|
import process$1, { env as env$1 } from 'node:process';
|
|
14
14
|
import { performance } from 'node:perf_hooks';
|
|
15
|
-
import { xxhashBase64Url } from '../../native.js';
|
|
15
|
+
import { xxhashBase64Url, xxhashBase36, xxhashBase16 } from '../../native.js';
|
|
16
16
|
import { lstat, realpath, readdir, readFile, mkdir, writeFile } from 'node:fs/promises';
|
|
17
17
|
import * as tty from 'tty';
|
|
18
18
|
|
|
19
|
-
var version = "4.
|
|
19
|
+
var version = "4.11.0";
|
|
20
20
|
|
|
21
21
|
const comma = ','.charCodeAt(0);
|
|
22
22
|
const semicolon = ';'.charCodeAt(0);
|
|
@@ -274,6 +274,16 @@ let Chunk$1 = class Chunk {
|
|
|
274
274
|
this.intro = content + this.intro;
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
+
reset() {
|
|
278
|
+
this.intro = '';
|
|
279
|
+
this.outro = '';
|
|
280
|
+
if (this.edited) {
|
|
281
|
+
this.content = this.original;
|
|
282
|
+
this.storeName = false;
|
|
283
|
+
this.edited = false;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
277
287
|
split(index) {
|
|
278
288
|
const sliceIndex = index - this.start;
|
|
279
289
|
|
|
@@ -364,8 +374,8 @@ let Chunk$1 = class Chunk {
|
|
|
364
374
|
};
|
|
365
375
|
|
|
366
376
|
function getBtoa() {
|
|
367
|
-
if (typeof
|
|
368
|
-
return (str) =>
|
|
377
|
+
if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') {
|
|
378
|
+
return (str) => globalThis.btoa(unescape(encodeURIComponent(str)));
|
|
369
379
|
} else if (typeof Buffer === 'function') {
|
|
370
380
|
return (str) => Buffer.from(str, 'utf-8').toString('base64');
|
|
371
381
|
} else {
|
|
@@ -1042,6 +1052,28 @@ class MagicString {
|
|
|
1042
1052
|
return this;
|
|
1043
1053
|
}
|
|
1044
1054
|
|
|
1055
|
+
reset(start, end) {
|
|
1056
|
+
while (start < 0) start += this.original.length;
|
|
1057
|
+
while (end < 0) end += this.original.length;
|
|
1058
|
+
|
|
1059
|
+
if (start === end) return this;
|
|
1060
|
+
|
|
1061
|
+
if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');
|
|
1062
|
+
if (start > end) throw new Error('end must be greater than start');
|
|
1063
|
+
|
|
1064
|
+
this._split(start);
|
|
1065
|
+
this._split(end);
|
|
1066
|
+
|
|
1067
|
+
let chunk = this.byStart[start];
|
|
1068
|
+
|
|
1069
|
+
while (chunk) {
|
|
1070
|
+
chunk.reset();
|
|
1071
|
+
|
|
1072
|
+
chunk = end > chunk.end ? this.byStart[chunk.end] : null;
|
|
1073
|
+
}
|
|
1074
|
+
return this;
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1045
1077
|
lastChar() {
|
|
1046
1078
|
if (this.outro.length) return this.outro[this.outro.length - 1];
|
|
1047
1079
|
let chunk = this.lastChunk;
|
|
@@ -7996,6 +8028,12 @@ class AssignmentExpression extends NodeBase {
|
|
|
7996
8028
|
right.include(context, includeChildrenRecursively);
|
|
7997
8029
|
}
|
|
7998
8030
|
initialise() {
|
|
8031
|
+
if (this.left instanceof Identifier) {
|
|
8032
|
+
const variable = this.scope.variables.get(this.left.name);
|
|
8033
|
+
if (variable?.kind === 'const') {
|
|
8034
|
+
this.scope.context.error(logConstVariableReassignError(), this.left.start);
|
|
8035
|
+
}
|
|
8036
|
+
}
|
|
7999
8037
|
this.left.setAssignedValue(this.right);
|
|
8000
8038
|
}
|
|
8001
8039
|
render(code, options, { preventASI, renderedParentType, renderedSurroundingElement } = BLANK) {
|
|
@@ -12777,7 +12815,7 @@ class Module {
|
|
|
12777
12815
|
this.ast.bind();
|
|
12778
12816
|
}
|
|
12779
12817
|
error(properties, pos) {
|
|
12780
|
-
this.addLocationToLogProps(properties, pos);
|
|
12818
|
+
pos !== undefined && this.addLocationToLogProps(properties, pos);
|
|
12781
12819
|
return error(properties);
|
|
12782
12820
|
}
|
|
12783
12821
|
// sum up the length of all ast nodes that are included
|
|
@@ -13575,7 +13613,7 @@ function getCompleteAmdId(options, chunkId) {
|
|
|
13575
13613
|
return options.id ?? '';
|
|
13576
13614
|
}
|
|
13577
13615
|
|
|
13578
|
-
function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, mechanism = 'return ') {
|
|
13616
|
+
function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal, mechanism = 'return ') {
|
|
13579
13617
|
const { _, getDirectReturnFunction, getFunctionIntro, getPropertyAccess, n, s } = snippets;
|
|
13580
13618
|
if (!namedExportsMode) {
|
|
13581
13619
|
return `${n}${n}${mechanism}${getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings, getPropertyAccess)};`;
|
|
@@ -13632,6 +13670,16 @@ function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snip
|
|
|
13632
13670
|
if (specifier.reexported === '*') {
|
|
13633
13671
|
if (exportBlock)
|
|
13634
13672
|
exportBlock += n;
|
|
13673
|
+
if (!specifier.needsLiveBinding && reexportProtoFromExternal) {
|
|
13674
|
+
const protoString = "'__proto__'";
|
|
13675
|
+
exportBlock +=
|
|
13676
|
+
`Object.prototype.hasOwnProperty.call(${name},${_}${protoString})${_}&&${n}` +
|
|
13677
|
+
`${t}!Object.prototype.hasOwnProperty.call(exports,${_}${protoString})${_}&&${n}` +
|
|
13678
|
+
`${t}Object.defineProperty(exports,${_}${protoString},${_}{${n}` +
|
|
13679
|
+
`${t}${t}enumerable:${_}true,${n}` +
|
|
13680
|
+
`${t}${t}value:${_}${name}[${protoString}]${n}` +
|
|
13681
|
+
`${t}});${n}${n}`;
|
|
13682
|
+
}
|
|
13635
13683
|
const copyPropertyIfNecessary = `{${n}${t}if${_}(k${_}!==${_}'default'${_}&&${_}!Object.prototype.hasOwnProperty.call(exports,${_}k))${_}${getDefineProperty(name, specifier.needsLiveBinding, t, snippets)}${s}${n}}`;
|
|
13636
13684
|
exportBlock += `Object.keys(${name}).forEach(${getFunctionIntro(['k'], {
|
|
13637
13685
|
isAsync: false,
|
|
@@ -13715,9 +13763,7 @@ const getDefineProperty = (name, needsLiveBinding, t, { _, getDirectReturnFuncti
|
|
|
13715
13763
|
`${t}${t}enumerable:${_}true,${n}` +
|
|
13716
13764
|
`${t}${t}get:${_}${left}${name}[k]${right}${n}${t}})`);
|
|
13717
13765
|
}
|
|
13718
|
-
return
|
|
13719
|
-
`${t}${t}enumerable:${_}true,${n}` +
|
|
13720
|
-
`${t}${t}value:${_}${name}[k]${n}${t}})${_}:${_}exports[k]${_}=${_}${name}[k]`);
|
|
13766
|
+
return `exports[k]${_}=${_}${name}[k]`;
|
|
13721
13767
|
};
|
|
13722
13768
|
|
|
13723
13769
|
function getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, indent, snippets) {
|
|
@@ -13862,7 +13908,7 @@ function warnOnBuiltins(log, dependencies) {
|
|
|
13862
13908
|
log(LOGLEVEL_WARN, logMissingNodeBuiltins(externalBuiltins));
|
|
13863
13909
|
}
|
|
13864
13910
|
|
|
13865
|
-
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, strict }) {
|
|
13911
|
+
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 }) {
|
|
13866
13912
|
warnOnBuiltins(log, dependencies);
|
|
13867
13913
|
const deps = dependencies.map(m => `'${updateExtensionForRelativeAmdId(m.importPath, amd.forceJsExtensionForImports)}'`);
|
|
13868
13914
|
const parameters = dependencies.map(m => m.name);
|
|
@@ -13884,7 +13930,7 @@ function amd(magicString, { accessedGlobals, dependencies, exports, hasDefaultEx
|
|
|
13884
13930
|
(deps.length > 0 ? `[${deps.join(`,${_}`)}],${_}` : ``);
|
|
13885
13931
|
const useStrict = strict ? `${_}'use strict';` : '';
|
|
13886
13932
|
magicString.prepend(`${intro}${getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets)}`);
|
|
13887
|
-
const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings);
|
|
13933
|
+
const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal);
|
|
13888
13934
|
let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && (esModule === true || (esModule === 'if-default-prop' && hasDefaultExport)), isModuleFacade && symbols, snippets);
|
|
13889
13935
|
if (namespaceMarkers) {
|
|
13890
13936
|
namespaceMarkers = n + n + namespaceMarkers;
|
|
@@ -13901,7 +13947,7 @@ function amd(magicString, { accessedGlobals, dependencies, exports, hasDefaultEx
|
|
|
13901
13947
|
.append(`${n}${n}}));`);
|
|
13902
13948
|
}
|
|
13903
13949
|
|
|
13904
|
-
function cjs(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, indent: t, intro, isEntryFacade, isModuleFacade, namedExportsMode, outro, snippets }, { compact, esModule, externalLiveBindings, freeze, interop, generatedCode: { symbols }, strict }) {
|
|
13950
|
+
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 }) {
|
|
13905
13951
|
const { _, n } = snippets;
|
|
13906
13952
|
const useStrict = strict ? `'use strict';${n}${n}` : '';
|
|
13907
13953
|
let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, isEntryFacade && (esModule === true || (esModule === 'if-default-prop' && hasDefaultExport)), isModuleFacade && symbols, snippets);
|
|
@@ -13911,7 +13957,7 @@ function cjs(magicString, { accessedGlobals, dependencies, exports, hasDefaultEx
|
|
|
13911
13957
|
const importBlock = getImportBlock$1(dependencies, snippets, compact);
|
|
13912
13958
|
const interopBlock = getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets);
|
|
13913
13959
|
magicString.prepend(`${useStrict}${intro}${namespaceMarkers}${importBlock}${interopBlock}`);
|
|
13914
|
-
const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, `module.exports${_}=${_}`);
|
|
13960
|
+
const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal, `module.exports${_}=${_}`);
|
|
13915
13961
|
magicString.append(`${exportBlock}${outro}`);
|
|
13916
13962
|
}
|
|
13917
13963
|
function getImportBlock$1(dependencies, { _, cnst, n }, compact) {
|
|
@@ -14090,7 +14136,7 @@ function trimEmptyImports(dependencies) {
|
|
|
14090
14136
|
return [];
|
|
14091
14137
|
}
|
|
14092
14138
|
|
|
14093
|
-
function iife(magicString, { accessedGlobals, dependencies, exports, hasDefaultExport, hasExports, indent: t, intro, namedExportsMode, log, outro, snippets }, { compact, esModule, extend, freeze, externalLiveBindings, globals, interop, name, generatedCode: { symbols }, strict }) {
|
|
14139
|
+
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 }) {
|
|
14094
14140
|
const { _, getNonArrowFunctionIntro, getPropertyAccess, n } = snippets;
|
|
14095
14141
|
const isNamespaced = name && name.includes('.');
|
|
14096
14142
|
const useVariableAssignment = !extend && !isNamespaced;
|
|
@@ -14135,7 +14181,7 @@ function iife(magicString, { accessedGlobals, dependencies, exports, hasDefaultE
|
|
|
14135
14181
|
if (hasExports && !extend && namedExportsMode) {
|
|
14136
14182
|
wrapperOutro = `${n}${n}${t}return exports;${wrapperOutro}`;
|
|
14137
14183
|
}
|
|
14138
|
-
const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings);
|
|
14184
|
+
const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal);
|
|
14139
14185
|
let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule === true || (esModule === 'if-default-prop' && hasDefaultExport), symbols, snippets);
|
|
14140
14186
|
if (namespaceMarkers) {
|
|
14141
14187
|
namespaceMarkers = n + n + namespaceMarkers;
|
|
@@ -14308,7 +14354,7 @@ function safeAccess(name, globalVariable, { _, getPropertyAccess }) {
|
|
|
14308
14354
|
.map(part => (propertyPath += getPropertyAccess(part)))
|
|
14309
14355
|
.join(`${_}&&${_}`);
|
|
14310
14356
|
}
|
|
14311
|
-
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, strict }) {
|
|
14357
|
+
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 }) {
|
|
14312
14358
|
const { _, cnst, getFunctionIntro, getNonArrowFunctionIntro, getPropertyAccess, n, s } = snippets;
|
|
14313
14359
|
const factoryVariable = compact ? 'f' : 'factory';
|
|
14314
14360
|
const globalVariable = compact ? 'g' : 'global';
|
|
@@ -14389,7 +14435,7 @@ function umd(magicString, { accessedGlobals, dependencies, exports, hasDefaultEx
|
|
|
14389
14435
|
})}{${useStrict}${n}`;
|
|
14390
14436
|
const wrapperOutro = n + n + '}));';
|
|
14391
14437
|
magicString.prepend(`${intro}${getInteropBlock(dependencies, interop, externalLiveBindings, freeze, symbols, accessedGlobals, t, snippets)}`);
|
|
14392
|
-
const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings);
|
|
14438
|
+
const exportBlock = getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, reexportProtoFromExternal);
|
|
14393
14439
|
let namespaceMarkers = getNamespaceMarkers(namedExportsMode && hasExports, esModule === true || (esModule === 'if-default-prop' && hasDefaultExport), symbols, snippets);
|
|
14394
14440
|
if (namespaceMarkers) {
|
|
14395
14441
|
namespaceMarkers = n + n + namespaceMarkers;
|
|
@@ -14680,13 +14726,13 @@ const hashPlaceholderLeft = '!~{';
|
|
|
14680
14726
|
const hashPlaceholderRight = '}~';
|
|
14681
14727
|
const hashPlaceholderOverhead = hashPlaceholderLeft.length + hashPlaceholderRight.length;
|
|
14682
14728
|
// This is the size of a 128-bits xxhash with base64url encoding
|
|
14683
|
-
const
|
|
14684
|
-
const
|
|
14729
|
+
const MAX_HASH_SIZE = 22;
|
|
14730
|
+
const DEFAULT_HASH_SIZE = 8;
|
|
14685
14731
|
const getHashPlaceholderGenerator = () => {
|
|
14686
14732
|
let nextIndex = 0;
|
|
14687
|
-
return (optionName, hashSize
|
|
14688
|
-
if (hashSize >
|
|
14689
|
-
return error(logFailedValidation(`Hashes cannot be longer than ${
|
|
14733
|
+
return (optionName, hashSize) => {
|
|
14734
|
+
if (hashSize > MAX_HASH_SIZE) {
|
|
14735
|
+
return error(logFailedValidation(`Hashes cannot be longer than ${MAX_HASH_SIZE} characters, received ${hashSize}. Check the "${optionName}" option.`));
|
|
14690
14736
|
}
|
|
14691
14737
|
const placeholder = `${hashPlaceholderLeft}${toBase64(++nextIndex).padStart(hashSize - hashPlaceholderOverhead, '0')}${hashPlaceholderRight}`;
|
|
14692
14738
|
if (placeholder.length > hashSize) {
|
|
@@ -14695,7 +14741,7 @@ const getHashPlaceholderGenerator = () => {
|
|
|
14695
14741
|
return placeholder;
|
|
14696
14742
|
};
|
|
14697
14743
|
};
|
|
14698
|
-
const REPLACER_REGEX = new RegExp(`${hashPlaceholderLeft}[0-9a-zA-Z_$]{1,${
|
|
14744
|
+
const REPLACER_REGEX = new RegExp(`${hashPlaceholderLeft}[0-9a-zA-Z_$]{1,${MAX_HASH_SIZE - hashPlaceholderOverhead}}${hashPlaceholderRight}`, 'g');
|
|
14699
14745
|
const replacePlaceholders = (code, hashesByPlaceholder) => code.replace(REPLACER_REGEX, placeholder => hashesByPlaceholder.get(placeholder) || placeholder);
|
|
14700
14746
|
const replaceSinglePlaceholder = (code, placeholder, value) => code.replace(REPLACER_REGEX, match => (match === placeholder ? value : match));
|
|
14701
14747
|
const replacePlaceholdersWithDefaultAndGetContainedPlaceholders = (code, placeholders) => {
|
|
@@ -15059,7 +15105,8 @@ class Chunk {
|
|
|
15059
15105
|
: [chunkFileNames, 'output.chunkFileNames'];
|
|
15060
15106
|
fileName = renderNamePattern(typeof pattern === 'function' ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, {
|
|
15061
15107
|
format: () => format,
|
|
15062
|
-
hash: size => hashPlaceholder ||
|
|
15108
|
+
hash: size => hashPlaceholder ||
|
|
15109
|
+
(hashPlaceholder = this.getPlaceholder(patternName, size || DEFAULT_HASH_SIZE)),
|
|
15063
15110
|
name: () => this.getChunkName()
|
|
15064
15111
|
});
|
|
15065
15112
|
if (!hashPlaceholder) {
|
|
@@ -15087,7 +15134,8 @@ class Chunk {
|
|
|
15087
15134
|
sourcemapFileName = renderNamePattern(typeof pattern === 'function' ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, {
|
|
15088
15135
|
chunkhash: () => this.getPreliminaryFileName().hashPlaceholder || '',
|
|
15089
15136
|
format: () => format,
|
|
15090
|
-
hash: size => hashPlaceholder ||
|
|
15137
|
+
hash: size => hashPlaceholder ||
|
|
15138
|
+
(hashPlaceholder = this.getPlaceholder(patternName, size || DEFAULT_HASH_SIZE)),
|
|
15091
15139
|
name: () => this.getChunkName()
|
|
15092
15140
|
});
|
|
15093
15141
|
if (!hashPlaceholder) {
|
|
@@ -16786,21 +16834,23 @@ function collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain,
|
|
|
16786
16834
|
}
|
|
16787
16835
|
|
|
16788
16836
|
let textEncoder;
|
|
16789
|
-
|
|
16790
|
-
|
|
16837
|
+
const getHash64 = input => xxhashBase64Url(ensureBuffer(input));
|
|
16838
|
+
const getHash36 = input => xxhashBase36(ensureBuffer(input));
|
|
16839
|
+
const getHash16 = input => xxhashBase16(ensureBuffer(input));
|
|
16840
|
+
const hasherByType = {
|
|
16841
|
+
base36: getHash36,
|
|
16842
|
+
base64: getHash64,
|
|
16843
|
+
hex: getHash16
|
|
16844
|
+
};
|
|
16845
|
+
function ensureBuffer(input) {
|
|
16791
16846
|
if (typeof input === 'string') {
|
|
16792
16847
|
if (typeof Buffer === 'undefined') {
|
|
16793
16848
|
textEncoder ??= new TextEncoder();
|
|
16794
|
-
|
|
16849
|
+
return textEncoder.encode(input);
|
|
16795
16850
|
}
|
|
16796
|
-
|
|
16797
|
-
buffer = Buffer.from(input);
|
|
16798
|
-
}
|
|
16799
|
-
}
|
|
16800
|
-
else {
|
|
16801
|
-
buffer = input;
|
|
16851
|
+
return Buffer.from(input);
|
|
16802
16852
|
}
|
|
16803
|
-
return
|
|
16853
|
+
return input;
|
|
16804
16854
|
}
|
|
16805
16855
|
|
|
16806
16856
|
// this looks ridiculous, but it prevents sourcemap tooling from mistaking
|
|
@@ -16814,9 +16864,10 @@ async function renderChunks(chunks, bundle, pluginDriver, outputOptions, log) {
|
|
|
16814
16864
|
const renderedChunks = await Promise.all(chunks.map(chunk => chunk.render()));
|
|
16815
16865
|
timeEnd('render chunks', 2);
|
|
16816
16866
|
timeStart('transform chunks', 2);
|
|
16867
|
+
const getHash = hasherByType[outputOptions.hashCharacters];
|
|
16817
16868
|
const chunkGraph = getChunkGraph(chunks);
|
|
16818
|
-
const { initialHashesByPlaceholder, nonHashedChunksWithPlaceholders, renderedChunksByPlaceholder, hashDependenciesByPlaceholder } = await transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, log);
|
|
16819
|
-
const hashesByPlaceholder = generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, bundle);
|
|
16869
|
+
const { initialHashesByPlaceholder, nonHashedChunksWithPlaceholders, renderedChunksByPlaceholder, hashDependenciesByPlaceholder } = await transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, getHash, log);
|
|
16870
|
+
const hashesByPlaceholder = generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, bundle, getHash);
|
|
16820
16871
|
addChunksToBundle(renderedChunksByPlaceholder, hashesByPlaceholder, bundle, nonHashedChunksWithPlaceholders, pluginDriver, outputOptions);
|
|
16821
16872
|
timeEnd('transform chunks', 2);
|
|
16822
16873
|
}
|
|
@@ -16896,7 +16947,7 @@ async function transformChunk(magicString, fileName, usedModules, chunkGraph, op
|
|
|
16896
16947
|
map
|
|
16897
16948
|
};
|
|
16898
16949
|
}
|
|
16899
|
-
async function transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, log) {
|
|
16950
|
+
async function transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, getHash, log) {
|
|
16900
16951
|
const nonHashedChunksWithPlaceholders = [];
|
|
16901
16952
|
const renderedChunksByPlaceholder = new Map();
|
|
16902
16953
|
const hashDependenciesByPlaceholder = new Map();
|
|
@@ -16931,7 +16982,7 @@ async function transformChunksAndGenerateContentHashes(renderedChunks, chunkGrap
|
|
|
16931
16982
|
renderedChunksByPlaceholder.set(hashPlaceholder, transformedChunk);
|
|
16932
16983
|
hashDependenciesByPlaceholder.set(hashPlaceholder, {
|
|
16933
16984
|
containedPlaceholders,
|
|
16934
|
-
contentHash:
|
|
16985
|
+
contentHash: getHash(contentToHash)
|
|
16935
16986
|
});
|
|
16936
16987
|
}
|
|
16937
16988
|
else {
|
|
@@ -16939,7 +16990,7 @@ async function transformChunksAndGenerateContentHashes(renderedChunks, chunkGrap
|
|
|
16939
16990
|
}
|
|
16940
16991
|
const sourcemapHashPlaceholder = preliminarySourcemapFileName?.hashPlaceholder;
|
|
16941
16992
|
if (map && sourcemapHashPlaceholder) {
|
|
16942
|
-
initialHashesByPlaceholder.set(preliminarySourcemapFileName.hashPlaceholder,
|
|
16993
|
+
initialHashesByPlaceholder.set(preliminarySourcemapFileName.hashPlaceholder, getHash(map.toString()).slice(0, preliminarySourcemapFileName.hashPlaceholder.length));
|
|
16943
16994
|
}
|
|
16944
16995
|
}));
|
|
16945
16996
|
return {
|
|
@@ -16949,7 +17000,7 @@ async function transformChunksAndGenerateContentHashes(renderedChunks, chunkGrap
|
|
|
16949
17000
|
renderedChunksByPlaceholder
|
|
16950
17001
|
};
|
|
16951
17002
|
}
|
|
16952
|
-
function generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, bundle) {
|
|
17003
|
+
function generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, bundle, getHash) {
|
|
16953
17004
|
const hashesByPlaceholder = new Map(initialHashesByPlaceholder);
|
|
16954
17005
|
for (const [placeholder, { fileName }] of renderedChunksByPlaceholder) {
|
|
16955
17006
|
let contentToHash = '';
|
|
@@ -16969,7 +17020,7 @@ function generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlac
|
|
|
16969
17020
|
if (finalHash) {
|
|
16970
17021
|
contentToHash = finalHash;
|
|
16971
17022
|
}
|
|
16972
|
-
finalHash =
|
|
17023
|
+
finalHash = getHash(contentToHash).slice(0, placeholder.length);
|
|
16973
17024
|
finalFileName = replaceSinglePlaceholder(fileName, placeholder, finalHash);
|
|
16974
17025
|
} while (bundle[lowercaseBundleKeys].has(finalFileName.toLowerCase()));
|
|
16975
17026
|
bundle[finalFileName] = FILE_PLACEHOLDER;
|
|
@@ -18136,7 +18187,7 @@ function generateAssetFileName(name, source, sourceHash, outputOptions, bundle)
|
|
|
18136
18187
|
: outputOptions.assetFileNames, 'output.assetFileNames', {
|
|
18137
18188
|
ext: () => extname(emittedName).slice(1),
|
|
18138
18189
|
extname: () => extname(emittedName),
|
|
18139
|
-
hash: size => sourceHash.slice(0, Math.max(0, size ||
|
|
18190
|
+
hash: size => sourceHash.slice(0, Math.max(0, size || DEFAULT_HASH_SIZE)),
|
|
18140
18191
|
name: () => emittedName.slice(0, Math.max(0, emittedName.length - extname(emittedName).length))
|
|
18141
18192
|
}), bundle);
|
|
18142
18193
|
}
|
|
@@ -18245,9 +18296,11 @@ class FileEmitter {
|
|
|
18245
18296
|
this.facadeChunkByModule = facadeChunkByModule;
|
|
18246
18297
|
};
|
|
18247
18298
|
this.setOutputBundle = (bundle, outputOptions) => {
|
|
18299
|
+
const getHash = hasherByType[outputOptions.hashCharacters];
|
|
18248
18300
|
const output = (this.output = {
|
|
18249
18301
|
bundle,
|
|
18250
18302
|
fileNamesBySource: new Map(),
|
|
18303
|
+
getHash,
|
|
18251
18304
|
outputOptions
|
|
18252
18305
|
});
|
|
18253
18306
|
for (const emittedFile of this.filesByReferenceId.values()) {
|
|
@@ -18262,7 +18315,7 @@ class FileEmitter {
|
|
|
18262
18315
|
this.finalizeAdditionalAsset(consumedFile, consumedFile.source, output);
|
|
18263
18316
|
}
|
|
18264
18317
|
else {
|
|
18265
|
-
const sourceHash =
|
|
18318
|
+
const sourceHash = getHash(consumedFile.source);
|
|
18266
18319
|
getOrCreate(consumedAssetsByHash, sourceHash, () => []).push(consumedFile);
|
|
18267
18320
|
}
|
|
18268
18321
|
}
|
|
@@ -18285,7 +18338,7 @@ class FileEmitter {
|
|
|
18285
18338
|
assignReferenceId(file, idBase) {
|
|
18286
18339
|
let referenceId = idBase;
|
|
18287
18340
|
do {
|
|
18288
|
-
referenceId =
|
|
18341
|
+
referenceId = getHash64(referenceId).slice(0, 8).replaceAll('-', '$');
|
|
18289
18342
|
} while (this.filesByReferenceId.has(referenceId) ||
|
|
18290
18343
|
this.outputFileEmitters.some(({ filesByReferenceId }) => filesByReferenceId.has(referenceId)));
|
|
18291
18344
|
file.referenceId = referenceId;
|
|
@@ -18396,11 +18449,11 @@ class FileEmitter {
|
|
|
18396
18449
|
}
|
|
18397
18450
|
return referenceId;
|
|
18398
18451
|
}
|
|
18399
|
-
finalizeAdditionalAsset(consumedFile, source, { bundle, fileNamesBySource, outputOptions }) {
|
|
18452
|
+
finalizeAdditionalAsset(consumedFile, source, { bundle, fileNamesBySource, getHash, outputOptions }) {
|
|
18400
18453
|
let { fileName, needsCodeReference, referenceId } = consumedFile;
|
|
18401
18454
|
// Deduplicate assets if an explicit fileName is not provided
|
|
18402
18455
|
if (!fileName) {
|
|
18403
|
-
const sourceHash =
|
|
18456
|
+
const sourceHash = getHash(source);
|
|
18404
18457
|
fileName = fileNamesBySource.get(sourceHash);
|
|
18405
18458
|
if (!fileName) {
|
|
18406
18459
|
fileName = generateAssetFileName(consumedFile.name, source, sourceHash, outputOptions, bundle);
|
|
@@ -19258,6 +19311,7 @@ async function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
|
|
|
19258
19311
|
freeze: config.freeze ?? true,
|
|
19259
19312
|
generatedCode,
|
|
19260
19313
|
globals: config.globals || {},
|
|
19314
|
+
hashCharacters: config.hashCharacters ?? 'base64',
|
|
19261
19315
|
hoistTransitiveImports: config.hoistTransitiveImports ?? true,
|
|
19262
19316
|
indent: getIndent(config, compact),
|
|
19263
19317
|
inlineDynamicImports,
|
|
@@ -19272,6 +19326,7 @@ async function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
|
|
|
19272
19326
|
plugins: await normalizePluginOption(config.plugins),
|
|
19273
19327
|
preserveModules,
|
|
19274
19328
|
preserveModulesRoot: getPreserveModulesRoot(config),
|
|
19329
|
+
reexportProtoFromExternal: config.reexportProtoFromExternal ?? true,
|
|
19275
19330
|
sanitizeFileName: typeof config.sanitizeFileName === 'function'
|
|
19276
19331
|
? config.sanitizeFileName
|
|
19277
19332
|
: config.sanitizeFileName === false
|
|
@@ -19958,6 +20013,7 @@ async function mergeOutputOptions(config, overrides, log) {
|
|
|
19958
20013
|
freeze: getOption('freeze'),
|
|
19959
20014
|
generatedCode: getObjectOption(config, overrides, 'generatedCode', objectifyOptionWithPresets(generatedCodePresets, 'output.generatedCode', URL_OUTPUT_GENERATEDCODE, '')),
|
|
19960
20015
|
globals: getOption('globals'),
|
|
20016
|
+
hashCharacters: getOption('hashCharacters'),
|
|
19961
20017
|
hoistTransitiveImports: getOption('hoistTransitiveImports'),
|
|
19962
20018
|
indent: getOption('indent'),
|
|
19963
20019
|
inlineDynamicImports: getOption('inlineDynamicImports'),
|
|
@@ -19972,6 +20028,7 @@ async function mergeOutputOptions(config, overrides, log) {
|
|
|
19972
20028
|
plugins: await normalizePluginOption(config.plugins),
|
|
19973
20029
|
preserveModules: getOption('preserveModules'),
|
|
19974
20030
|
preserveModulesRoot: getOption('preserveModulesRoot'),
|
|
20031
|
+
reexportProtoFromExternal: getOption('reexportProtoFromExternal'),
|
|
19975
20032
|
sanitizeFileName: getOption('sanitizeFileName'),
|
|
19976
20033
|
sourcemap: getOption('sourcemap'),
|
|
19977
20034
|
sourcemapBaseUrl: getOption('sourcemapBaseUrl'),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.11.0
|
|
4
|
+
Thu, 15 Feb 2024 06:09:01 GMT - commit 90ad652b745c5fe7167d92b4ad671cc387577a99
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -360,7 +360,7 @@ function augmentCodeLocation(properties, pos, source, id) {
|
|
|
360
360
|
}
|
|
361
361
|
// Error codes should be sorted alphabetically while errors should be sorted by
|
|
362
362
|
// error code below
|
|
363
|
-
const ADDON_ERROR = 'ADDON_ERROR', ALREADY_CLOSED = 'ALREADY_CLOSED', AMBIGUOUS_EXTERNAL_NAMESPACES = 'AMBIGUOUS_EXTERNAL_NAMESPACES', ANONYMOUS_PLUGIN_CACHE = 'ANONYMOUS_PLUGIN_CACHE', ASSET_NOT_FINALISED = 'ASSET_NOT_FINALISED', ASSET_NOT_FOUND = 'ASSET_NOT_FOUND', ASSET_SOURCE_ALREADY_SET = 'ASSET_SOURCE_ALREADY_SET', ASSET_SOURCE_MISSING = 'ASSET_SOURCE_MISSING', BAD_LOADER = 'BAD_LOADER', CANNOT_CALL_NAMESPACE = 'CANNOT_CALL_NAMESPACE', CANNOT_EMIT_FROM_OPTIONS_HOOK = 'CANNOT_EMIT_FROM_OPTIONS_HOOK', CHUNK_NOT_GENERATED = 'CHUNK_NOT_GENERATED', CHUNK_INVALID = 'CHUNK_INVALID', CIRCULAR_DEPENDENCY = 'CIRCULAR_DEPENDENCY', CIRCULAR_REEXPORT = 'CIRCULAR_REEXPORT', CYCLIC_CROSS_CHUNK_REEXPORT = 'CYCLIC_CROSS_CHUNK_REEXPORT', DEPRECATED_FEATURE = 'DEPRECATED_FEATURE', DUPLICATE_ARGUMENT_NAME = 'DUPLICATE_ARGUMENT_NAME', DUPLICATE_EXPORT = 'DUPLICATE_EXPORT', DUPLICATE_PLUGIN_NAME = 'DUPLICATE_PLUGIN_NAME', EMPTY_BUNDLE = 'EMPTY_BUNDLE', EVAL = 'EVAL', EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS = 'EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS', EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES = 'EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES', EXTERNAL_SYNTHETIC_EXPORTS = 'EXTERNAL_SYNTHETIC_EXPORTS', FILE_NAME_CONFLICT = 'FILE_NAME_CONFLICT', FILE_NOT_FOUND = 'FILE_NOT_FOUND', FIRST_SIDE_EFFECT = 'FIRST_SIDE_EFFECT', ILLEGAL_IDENTIFIER_AS_NAME = 'ILLEGAL_IDENTIFIER_AS_NAME', ILLEGAL_REASSIGNMENT = 'ILLEGAL_REASSIGNMENT', INCONSISTENT_IMPORT_ATTRIBUTES = 'INCONSISTENT_IMPORT_ATTRIBUTES', INVALID_ANNOTATION = 'INVALID_ANNOTATION', INPUT_HOOK_IN_OUTPUT_PLUGIN = 'INPUT_HOOK_IN_OUTPUT_PLUGIN', INVALID_CHUNK = 'INVALID_CHUNK', INVALID_EXPORT_OPTION = 'INVALID_EXPORT_OPTION', INVALID_EXTERNAL_ID = 'INVALID_EXTERNAL_ID', INVALID_IMPORT_ATTRIBUTE = 'INVALID_IMPORT_ATTRIBUTE', INVALID_LOG_POSITION = 'INVALID_LOG_POSITION', INVALID_OPTION = 'INVALID_OPTION', INVALID_PLUGIN_HOOK = 'INVALID_PLUGIN_HOOK', INVALID_ROLLUP_PHASE = 'INVALID_ROLLUP_PHASE', INVALID_SETASSETSOURCE = 'INVALID_SETASSETSOURCE', INVALID_TLA_FORMAT = 'INVALID_TLA_FORMAT', MISSING_EXPORT = 'MISSING_EXPORT', MISSING_GLOBAL_NAME = 'MISSING_GLOBAL_NAME', MISSING_IMPLICIT_DEPENDANT = 'MISSING_IMPLICIT_DEPENDANT', MISSING_NAME_OPTION_FOR_IIFE_EXPORT = 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT', MISSING_NODE_BUILTINS = 'MISSING_NODE_BUILTINS', MISSING_OPTION = 'MISSING_OPTION', MIXED_EXPORTS = 'MIXED_EXPORTS', MODULE_LEVEL_DIRECTIVE = 'MODULE_LEVEL_DIRECTIVE', NAMESPACE_CONFLICT = 'NAMESPACE_CONFLICT', NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE = 'NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE', OPTIMIZE_CHUNK_STATUS = 'OPTIMIZE_CHUNK_STATUS', PARSE_ERROR = 'PARSE_ERROR', PLUGIN_ERROR = 'PLUGIN_ERROR', REDECLARATION_ERROR = 'REDECLARATION_ERROR', SHIMMED_EXPORT = 'SHIMMED_EXPORT', SOURCEMAP_BROKEN = 'SOURCEMAP_BROKEN', SOURCEMAP_ERROR = 'SOURCEMAP_ERROR', SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT = 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT', THIS_IS_UNDEFINED = 'THIS_IS_UNDEFINED', UNEXPECTED_NAMED_IMPORT = 'UNEXPECTED_NAMED_IMPORT', UNKNOWN_OPTION = 'UNKNOWN_OPTION', UNRESOLVED_ENTRY = 'UNRESOLVED_ENTRY', UNRESOLVED_IMPORT = 'UNRESOLVED_IMPORT', UNUSED_EXTERNAL_IMPORT = 'UNUSED_EXTERNAL_IMPORT', VALIDATION_ERROR = 'VALIDATION_ERROR';
|
|
363
|
+
const ADDON_ERROR = 'ADDON_ERROR', ALREADY_CLOSED = 'ALREADY_CLOSED', AMBIGUOUS_EXTERNAL_NAMESPACES = 'AMBIGUOUS_EXTERNAL_NAMESPACES', ANONYMOUS_PLUGIN_CACHE = 'ANONYMOUS_PLUGIN_CACHE', ASSET_NOT_FINALISED = 'ASSET_NOT_FINALISED', ASSET_NOT_FOUND = 'ASSET_NOT_FOUND', ASSET_SOURCE_ALREADY_SET = 'ASSET_SOURCE_ALREADY_SET', ASSET_SOURCE_MISSING = 'ASSET_SOURCE_MISSING', BAD_LOADER = 'BAD_LOADER', CANNOT_CALL_NAMESPACE = 'CANNOT_CALL_NAMESPACE', CANNOT_EMIT_FROM_OPTIONS_HOOK = 'CANNOT_EMIT_FROM_OPTIONS_HOOK', CHUNK_NOT_GENERATED = 'CHUNK_NOT_GENERATED', CHUNK_INVALID = 'CHUNK_INVALID', CIRCULAR_DEPENDENCY = 'CIRCULAR_DEPENDENCY', CIRCULAR_REEXPORT = 'CIRCULAR_REEXPORT', CONST_REASSIGN = 'CONST_REASSIGN', CYCLIC_CROSS_CHUNK_REEXPORT = 'CYCLIC_CROSS_CHUNK_REEXPORT', DEPRECATED_FEATURE = 'DEPRECATED_FEATURE', DUPLICATE_ARGUMENT_NAME = 'DUPLICATE_ARGUMENT_NAME', DUPLICATE_EXPORT = 'DUPLICATE_EXPORT', DUPLICATE_PLUGIN_NAME = 'DUPLICATE_PLUGIN_NAME', EMPTY_BUNDLE = 'EMPTY_BUNDLE', EVAL = 'EVAL', EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS = 'EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS', EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES = 'EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES', EXTERNAL_SYNTHETIC_EXPORTS = 'EXTERNAL_SYNTHETIC_EXPORTS', FILE_NAME_CONFLICT = 'FILE_NAME_CONFLICT', FILE_NOT_FOUND = 'FILE_NOT_FOUND', FIRST_SIDE_EFFECT = 'FIRST_SIDE_EFFECT', ILLEGAL_IDENTIFIER_AS_NAME = 'ILLEGAL_IDENTIFIER_AS_NAME', ILLEGAL_REASSIGNMENT = 'ILLEGAL_REASSIGNMENT', INCONSISTENT_IMPORT_ATTRIBUTES = 'INCONSISTENT_IMPORT_ATTRIBUTES', INVALID_ANNOTATION = 'INVALID_ANNOTATION', INPUT_HOOK_IN_OUTPUT_PLUGIN = 'INPUT_HOOK_IN_OUTPUT_PLUGIN', INVALID_CHUNK = 'INVALID_CHUNK', INVALID_EXPORT_OPTION = 'INVALID_EXPORT_OPTION', INVALID_EXTERNAL_ID = 'INVALID_EXTERNAL_ID', INVALID_IMPORT_ATTRIBUTE = 'INVALID_IMPORT_ATTRIBUTE', INVALID_LOG_POSITION = 'INVALID_LOG_POSITION', INVALID_OPTION = 'INVALID_OPTION', INVALID_PLUGIN_HOOK = 'INVALID_PLUGIN_HOOK', INVALID_ROLLUP_PHASE = 'INVALID_ROLLUP_PHASE', INVALID_SETASSETSOURCE = 'INVALID_SETASSETSOURCE', INVALID_TLA_FORMAT = 'INVALID_TLA_FORMAT', MISSING_EXPORT = 'MISSING_EXPORT', MISSING_GLOBAL_NAME = 'MISSING_GLOBAL_NAME', MISSING_IMPLICIT_DEPENDANT = 'MISSING_IMPLICIT_DEPENDANT', MISSING_NAME_OPTION_FOR_IIFE_EXPORT = 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT', MISSING_NODE_BUILTINS = 'MISSING_NODE_BUILTINS', MISSING_OPTION = 'MISSING_OPTION', MIXED_EXPORTS = 'MIXED_EXPORTS', MODULE_LEVEL_DIRECTIVE = 'MODULE_LEVEL_DIRECTIVE', NAMESPACE_CONFLICT = 'NAMESPACE_CONFLICT', NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE = 'NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE', OPTIMIZE_CHUNK_STATUS = 'OPTIMIZE_CHUNK_STATUS', PARSE_ERROR = 'PARSE_ERROR', PLUGIN_ERROR = 'PLUGIN_ERROR', REDECLARATION_ERROR = 'REDECLARATION_ERROR', SHIMMED_EXPORT = 'SHIMMED_EXPORT', SOURCEMAP_BROKEN = 'SOURCEMAP_BROKEN', SOURCEMAP_ERROR = 'SOURCEMAP_ERROR', SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT = 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT', THIS_IS_UNDEFINED = 'THIS_IS_UNDEFINED', UNEXPECTED_NAMED_IMPORT = 'UNEXPECTED_NAMED_IMPORT', UNKNOWN_OPTION = 'UNKNOWN_OPTION', UNRESOLVED_ENTRY = 'UNRESOLVED_ENTRY', UNRESOLVED_IMPORT = 'UNRESOLVED_IMPORT', UNUSED_EXTERNAL_IMPORT = 'UNUSED_EXTERNAL_IMPORT', VALIDATION_ERROR = 'VALIDATION_ERROR';
|
|
364
364
|
function logAddonNotGenerated(message, hook, plugin) {
|
|
365
365
|
return {
|
|
366
366
|
code: ADDON_ERROR,
|
|
@@ -476,6 +476,12 @@ function logDeprecation(deprecation, urlSnippet, plugin) {
|
|
|
476
476
|
...(plugin ? { plugin } : {})
|
|
477
477
|
};
|
|
478
478
|
}
|
|
479
|
+
function logConstVariableReassignError() {
|
|
480
|
+
return {
|
|
481
|
+
code: CONST_REASSIGN,
|
|
482
|
+
message: 'Cannot reassign a variable declared with `const`'
|
|
483
|
+
};
|
|
484
|
+
}
|
|
479
485
|
function logDuplicateArgumentNameError(name) {
|
|
480
486
|
return { code: DUPLICATE_ARGUMENT_NAME, message: `Duplicate argument name "${name}"` };
|
|
481
487
|
}
|
|
@@ -971,6 +977,10 @@ const nodeConverters = [
|
|
|
971
977
|
const message = convertString(position, buffer, readString);
|
|
972
978
|
error(logParseError(message, pos));
|
|
973
979
|
},
|
|
980
|
+
function panicError(position, buffer, readString) {
|
|
981
|
+
const message = convertString(position, buffer, readString);
|
|
982
|
+
error(logParseError(message));
|
|
983
|
+
},
|
|
974
984
|
function arrayExpression(position, buffer, readString) {
|
|
975
985
|
const start = buffer[position++];
|
|
976
986
|
const end = buffer[position++];
|
|
@@ -2108,4 +2118,4 @@ const parseAstAsync = async (input, { allowReturnOutsideFunction = false, signal
|
|
|
2108
2118
|
return convertProgram(astBuffer.buffer, getReadStringFunction(astBuffer));
|
|
2109
2119
|
};
|
|
2110
2120
|
|
|
2111
|
-
export { ANNOTATION_KEY, INVALID_ANNOTATION_KEY, LOGLEVEL_DEBUG, LOGLEVEL_ERROR, LOGLEVEL_INFO, LOGLEVEL_WARN, URL_OUTPUT_AMD_BASEPATH, URL_OUTPUT_AMD_ID, URL_OUTPUT_DIR, URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, URL_OUTPUT_FORMAT, URL_OUTPUT_GENERATEDCODE, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_OUTPUT_INTEROP, URL_OUTPUT_MANUALCHUNKS, URL_OUTPUT_SOURCEMAPBASEURL, URL_OUTPUT_SOURCEMAPFILE, URL_PRESERVEENTRYSIGNATURES, URL_TREESHAKE, URL_TREESHAKE_MODULESIDEEFFECTS, URL_WATCH, addTrailingSlashIfMissed, augmentCodeLocation, error, getAliasName, getImportPath, isAbsolute, isPathFragment, isRelative, isValidUrl, locate, logAddonNotGenerated, logAlreadyClosed, logAmbiguousExternalNamespaces, logAnonymousPluginCache, logAssetNotFinalisedForFileName, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logBadLoader, logCannotAssignModuleToChunk, logCannotCallNamespace, logCannotEmitFromOptionsHook, logChunkInvalid, logChunkNotGeneratedForFileName, logCircularDependency, logCircularReexport, logConflictingSourcemapSources, logCyclicCrossChunkReexport, logDuplicateArgumentNameError, logDuplicateExportError, logDuplicatePluginName, logEmptyChunk, logEntryCannotBeExternal, logEval, logExternalModulesCannotBeIncludedInManualChunks, logExternalModulesCannotBeTransformedToModules, logExternalSyntheticExports, logFailedValidation, logFileNameConflict, logFileReferenceIdNotFoundForFilename, logFirstSideEffect, logIllegalIdentifierAsName, logIllegalImportReassignment, logImplicitDependantCannotBeExternal, logImplicitDependantIsNotIncluded, logImportAttributeIsInvalid, logImportOptionsAreInvalid, logIncompatibleExportOptionValue, logInconsistentImportAttributes, logInputHookInOutputPlugin, logInternalIdCannotBeExternal, logInvalidAddonPluginHook, logInvalidAnnotation, logInvalidExportOptionValue, logInvalidFormatForTopLevelAwait, logInvalidFunctionPluginHook, logInvalidLogPosition, logInvalidOption, logInvalidRollupPhaseForChunkEmission, logInvalidSetAssetSourceCall, logInvalidSourcemapForError, logLevelPriority, logMissingEntryExport, logMissingExport, logMissingFileOrDirOption, logMissingGlobalName, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, logMissingNodeBuiltins, logMixedExport, logModuleLevelDirective, logModuleParseError, logNamespaceConflict, logNoAssetSourceSet, logNoTransformMapOrAstWithoutCode, logOptimizeChunkStatus, logPluginError, logRedeclarationError, logShimmedExport, logSourcemapBroken, logSyntheticNamedExportsNeedNamespaceExport, logThisIsUndefined, logUnexpectedNamedImport, logUnexpectedNamespaceReexport, logUnknownOption, logUnresolvedEntry, logUnresolvedImplicitDependant, logUnresolvedImport, logUnresolvedImportTreatedAsExternal, logUnusedExternalImports, normalize, parseAst, parseAstAsync, printQuotedStringList, relative, relativeId, warnDeprecation };
|
|
2121
|
+
export { ANNOTATION_KEY, INVALID_ANNOTATION_KEY, LOGLEVEL_DEBUG, LOGLEVEL_ERROR, LOGLEVEL_INFO, LOGLEVEL_WARN, URL_OUTPUT_AMD_BASEPATH, URL_OUTPUT_AMD_ID, URL_OUTPUT_DIR, URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, URL_OUTPUT_FORMAT, URL_OUTPUT_GENERATEDCODE, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_OUTPUT_INTEROP, URL_OUTPUT_MANUALCHUNKS, URL_OUTPUT_SOURCEMAPBASEURL, URL_OUTPUT_SOURCEMAPFILE, URL_PRESERVEENTRYSIGNATURES, URL_TREESHAKE, URL_TREESHAKE_MODULESIDEEFFECTS, URL_WATCH, addTrailingSlashIfMissed, augmentCodeLocation, error, getAliasName, getImportPath, isAbsolute, isPathFragment, isRelative, isValidUrl, locate, logAddonNotGenerated, logAlreadyClosed, logAmbiguousExternalNamespaces, logAnonymousPluginCache, logAssetNotFinalisedForFileName, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logBadLoader, logCannotAssignModuleToChunk, logCannotCallNamespace, logCannotEmitFromOptionsHook, logChunkInvalid, logChunkNotGeneratedForFileName, logCircularDependency, logCircularReexport, logConflictingSourcemapSources, logConstVariableReassignError, logCyclicCrossChunkReexport, logDuplicateArgumentNameError, logDuplicateExportError, logDuplicatePluginName, logEmptyChunk, logEntryCannotBeExternal, logEval, logExternalModulesCannotBeIncludedInManualChunks, logExternalModulesCannotBeTransformedToModules, logExternalSyntheticExports, logFailedValidation, logFileNameConflict, logFileReferenceIdNotFoundForFilename, logFirstSideEffect, logIllegalIdentifierAsName, logIllegalImportReassignment, logImplicitDependantCannotBeExternal, logImplicitDependantIsNotIncluded, logImportAttributeIsInvalid, logImportOptionsAreInvalid, logIncompatibleExportOptionValue, logInconsistentImportAttributes, logInputHookInOutputPlugin, logInternalIdCannotBeExternal, logInvalidAddonPluginHook, logInvalidAnnotation, logInvalidExportOptionValue, logInvalidFormatForTopLevelAwait, logInvalidFunctionPluginHook, logInvalidLogPosition, logInvalidOption, logInvalidRollupPhaseForChunkEmission, logInvalidSetAssetSourceCall, logInvalidSourcemapForError, logLevelPriority, logMissingEntryExport, logMissingExport, logMissingFileOrDirOption, logMissingGlobalName, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, logMissingNodeBuiltins, logMixedExport, logModuleLevelDirective, logModuleParseError, logNamespaceConflict, logNoAssetSourceSet, logNoTransformMapOrAstWithoutCode, logOptimizeChunkStatus, logPluginError, logRedeclarationError, logShimmedExport, logSourcemapBroken, logSyntheticNamedExportsNeedNamespaceExport, logThisIsUndefined, logUnexpectedNamedImport, logUnexpectedNamespaceReexport, logUnknownOption, logUnresolvedEntry, logUnresolvedImplicitDependant, logUnresolvedImport, logUnresolvedImportTreatedAsExternal, logUnusedExternalImports, normalize, parseAst, parseAstAsync, printQuotedStringList, relative, relativeId, warnDeprecation };
|
package/dist/es/shared/watch.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.11.0
|
|
4
|
+
Thu, 15 Feb 2024 06:09:01 GMT - commit 90ad652b745c5fe7167d92b4ad671cc387577a99
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -2387,6 +2387,7 @@ var constants = {};
|
|
|
2387
2387
|
exports.FSEVENT_MOVED = 'moved';
|
|
2388
2388
|
exports.FSEVENT_CLONED = 'cloned';
|
|
2389
2389
|
exports.FSEVENT_UNKNOWN = 'unknown';
|
|
2390
|
+
exports.FSEVENT_FLAG_MUST_SCAN_SUBDIRS = 1;
|
|
2390
2391
|
exports.FSEVENT_TYPE_FILE = 'file';
|
|
2391
2392
|
exports.FSEVENT_TYPE_DIRECTORY = 'directory';
|
|
2392
2393
|
exports.FSEVENT_TYPE_SYMLINK = 'symlink';
|
|
@@ -3112,6 +3113,7 @@ const {
|
|
|
3112
3113
|
FSEVENT_MOVED,
|
|
3113
3114
|
// FSEVENT_CLONED,
|
|
3114
3115
|
FSEVENT_UNKNOWN,
|
|
3116
|
+
FSEVENT_FLAG_MUST_SCAN_SUBDIRS,
|
|
3115
3117
|
FSEVENT_TYPE_FILE,
|
|
3116
3118
|
FSEVENT_TYPE_DIRECTORY,
|
|
3117
3119
|
FSEVENT_TYPE_SYMLINK,
|
|
@@ -3223,6 +3225,7 @@ function setFSEventsListener(path, realPath, listener, rawEmitter) {
|
|
|
3223
3225
|
rawEmitter,
|
|
3224
3226
|
watcher: createFSEventsInstance(watchPath, (fullPath, flags) => {
|
|
3225
3227
|
if (!cont.listeners.size) return;
|
|
3228
|
+
if (flags & FSEVENT_FLAG_MUST_SCAN_SUBDIRS) return;
|
|
3226
3229
|
const info = fsevents.getInfo(fullPath, flags);
|
|
3227
3230
|
cont.listeners.forEach(list => {
|
|
3228
3231
|
list(fullPath, flags, info);
|
|
@@ -4041,7 +4044,7 @@ add(paths_, _origAdd, _internal) {
|
|
|
4041
4044
|
|
|
4042
4045
|
if (this.options.useFsEvents && this._fsEventsHandler) {
|
|
4043
4046
|
if (!this._readyCount) this._readyCount = paths.length;
|
|
4044
|
-
if (this.options.persistent) this._readyCount
|
|
4047
|
+
if (this.options.persistent) this._readyCount += paths.length;
|
|
4045
4048
|
paths.forEach((path) => this._fsEventsHandler._addToFsEvents(path));
|
|
4046
4049
|
} else {
|
|
4047
4050
|
if (!this._readyCount) this._readyCount = 0;
|
package/dist/getLogFilter.js
CHANGED
package/dist/loadConfigFile.js
CHANGED
package/dist/native.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {
|
|
2
|
+
parse,
|
|
3
|
+
xxhashBase64Url,
|
|
4
|
+
xxhashBase36,
|
|
5
|
+
xxhashBase16
|
|
6
|
+
} = require('./wasm-node/bindings_wasm.js');
|
|
2
7
|
|
|
3
8
|
exports.parse = parse;
|
|
4
9
|
exports.parseAsync = async (code, allowReturnOutsideFunction, _signal) =>
|
|
5
10
|
parse(code, allowReturnOutsideFunction);
|
|
6
11
|
exports.xxhashBase64Url = xxhashBase64Url;
|
|
12
|
+
exports.xxhashBase36 = xxhashBase36;
|
|
13
|
+
exports.xxhashBase16 = xxhashBase16;
|
package/dist/parseAst.js
CHANGED