@rollup/wasm-node 4.56.0 → 4.57.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/dist/bin/rollup +3 -3
- 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 +137 -116
- package/dist/es/shared/parseAst.js +5 -3
- package/dist/es/shared/watch.js +2 -2
- package/dist/getLogFilter.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/parseAst.js +2 -2
- package/dist/rollup.d.ts +40 -5
- package/dist/rollup.js +2 -2
- package/dist/shared/fsevents-importer.js +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/parseAst.js +6 -2
- package/dist/shared/rollup.js +53 -32
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/dist/wasm-node/bindings_wasm_bg.wasm +0 -0
- package/package.json +18 -18
package/dist/bin/rollup
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*
|
|
3
3
|
@license
|
|
4
|
-
Rollup.js v4.
|
|
5
|
-
|
|
4
|
+
Rollup.js v4.57.1
|
|
5
|
+
Fri, 30 Jan 2026 08:13:08 GMT - commit d37675f25150d6a94dcf4138853bdc2ecb3ce57b
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
8
8
|
|
|
@@ -27,7 +27,7 @@ require('node:perf_hooks');
|
|
|
27
27
|
require('node:url');
|
|
28
28
|
require('../getLogFilter.js');
|
|
29
29
|
|
|
30
|
-
const help = "rollup version 4.
|
|
30
|
+
const help = "rollup version 4.57.1\n=====================================\n\nUsage: rollup [options] <entry file>\n\nOptions:\n\n-c, --config <filename> Use this config file (if argument is used but value\n is unspecified, Rollup will try to load configuration files in\n the following order:\n rollup.config.mjs -> rollup.config.cjs -> rollup.config.js)\n-d, --dir <dirname> Directory for chunks (if absent, prints to stdout)\n-e, --external <ids> Comma-separate list of module IDs to exclude\n-f, --format <format> Type of output (amd, cjs, es, iife, umd, system)\n-g, --globals <pairs> Comma-separate list of `moduleID:Global` pairs\n-h, --help Show this help message\n-i, --input <filename> Input (alternative to <entry file>)\n-m, --sourcemap Generate sourcemap (`-m inline` for inline map)\n-n, --name <name> Name for UMD export\n-o, --file <output> Single output file (if absent, prints to stdout)\n-p, --plugin <plugin> Use the plugin specified (may be repeated)\n-v, --version Show version number\n-w, --watch Watch files in bundle and rebuild on changes\n--amd.autoId Generate the AMD ID based off the chunk name\n--amd.basePath <prefix> Path to prepend to auto generated AMD ID\n--amd.define <name> Function to use in place of `define`\n--amd.forceJsExtensionForImports Use `.js` extension in AMD imports\n--amd.id <id> ID for AMD module (default is anonymous)\n--assetFileNames <pattern> Name pattern for emitted assets\n--banner <text> Code to insert at top of bundle (outside wrapper)\n--chunkFileNames <pattern> Name pattern for emitted secondary chunks\n--compact Minify wrapper code\n--context <variable> Specify top-level `this` value\n--no-dynamicImportInCjs Write external dynamic CommonJS imports as require\n--entryFileNames <pattern> Name pattern for emitted entry chunks\n--environment <values> Settings passed to config file (see example)\n--no-esModule Do not add __esModule property\n--exports <mode> Specify export mode (auto, default, named, none)\n--extend Extend global variable defined by --name\n--no-externalImportAttributes Omit import attributes in \"es\" output\n--no-externalLiveBindings Do not generate code to support live bindings\n--failAfterWarnings Exit with an error if the build produced warnings\n--filterLogs <filter> Filter log messages\n--footer <text> Code to insert at end of bundle (outside wrapper)\n--forceExit Force exit the process when done\n--no-freeze Do not freeze namespace objects\n--generatedCode <preset> Which code features to use (es5/es2015)\n--generatedCode.arrowFunctions Use arrow functions in generated code\n--generatedCode.constBindings Use \"const\" in generated code\n--generatedCode.objectShorthand Use shorthand properties in generated code\n--no-generatedCode.reservedNamesAsProps Always quote reserved names as props\n--generatedCode.symbols Use symbols in generated code\n--hashCharacters <name> Use the specified character set for file hashes\n--no-hoistTransitiveImports Do not hoist transitive imports into entry chunks\n--importAttributesKey <name> Use the specified keyword for import attributes\n--no-indent Don't indent result\n--inlineDynamicImports Create single bundle when using dynamic imports\n--no-interop Do not include interop block\n--intro <text> Code to insert at top of bundle (inside wrapper)\n--logLevel <level> Which kind of logs to display\n--no-makeAbsoluteExternalsRelative Prevent normalization of external imports\n--maxParallelFileOps <value> How many files to read in parallel\n--minifyInternalExports Force or disable minification of internal exports\n--noConflict Generate a noConflict method for UMD globals\n--outro <text> Code to insert at end of bundle (inside wrapper)\n--perf Display performance timings\n--no-preserveEntrySignatures Avoid facade chunks for entry points\n--preserveModules Preserve module structure\n--preserveModulesRoot Put preserved modules under this path at root level\n--preserveSymlinks Do not follow symlinks when resolving files\n--no-reexportProtoFromExternal Ignore `__proto__` in star re-exports\n--no-sanitizeFileName Do not replace invalid characters in file names\n--shimMissingExports Create shim variables for missing exports\n--silent Don't print warnings\n--sourcemapBaseUrl <url> Emit absolute sourcemap URLs with given base\n--sourcemapDebugIds Emit unique debug ids in source and sourcemaps\n--sourcemapExcludeSources Do not include source code in source maps\n--sourcemapFile <file> Specify bundle position for source maps\n--sourcemapFileNames <pattern> Name pattern for emitted sourcemaps\n--stdin=ext Specify file extension used for stdin input\n--no-stdin Do not read \"-\" from stdin\n--no-strict Don't emit `\"use strict\";` in the generated modules\n--strictDeprecations Throw errors for deprecated features\n--no-systemNullSetters Do not replace empty SystemJS setters with `null`\n--no-treeshake Disable tree-shaking optimisations\n--no-treeshake.annotations Ignore pure call annotations\n--treeshake.correctVarValueBeforeDeclaration Deoptimize variables until declared\n--treeshake.manualPureFunctions <names> Manually declare functions as pure\n--no-treeshake.moduleSideEffects Assume modules have no side effects\n--no-treeshake.propertyReadSideEffects Ignore property access side effects\n--no-treeshake.tryCatchDeoptimization Do not turn off try-catch-tree-shaking\n--no-treeshake.unknownGlobalSideEffects Assume unknown globals do not throw\n--validate Validate output\n--waitForBundleInput Wait for bundle input files\n--watch.allowInputInsideOutputPath Whether the input path is allowed to be a\n subpath of the output path\n--watch.buildDelay <number> Throttle watch rebuilds\n--no-watch.clearScreen Do not clear the screen when rebuilding\n--watch.exclude <files> Exclude files from being watched\n--watch.include <files> Limit watching to specified files\n--watch.onBundleEnd <cmd> Shell command to run on `\"BUNDLE_END\"` event\n--watch.onBundleStart <cmd> Shell command to run on `\"BUNDLE_START\"` event\n--watch.onEnd <cmd> Shell command to run on `\"END\"` event\n--watch.onError <cmd> Shell command to run on `\"ERROR\"` event\n--watch.onStart <cmd> Shell command to run on `\"START\"` event\n--watch.skipWrite Do not write files to disk when watching\n\nExamples:\n\n# use settings in config file\nrollup -c\n\n# in config file, process.env.INCLUDE_DEPS === 'true'\n# and process.env.BUILD === 'production'\nrollup -c --environment INCLUDE_DEPS,BUILD:production\n\n# create CommonJS bundle.js from src/main.js\nrollup --format=cjs --file=bundle.js -- src/main.js\n\n# create self-executing IIFE using `window.jQuery`\n# and `window._` as external globals\nrollup -f iife --globals jquery:jQuery,lodash:_ \\\n -i src/app.js -o build/app.js -m build/app.js.map\n\nNotes:\n\n* When piping to stdout, only inline sourcemaps are permitted\n\nFor more information visit https://rollupjs.org\n";
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* @license
|
package/dist/es/getLogFilter.js
CHANGED
package/dist/es/parseAst.js
CHANGED
package/dist/es/rollup.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.57.1
|
|
4
|
+
Fri, 30 Jan 2026 08:13:08 GMT - commit d37675f25150d6a94dcf4138853bdc2ecb3ce57b
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
8
8
|
Released under the MIT License.
|
|
9
9
|
*/
|
|
10
|
-
import { EMPTY_OBJECT, ExportDefaultDeclaration as ExportDefaultDeclaration$1, CallExpression as CallExpression$1, EMPTY_ARRAY, LOGLEVEL_WARN, logUnusedExternalImports, ANNOTATION_KEY, INVALID_ANNOTATION_KEY, ExpressionStatement as ExpressionStatement$1, AwaitExpression as AwaitExpression$1, MemberExpression as MemberExpression$1, Identifier as Identifier$1, FunctionExpression as FunctionExpression$1, ArrowFunctionExpression as ArrowFunctionExpression$1, ObjectExpression as ObjectExpression$1, Property as Property$1, Program as Program$1, logIllegalImportReassignment, BLANK, logRedeclarationError, StaticBlock as StaticBlock$1, CatchClause as CatchClause$1, logDuplicateArgumentNameError, logModuleLevelDirective, ReturnStatement as ReturnStatement$1, VariableDeclarator as VariableDeclarator$1, logMissingExport, normalize, getImportPath, logMissingNodeBuiltins, logReservedNamespace, error, logIllegalIdentifierAsName, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, RestElement as RestElement$1, logConstVariableReassignError, EMPTY_SET, logCannotCallNamespace, logEval, BlockStatement as BlockStatement$1, getRollupError, logModuleParseError, logParseError, LOGLEVEL_INFO, logFirstSideEffect, locate, logInvalidAnnotation, logThisIsUndefined, getAstBuffer, convertAnnotations, FIXED_STRINGS, convertNode as convertNode$1, logImportAttributeIsInvalid, logImportOptionsAreInvalid, logMissingEntryExport, logSyntheticNamedExportsNeedNamespaceExport, logDuplicateExportError, logInvalidSourcemapForError, augmentCodeLocation, logInconsistentImportAttributes, logMissingJsxExport, logNamespaceConflict, logAmbiguousExternalNamespaces, logShimmedExport, parseAst, TemplateLiteral as TemplateLiteral$1, Literal as Literal$1, logCircularReexport, logInvalidFormatForTopLevelAwait, 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, logCircularChunk,
|
|
10
|
+
import { EMPTY_OBJECT, ExportDefaultDeclaration as ExportDefaultDeclaration$1, CallExpression as CallExpression$1, EMPTY_ARRAY, LOGLEVEL_WARN, logUnusedExternalImports, ANNOTATION_KEY, INVALID_ANNOTATION_KEY, ExpressionStatement as ExpressionStatement$1, AwaitExpression as AwaitExpression$1, MemberExpression as MemberExpression$1, Identifier as Identifier$1, FunctionExpression as FunctionExpression$1, ArrowFunctionExpression as ArrowFunctionExpression$1, ObjectExpression as ObjectExpression$1, Property as Property$1, Program as Program$1, logIllegalImportReassignment, BLANK, logRedeclarationError, StaticBlock as StaticBlock$1, CatchClause as CatchClause$1, logDuplicateArgumentNameError, logModuleLevelDirective, ReturnStatement as ReturnStatement$1, VariableDeclarator as VariableDeclarator$1, logMissingExport, normalize, getImportPath, logMissingNodeBuiltins, logReservedNamespace, error, logIllegalIdentifierAsName, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, RestElement as RestElement$1, logConstVariableReassignError, EMPTY_SET, logCannotCallNamespace, logEval, BlockStatement as BlockStatement$1, getRollupError, logModuleParseError, logParseError, LOGLEVEL_INFO, logFirstSideEffect, locate, logInvalidAnnotation, logThisIsUndefined, getAstBuffer, convertAnnotations, FIXED_STRINGS, convertNode as convertNode$1, logImportAttributeIsInvalid, logImportOptionsAreInvalid, logMissingEntryExport, logSyntheticNamedExportsNeedNamespaceExport, logDuplicateExportError, logInvalidSourcemapForError, augmentCodeLocation, logInconsistentImportAttributes, logMissingJsxExport, logNamespaceConflict, logAmbiguousExternalNamespaces, logShimmedExport, parseAst, TemplateLiteral as TemplateLiteral$1, Literal as Literal$1, logCircularReexport, logInvalidFormatForTopLevelAwait, 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, logCircularChunk, logUnknownOption, printQuotedStringList, LOGLEVEL_ERROR, logLevelPriority, LOGLEVEL_DEBUG, logAnonymousPluginCache, logDuplicatePluginName, logInvalidSetAssetSourceCall, logPluginError, logNoTransformMapOrAstWithoutCode, warnDeprecation, URL_TRANSFORM, relativeId, logBadLoader, logInternalIdCannotBeExternal, isRelative, logUnresolvedImport, logUnresolvedImportTreatedAsExternal, logExternalSyntheticExports, logUnresolvedEntry, logUnresolvedImplicitDependant, logExternalModulesCannotBeIncludedInManualChunks, logEntryCannotBeExternal, logImplicitDependantCannotBeExternal, logExternalModulesCannotBeTransformedToModules, URL_LOAD, logNoAssetSourceSet, logFileReferenceIdNotFoundForFilename, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logInvalidRollupPhaseForChunkEmission, logChunkNotGeneratedForFileName, logAssetNotFinalisedForFileName, logFileNameConflict, URL_GENERATEBUNDLE, logInvalidLogPosition, logInputHookInOutputPlugin, logInvalidAddonPluginHook, logInvalidFunctionPluginHook, logImplicitDependantIsNotIncluded, logCircularDependency, augmentLogMessage, URL_JSX, URL_TREESHAKE, URL_TREESHAKE_MODULESIDEEFFECTS, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_PRESERVEENTRYSIGNATURES, URL_OUTPUT_GENERATEDCODE, isValidUrl, addTrailingSlashIfMissed, URL_OUTPUT_SOURCEMAPBASEURL, URL_OUTPUT_MANUALCHUNKS, logInvalidExportOptionValue, URL_OUTPUT_AMD_BASEPATH, URL_OUTPUT_INTEROP, 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 { posix, isAbsolute, resolve, win32 } from 'path';
|
|
13
13
|
import { parseAsync, xxhashBase16, xxhashBase64Url, xxhashBase36 } from '../../native.js';
|
|
@@ -27,7 +27,7 @@ function _mergeNamespaces(n, m) {
|
|
|
27
27
|
return Object.defineProperty(n, Symbol.toStringTag, { value: 'Module' });
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
var version = "4.
|
|
30
|
+
var version = "4.57.1";
|
|
31
31
|
|
|
32
32
|
// src/vlq.ts
|
|
33
33
|
var comma = ",".charCodeAt(0);
|
|
@@ -7781,7 +7781,7 @@ class MetaProperty extends NodeBase {
|
|
|
7781
7781
|
render(code, renderOptions) {
|
|
7782
7782
|
const { format, pluginDriver, snippets } = renderOptions;
|
|
7783
7783
|
const { scope: { context: { module } }, meta: { name }, metaProperty, parent, preliminaryChunkId, referenceId, start, end } = this;
|
|
7784
|
-
const { id: moduleId } = module;
|
|
7784
|
+
const { id: moduleId, info: { attributes } } = module;
|
|
7785
7785
|
if (name !== IMPORT)
|
|
7786
7786
|
return;
|
|
7787
7787
|
const chunkId = preliminaryChunkId;
|
|
@@ -7790,14 +7790,14 @@ class MetaProperty extends NodeBase {
|
|
|
7790
7790
|
const relativePath = normalize(relative(dirname(chunkId), fileName));
|
|
7791
7791
|
const isUrlObject = !!metaProperty?.startsWith(FILE_OBJ_PREFIX);
|
|
7792
7792
|
const replacement = pluginDriver.hookFirstSync('resolveFileUrl', [
|
|
7793
|
-
{ chunkId, fileName, format, moduleId, referenceId, relativePath }
|
|
7793
|
+
{ attributes, chunkId, fileName, format, moduleId, referenceId, relativePath }
|
|
7794
7794
|
]) || relativeUrlMechanisms[format](relativePath, isUrlObject);
|
|
7795
7795
|
code.overwrite(parent.start, parent.end, replacement, { contentOnly: true });
|
|
7796
7796
|
return;
|
|
7797
7797
|
}
|
|
7798
7798
|
let replacement = pluginDriver.hookFirstSync('resolveImportMeta', [
|
|
7799
7799
|
metaProperty,
|
|
7800
|
-
{ chunkId, format, moduleId }
|
|
7800
|
+
{ attributes, chunkId, format, moduleId }
|
|
7801
7801
|
]);
|
|
7802
7802
|
if (!replacement) {
|
|
7803
7803
|
replacement = importMetaMechanisms[format]?.(metaProperty, { chunkId, snippets });
|
|
@@ -13229,6 +13229,9 @@ class ImportExpression extends NodeBase {
|
|
|
13229
13229
|
if (this.shouldIncludeDynamicAttributes) {
|
|
13230
13230
|
this.options?.include(context, includeChildrenRecursively);
|
|
13231
13231
|
}
|
|
13232
|
+
if (includeChildrenRecursively) {
|
|
13233
|
+
this.localResolution?.resolution.includeAllExports();
|
|
13234
|
+
}
|
|
13232
13235
|
}
|
|
13233
13236
|
includeNode(context) {
|
|
13234
13237
|
this.included = true;
|
|
@@ -13353,6 +13356,7 @@ class ImportExpression extends NodeBase {
|
|
|
13353
13356
|
},
|
|
13354
13357
|
moduleId: scope.context.module.id,
|
|
13355
13358
|
targetChunk: targetChunk ? getChunkInfoWithPath(targetChunk) : null,
|
|
13359
|
+
targetModuleAttributes: resolution && typeof resolution !== 'string' ? resolution.info.attributes : {},
|
|
13356
13360
|
targetModuleId: resolution && typeof resolution !== 'string' ? resolution.id : null
|
|
13357
13361
|
}
|
|
13358
13362
|
]);
|
|
@@ -20850,7 +20854,7 @@ class GlobalScope extends Scope {
|
|
|
20850
20854
|
}
|
|
20851
20855
|
}
|
|
20852
20856
|
|
|
20853
|
-
function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes) {
|
|
20857
|
+
function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes, importerAttributes) {
|
|
20854
20858
|
let skipped = null;
|
|
20855
20859
|
let replaceContext = null;
|
|
20856
20860
|
if (skip) {
|
|
@@ -20862,7 +20866,7 @@ function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolve
|
|
|
20862
20866
|
}
|
|
20863
20867
|
replaceContext = (pluginContext, plugin) => ({
|
|
20864
20868
|
...pluginContext,
|
|
20865
|
-
resolve: (source, importer, { attributes, custom, isEntry, skipSelf } = BLANK) => {
|
|
20869
|
+
resolve: (source, importer, { attributes, custom, isEntry, skipSelf, importerAttributes } = BLANK) => {
|
|
20866
20870
|
skipSelf ??= true;
|
|
20867
20871
|
if (skipSelf &&
|
|
20868
20872
|
skip.findIndex(skippedCall => {
|
|
@@ -20874,15 +20878,15 @@ function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolve
|
|
|
20874
20878
|
// Thus returning Promise.resolve(null) in purpose of fallback to default behavior of `resolveId` plugin hook.
|
|
20875
20879
|
return Promise.resolve(null);
|
|
20876
20880
|
}
|
|
20877
|
-
return moduleLoaderResolveId(source, importer, custom, isEntry, attributes || EMPTY_OBJECT, skipSelf ? [...skip, { importer, plugin, source }] : skip);
|
|
20881
|
+
return moduleLoaderResolveId(source, importer, custom, isEntry, attributes || EMPTY_OBJECT, importerAttributes, skipSelf ? [...skip, { importer, plugin, source }] : skip);
|
|
20878
20882
|
}
|
|
20879
20883
|
});
|
|
20880
20884
|
}
|
|
20881
|
-
return pluginDriver.hookFirstAndGetPlugin('resolveId', [source, importer, { attributes, custom: customOptions, isEntry }], replaceContext, skipped);
|
|
20885
|
+
return pluginDriver.hookFirstAndGetPlugin('resolveId', [source, importer, { attributes, custom: customOptions, importerAttributes, isEntry }], replaceContext, skipped);
|
|
20882
20886
|
}
|
|
20883
20887
|
|
|
20884
|
-
async function resolveId(source, importer, preserveSymlinks, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes, fs) {
|
|
20885
|
-
const pluginResult = await resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes);
|
|
20888
|
+
async function resolveId(source, importer, preserveSymlinks, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes, importerAttributes, fs) {
|
|
20889
|
+
const pluginResult = await resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes, importerAttributes);
|
|
20886
20890
|
if (pluginResult != null) {
|
|
20887
20891
|
const [resolveIdResult, plugin] = pluginResult;
|
|
20888
20892
|
if (typeof resolveIdResult === 'object' && !resolveIdResult.resolvedBy) {
|
|
@@ -20939,89 +20943,6 @@ function stripBom(content) {
|
|
|
20939
20943
|
return content;
|
|
20940
20944
|
}
|
|
20941
20945
|
|
|
20942
|
-
const ANONYMOUS_PLUGIN_PREFIX = 'at position ';
|
|
20943
|
-
const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = 'at output position ';
|
|
20944
|
-
|
|
20945
|
-
function createPluginCache(cache) {
|
|
20946
|
-
return {
|
|
20947
|
-
delete(id) {
|
|
20948
|
-
return delete cache[id];
|
|
20949
|
-
},
|
|
20950
|
-
get(id) {
|
|
20951
|
-
const item = cache[id];
|
|
20952
|
-
if (!item)
|
|
20953
|
-
return;
|
|
20954
|
-
item[0] = 0;
|
|
20955
|
-
return item[1];
|
|
20956
|
-
},
|
|
20957
|
-
has(id) {
|
|
20958
|
-
const item = cache[id];
|
|
20959
|
-
if (!item)
|
|
20960
|
-
return false;
|
|
20961
|
-
item[0] = 0;
|
|
20962
|
-
return true;
|
|
20963
|
-
},
|
|
20964
|
-
set(id, value) {
|
|
20965
|
-
cache[id] = [0, value];
|
|
20966
|
-
}
|
|
20967
|
-
};
|
|
20968
|
-
}
|
|
20969
|
-
function getTrackedPluginCache(pluginCache, onUse) {
|
|
20970
|
-
return {
|
|
20971
|
-
delete(id) {
|
|
20972
|
-
onUse();
|
|
20973
|
-
return pluginCache.delete(id);
|
|
20974
|
-
},
|
|
20975
|
-
get(id) {
|
|
20976
|
-
onUse();
|
|
20977
|
-
return pluginCache.get(id);
|
|
20978
|
-
},
|
|
20979
|
-
has(id) {
|
|
20980
|
-
onUse();
|
|
20981
|
-
return pluginCache.has(id);
|
|
20982
|
-
},
|
|
20983
|
-
set(id, value) {
|
|
20984
|
-
onUse();
|
|
20985
|
-
return pluginCache.set(id, value);
|
|
20986
|
-
}
|
|
20987
|
-
};
|
|
20988
|
-
}
|
|
20989
|
-
const NO_CACHE = {
|
|
20990
|
-
delete() {
|
|
20991
|
-
return false;
|
|
20992
|
-
},
|
|
20993
|
-
get() {
|
|
20994
|
-
return undefined;
|
|
20995
|
-
},
|
|
20996
|
-
has() {
|
|
20997
|
-
return false;
|
|
20998
|
-
},
|
|
20999
|
-
set() { }
|
|
21000
|
-
};
|
|
21001
|
-
function uncacheablePluginError(pluginName) {
|
|
21002
|
-
if (pluginName.startsWith(ANONYMOUS_PLUGIN_PREFIX) ||
|
|
21003
|
-
pluginName.startsWith(ANONYMOUS_OUTPUT_PLUGIN_PREFIX)) {
|
|
21004
|
-
return error(logAnonymousPluginCache());
|
|
21005
|
-
}
|
|
21006
|
-
return error(logDuplicatePluginName(pluginName));
|
|
21007
|
-
}
|
|
21008
|
-
function getCacheForUncacheablePlugin(pluginName) {
|
|
21009
|
-
return {
|
|
21010
|
-
delete() {
|
|
21011
|
-
return uncacheablePluginError(pluginName);
|
|
21012
|
-
},
|
|
21013
|
-
get() {
|
|
21014
|
-
return uncacheablePluginError(pluginName);
|
|
21015
|
-
},
|
|
21016
|
-
has() {
|
|
21017
|
-
return uncacheablePluginError(pluginName);
|
|
21018
|
-
},
|
|
21019
|
-
set() {
|
|
21020
|
-
return uncacheablePluginError(pluginName);
|
|
21021
|
-
}
|
|
21022
|
-
};
|
|
21023
|
-
}
|
|
21024
|
-
|
|
21025
20946
|
async function asyncFlatten(array) {
|
|
21026
20947
|
do {
|
|
21027
20948
|
array = (await Promise.all(array)).flat(Infinity);
|
|
@@ -21184,7 +21105,90 @@ const getOptionWithPreset = (value, presets, optionName, urlSnippet, additionalV
|
|
|
21184
21105
|
};
|
|
21185
21106
|
const normalizePluginOption = async (plugins) => (await asyncFlatten([plugins])).filter(Boolean);
|
|
21186
21107
|
|
|
21187
|
-
|
|
21108
|
+
const ANONYMOUS_PLUGIN_PREFIX = 'at position ';
|
|
21109
|
+
const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = 'at output position ';
|
|
21110
|
+
|
|
21111
|
+
function createPluginCache(cache) {
|
|
21112
|
+
return {
|
|
21113
|
+
delete(id) {
|
|
21114
|
+
return delete cache[id];
|
|
21115
|
+
},
|
|
21116
|
+
get(id) {
|
|
21117
|
+
const item = cache[id];
|
|
21118
|
+
if (!item)
|
|
21119
|
+
return;
|
|
21120
|
+
item[0] = 0;
|
|
21121
|
+
return item[1];
|
|
21122
|
+
},
|
|
21123
|
+
has(id) {
|
|
21124
|
+
const item = cache[id];
|
|
21125
|
+
if (!item)
|
|
21126
|
+
return false;
|
|
21127
|
+
item[0] = 0;
|
|
21128
|
+
return true;
|
|
21129
|
+
},
|
|
21130
|
+
set(id, value) {
|
|
21131
|
+
cache[id] = [0, value];
|
|
21132
|
+
}
|
|
21133
|
+
};
|
|
21134
|
+
}
|
|
21135
|
+
function getTrackedPluginCache(pluginCache, onUse) {
|
|
21136
|
+
return {
|
|
21137
|
+
delete(id) {
|
|
21138
|
+
onUse();
|
|
21139
|
+
return pluginCache.delete(id);
|
|
21140
|
+
},
|
|
21141
|
+
get(id) {
|
|
21142
|
+
onUse();
|
|
21143
|
+
return pluginCache.get(id);
|
|
21144
|
+
},
|
|
21145
|
+
has(id) {
|
|
21146
|
+
onUse();
|
|
21147
|
+
return pluginCache.has(id);
|
|
21148
|
+
},
|
|
21149
|
+
set(id, value) {
|
|
21150
|
+
onUse();
|
|
21151
|
+
return pluginCache.set(id, value);
|
|
21152
|
+
}
|
|
21153
|
+
};
|
|
21154
|
+
}
|
|
21155
|
+
const NO_CACHE = {
|
|
21156
|
+
delete() {
|
|
21157
|
+
return false;
|
|
21158
|
+
},
|
|
21159
|
+
get() {
|
|
21160
|
+
return undefined;
|
|
21161
|
+
},
|
|
21162
|
+
has() {
|
|
21163
|
+
return false;
|
|
21164
|
+
},
|
|
21165
|
+
set() { }
|
|
21166
|
+
};
|
|
21167
|
+
function uncacheablePluginError(pluginName) {
|
|
21168
|
+
if (pluginName.startsWith(ANONYMOUS_PLUGIN_PREFIX) ||
|
|
21169
|
+
pluginName.startsWith(ANONYMOUS_OUTPUT_PLUGIN_PREFIX)) {
|
|
21170
|
+
return error(logAnonymousPluginCache());
|
|
21171
|
+
}
|
|
21172
|
+
return error(logDuplicatePluginName(pluginName));
|
|
21173
|
+
}
|
|
21174
|
+
function getCacheForUncacheablePlugin(pluginName) {
|
|
21175
|
+
return {
|
|
21176
|
+
delete() {
|
|
21177
|
+
return uncacheablePluginError(pluginName);
|
|
21178
|
+
},
|
|
21179
|
+
get() {
|
|
21180
|
+
return uncacheablePluginError(pluginName);
|
|
21181
|
+
},
|
|
21182
|
+
has() {
|
|
21183
|
+
return uncacheablePluginError(pluginName);
|
|
21184
|
+
},
|
|
21185
|
+
set() {
|
|
21186
|
+
return uncacheablePluginError(pluginName);
|
|
21187
|
+
}
|
|
21188
|
+
};
|
|
21189
|
+
}
|
|
21190
|
+
|
|
21191
|
+
async function transform(source, module, pluginDriver, options) {
|
|
21188
21192
|
const id = module.id;
|
|
21189
21193
|
const sourcemapChain = [];
|
|
21190
21194
|
let originalSourcemap = source.map === null ? null : decodedSourcemap(source.map);
|
|
@@ -21206,10 +21210,13 @@ async function transform(source, module, pluginDriver, log) {
|
|
|
21206
21210
|
module.updateOptions(result);
|
|
21207
21211
|
if (result.code == null) {
|
|
21208
21212
|
if (result.map || result.ast) {
|
|
21209
|
-
|
|
21213
|
+
options.onLog(LOGLEVEL_WARN, logNoTransformMapOrAstWithoutCode(plugin.name));
|
|
21210
21214
|
}
|
|
21211
21215
|
return previousCode;
|
|
21212
21216
|
}
|
|
21217
|
+
if (result.attributes) {
|
|
21218
|
+
warnDeprecation('Returning attributes from the "transform" hook is forbidden.', URL_TRANSFORM, false, options);
|
|
21219
|
+
}
|
|
21213
21220
|
({ code, map, ast } = result);
|
|
21214
21221
|
}
|
|
21215
21222
|
else {
|
|
@@ -21236,7 +21243,13 @@ async function transform(source, module, pluginDriver, log) {
|
|
|
21236
21243
|
};
|
|
21237
21244
|
let code;
|
|
21238
21245
|
try {
|
|
21239
|
-
code = await pluginDriver.hookReduceArg0('transform', [
|
|
21246
|
+
code = await pluginDriver.hookReduceArg0('transform', [
|
|
21247
|
+
currentSource,
|
|
21248
|
+
id,
|
|
21249
|
+
{
|
|
21250
|
+
attributes: module.info.attributes
|
|
21251
|
+
}
|
|
21252
|
+
], transformReducer, (pluginContext, plugin) => {
|
|
21240
21253
|
pluginName = plugin.name;
|
|
21241
21254
|
return {
|
|
21242
21255
|
...pluginContext,
|
|
@@ -21262,7 +21275,7 @@ async function transform(source, module, pluginDriver, log) {
|
|
|
21262
21275
|
return pluginContext.error(error_);
|
|
21263
21276
|
},
|
|
21264
21277
|
getCombinedSourcemap() {
|
|
21265
|
-
const combinedMap = collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain,
|
|
21278
|
+
const combinedMap = collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, options.onLog);
|
|
21266
21279
|
if (!combinedMap) {
|
|
21267
21280
|
const magicString = new MagicString(originalCode);
|
|
21268
21281
|
return magicString.generateMap({ hires: true, includeContent: true, source: id });
|
|
@@ -21317,15 +21330,15 @@ class ModuleLoader {
|
|
|
21317
21330
|
this.modulesWithLoadedDependencies = new Set();
|
|
21318
21331
|
this.nextChunkNamePriority = 0;
|
|
21319
21332
|
this.nextEntryModuleIndex = 0;
|
|
21320
|
-
this.resolveId = async (source, importer, customOptions, isEntry, attributes, skip = null) => this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(this.options.external(source, importer, false)
|
|
21333
|
+
this.resolveId = async (source, importer, customOptions, isEntry, attributes, importerAttributes, skip = null) => this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(this.options.external(source, importer, false)
|
|
21321
21334
|
? false
|
|
21322
|
-
: await resolveId(source, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, skip, customOptions, typeof isEntry === 'boolean' ? isEntry : !importer, attributes, this.options.fs), importer, source), attributes);
|
|
21335
|
+
: await resolveId(source, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, skip, customOptions, typeof isEntry === 'boolean' ? isEntry : !importer, attributes, importerAttributes, this.options.fs), importer, source), attributes);
|
|
21323
21336
|
this.hasModuleSideEffects = options.treeshake
|
|
21324
21337
|
? options.treeshake.moduleSideEffects
|
|
21325
21338
|
: () => true;
|
|
21326
21339
|
}
|
|
21327
21340
|
async addAdditionalModules(unresolvedModules, isAddForManualChunks) {
|
|
21328
|
-
const result = this.extendLoadModulesPromise(Promise.all(unresolvedModules.map(id => this.loadEntryModule(id, false, undefined, null, isAddForManualChunks))));
|
|
21341
|
+
const result = this.extendLoadModulesPromise(Promise.all(unresolvedModules.map(id => this.loadEntryModule(id, false, undefined, null, isAddForManualChunks, undefined))));
|
|
21329
21342
|
await this.awaitLoadModulesPromise();
|
|
21330
21343
|
return result;
|
|
21331
21344
|
}
|
|
@@ -21334,7 +21347,7 @@ class ModuleLoader {
|
|
|
21334
21347
|
this.nextEntryModuleIndex += unresolvedEntryModules.length;
|
|
21335
21348
|
const firstChunkNamePriority = this.nextChunkNamePriority;
|
|
21336
21349
|
this.nextChunkNamePriority += unresolvedEntryModules.length;
|
|
21337
|
-
const newEntryModules = await this.extendLoadModulesPromise(Promise.all(unresolvedEntryModules.map(({ id, importer }) => this.loadEntryModule(id, true, importer, null))).then(entryModules => {
|
|
21350
|
+
const newEntryModules = await this.extendLoadModulesPromise(Promise.all(unresolvedEntryModules.map(({ id, importer }) => this.loadEntryModule(id, true, importer, null, undefined, undefined))).then(entryModules => {
|
|
21338
21351
|
for (const [index, entryModule] of entryModules.entries()) {
|
|
21339
21352
|
entryModule.isUserDefinedEntryPoint =
|
|
21340
21353
|
entryModule.isUserDefinedEntryPoint || isUserDefined;
|
|
@@ -21381,10 +21394,10 @@ class ModuleLoader {
|
|
|
21381
21394
|
}
|
|
21382
21395
|
addEntryWithImplicitDependants(unresolvedModule, implicitlyLoadedAfter) {
|
|
21383
21396
|
const chunkNamePriority = this.nextChunkNamePriority++;
|
|
21384
|
-
return this.extendLoadModulesPromise(this.loadEntryModule(unresolvedModule.id, false, unresolvedModule.importer, null).then(async (entryModule) => {
|
|
21397
|
+
return this.extendLoadModulesPromise(this.loadEntryModule(unresolvedModule.id, false, unresolvedModule.importer, null, undefined, undefined).then(async (entryModule) => {
|
|
21385
21398
|
addChunkNamesToModule(entryModule, unresolvedModule, false, chunkNamePriority);
|
|
21386
21399
|
if (!entryModule.info.isEntry) {
|
|
21387
|
-
const implicitlyLoadedAfterModules = await Promise.all(implicitlyLoadedAfter.map(id => this.loadEntryModule(id, false, unresolvedModule.importer, entryModule.id)));
|
|
21400
|
+
const implicitlyLoadedAfterModules = await Promise.all(implicitlyLoadedAfter.map(id => this.loadEntryModule(id, false, unresolvedModule.importer, entryModule.id, undefined, undefined)));
|
|
21388
21401
|
// We need to check again if this is still an entry module as these
|
|
21389
21402
|
// changes need to be performed atomically to avoid race conditions
|
|
21390
21403
|
// if the same module is re-emitted as an entry module.
|
|
@@ -21406,9 +21419,16 @@ class ModuleLoader {
|
|
|
21406
21419
|
let source;
|
|
21407
21420
|
try {
|
|
21408
21421
|
source = await this.graph.fileOperationQueue.run(async () => {
|
|
21409
|
-
const content = await this.pluginDriver.hookFirst('load', [
|
|
21410
|
-
|
|
21422
|
+
const content = await this.pluginDriver.hookFirst('load', [
|
|
21423
|
+
id,
|
|
21424
|
+
{ attributes: module.info.attributes }
|
|
21425
|
+
]);
|
|
21426
|
+
if (content !== null) {
|
|
21427
|
+
if (typeof content === 'object' && content.attributes) {
|
|
21428
|
+
warnDeprecation('Returning attributes from the "load" hook is forbidden.', URL_LOAD, false, this.options);
|
|
21429
|
+
}
|
|
21411
21430
|
return content;
|
|
21431
|
+
}
|
|
21412
21432
|
this.graph.watchFiles[id] = true;
|
|
21413
21433
|
return (await this.options.fs.readFile(id, { encoding: 'utf8' }));
|
|
21414
21434
|
});
|
|
@@ -21434,6 +21454,7 @@ class ModuleLoader {
|
|
|
21434
21454
|
!(await this.pluginDriver.hookFirst('shouldTransformCachedModule', [
|
|
21435
21455
|
{
|
|
21436
21456
|
ast: cachedModule.ast,
|
|
21457
|
+
attributes: cachedModule.attributes,
|
|
21437
21458
|
code: cachedModule.code,
|
|
21438
21459
|
id: cachedModule.id,
|
|
21439
21460
|
meta: cachedModule.meta,
|
|
@@ -21450,7 +21471,7 @@ class ModuleLoader {
|
|
|
21450
21471
|
}
|
|
21451
21472
|
else {
|
|
21452
21473
|
module.updateOptions(sourceDescription);
|
|
21453
|
-
await module.setSource(await transform(sourceDescription, module, this.pluginDriver, this.options
|
|
21474
|
+
await module.setSource(await transform(sourceDescription, module, this.pluginDriver, this.options));
|
|
21454
21475
|
}
|
|
21455
21476
|
}
|
|
21456
21477
|
async awaitLoadModulesPromise() {
|
|
@@ -21623,7 +21644,7 @@ class ModuleLoader {
|
|
|
21623
21644
|
source,
|
|
21624
21645
|
(module.resolvedIds[source] =
|
|
21625
21646
|
module.resolvedIds[source] ||
|
|
21626
|
-
this.handleInvalidResolvedId(await this.resolveId(source, module.id, EMPTY_OBJECT, false, attributes), source, module.id, attributes))
|
|
21647
|
+
this.handleInvalidResolvedId(await this.resolveId(source, module.id, EMPTY_OBJECT, false, attributes, module.info.attributes), source, module.id, attributes))
|
|
21627
21648
|
]);
|
|
21628
21649
|
}
|
|
21629
21650
|
getResolvedIdWithDefaults(resolvedId, attributes) {
|
|
@@ -21681,8 +21702,8 @@ class ModuleLoader {
|
|
|
21681
21702
|
}
|
|
21682
21703
|
return resolvedId;
|
|
21683
21704
|
}
|
|
21684
|
-
async loadEntryModule(unresolvedId, isEntry, importer, implicitlyLoadedBefore, isLoadForManualChunks = false) {
|
|
21685
|
-
const resolveIdResult = await resolveId(unresolvedId, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, null, EMPTY_OBJECT, true, EMPTY_OBJECT, this.options.fs);
|
|
21705
|
+
async loadEntryModule(unresolvedId, isEntry, importer, implicitlyLoadedBefore, isLoadForManualChunks = false, importerAttributes) {
|
|
21706
|
+
const resolveIdResult = await resolveId(unresolvedId, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, null, EMPTY_OBJECT, true, EMPTY_OBJECT, importerAttributes, this.options.fs);
|
|
21686
21707
|
if (resolveIdResult == null) {
|
|
21687
21708
|
return error(implicitlyLoadedBefore === null
|
|
21688
21709
|
? logUnresolvedEntry(unresolvedId)
|
|
@@ -21704,7 +21725,7 @@ class ModuleLoader {
|
|
|
21704
21725
|
const resolution = await this.pluginDriver.hookFirst('resolveDynamicImport', [
|
|
21705
21726
|
specifier,
|
|
21706
21727
|
importer,
|
|
21707
|
-
{ attributes }
|
|
21728
|
+
{ attributes, importerAttributes: module.info.attributes }
|
|
21708
21729
|
]);
|
|
21709
21730
|
if (typeof specifier !== 'string') {
|
|
21710
21731
|
if (typeof resolution === 'string') {
|
|
@@ -21723,7 +21744,7 @@ class ModuleLoader {
|
|
|
21723
21744
|
}
|
|
21724
21745
|
return existingResolution;
|
|
21725
21746
|
}
|
|
21726
|
-
return (module.resolvedIds[specifier] = this.handleInvalidResolvedId(await this.resolveId(specifier, module.id, EMPTY_OBJECT, false, attributes), specifier, module.id, attributes));
|
|
21747
|
+
return (module.resolvedIds[specifier] = this.handleInvalidResolvedId(await this.resolveId(specifier, module.id, EMPTY_OBJECT, false, attributes, module.info.attributes), specifier, module.id, attributes));
|
|
21727
21748
|
}
|
|
21728
21749
|
return this.handleInvalidResolvedId(this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(resolution, importer, specifier), attributes), specifier, importer, attributes);
|
|
21729
21750
|
}
|
|
@@ -22218,9 +22239,9 @@ function getPluginContext(plugin, pluginCache, graph, options, fileEmitter, exis
|
|
|
22218
22239
|
watchMode: graph.watchMode
|
|
22219
22240
|
},
|
|
22220
22241
|
parse: parseAst,
|
|
22221
|
-
resolve(source, importer, { attributes, custom, isEntry, skipSelf } = BLANK) {
|
|
22242
|
+
resolve(source, importer, { attributes, custom, isEntry, skipSelf, importerAttributes } = BLANK) {
|
|
22222
22243
|
skipSelf ??= true;
|
|
22223
|
-
return graph.moduleLoader.resolveId(source, importer, custom, isEntry, attributes || EMPTY_OBJECT, skipSelf ? [{ importer, plugin, source }] : null);
|
|
22244
|
+
return graph.moduleLoader.resolveId(source, importer, custom, isEntry, attributes || EMPTY_OBJECT, importerAttributes, skipSelf ? [{ importer, plugin, source }] : null);
|
|
22224
22245
|
},
|
|
22225
22246
|
setAssetSource: fileEmitter.setAssetSource,
|
|
22226
22247
|
warn: getLogHandler(LOGLEVEL_WARN, 'PLUGIN_WARNING', onLog, plugin.name, logLevel)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.57.1
|
|
4
|
+
Fri, 30 Jan 2026 08:13:08 GMT - commit d37675f25150d6a94dcf4138853bdc2ecb3ce57b
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -391,6 +391,8 @@ const URL_TREESHAKE_NOSIDEEFFECTS = 'configuration-options/#no-side-effects';
|
|
|
391
391
|
const URL_TREESHAKE_MODULESIDEEFFECTS = 'configuration-options/#treeshake-modulesideeffects';
|
|
392
392
|
const URL_WATCH = 'configuration-options/#watch';
|
|
393
393
|
const URL_GENERATEBUNDLE = 'plugin-development/#generatebundle';
|
|
394
|
+
const URL_LOAD = 'plugin-development/#load';
|
|
395
|
+
const URL_TRANSFORM = 'plugin-development/#transform';
|
|
394
396
|
|
|
395
397
|
function error(base) {
|
|
396
398
|
throw base instanceof Error ? base : getRollupError(base);
|
|
@@ -2091,4 +2093,4 @@ function getAstBuffer(astBuffer) {
|
|
|
2091
2093
|
const parseAst = (input, { allowReturnOutsideFunction = false, jsx = false } = {}) => convertProgram(getAstBuffer(parse(input, allowReturnOutsideFunction, jsx)));
|
|
2092
2094
|
const parseAstAsync = async (input, { allowReturnOutsideFunction = false, jsx = false, signal } = {}) => convertProgram(getAstBuffer(await parseAsync(input, allowReturnOutsideFunction, jsx, signal)));
|
|
2093
2095
|
|
|
2094
|
-
export { ANNOTATION_KEY, ArrowFunctionExpression, AwaitExpression, BLANK, BlockStatement, CallExpression, CatchClause, EMPTY_ARRAY, EMPTY_OBJECT, EMPTY_SET, ExportDefaultDeclaration, ExpressionStatement, FIXED_STRINGS, FunctionExpression, INVALID_ANNOTATION_KEY, Identifier, LOGLEVEL_DEBUG, LOGLEVEL_ERROR, LOGLEVEL_INFO, LOGLEVEL_WARN, Literal, MemberExpression, ObjectExpression, Program, Property, RestElement, ReturnStatement, StaticBlock, TemplateLiteral, URL_GENERATEBUNDLE, URL_JSX, 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, VariableDeclarator, addTrailingSlashIfMissed, augmentCodeLocation, augmentLogMessage, convertAnnotations, convertNode, error, getAliasName, getAstBuffer, getImportPath, getRollupError, isAbsolute, isPathFragment, isRelative, isValidUrl, locate, logAddonNotGenerated, logAlreadyClosed, logAmbiguousExternalNamespaces, logAnonymousPluginCache, logAssetNotFinalisedForFileName, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logBadLoader, logCannotAssignModuleToChunk, logCannotCallNamespace, logCannotEmitFromOptionsHook, logChunkInvalid, logChunkNotGeneratedForFileName, logCircularChunk, 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, logMissingJsxExport, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, logMissingNodeBuiltins, logMixedExport, logModuleLevelDirective, logModuleParseError, logNamespaceConflict, logNoAssetSourceSet, logNoTransformMapOrAstWithoutCode, logOptimizeChunkStatus, logParseError, logPluginError, logRedeclarationError, logReservedNamespace, logShimmedExport, logSourcemapBroken, logSyntheticNamedExportsNeedNamespaceExport, logThisIsUndefined, logUnexpectedNamedImport, logUnexpectedNamespaceReexport, logUnknownOption, logUnresolvedEntry, logUnresolvedImplicitDependant, logUnresolvedImport, logUnresolvedImportTreatedAsExternal, logUnusedExternalImports, normalize, parseAst, parseAstAsync, printQuotedStringList, relative, relativeId, warnDeprecation };
|
|
2096
|
+
export { ANNOTATION_KEY, ArrowFunctionExpression, AwaitExpression, BLANK, BlockStatement, CallExpression, CatchClause, EMPTY_ARRAY, EMPTY_OBJECT, EMPTY_SET, ExportDefaultDeclaration, ExpressionStatement, FIXED_STRINGS, FunctionExpression, INVALID_ANNOTATION_KEY, Identifier, LOGLEVEL_DEBUG, LOGLEVEL_ERROR, LOGLEVEL_INFO, LOGLEVEL_WARN, Literal, MemberExpression, ObjectExpression, Program, Property, RestElement, ReturnStatement, StaticBlock, TemplateLiteral, URL_GENERATEBUNDLE, URL_JSX, URL_LOAD, 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_TRANSFORM, URL_TREESHAKE, URL_TREESHAKE_MODULESIDEEFFECTS, URL_WATCH, VariableDeclarator, addTrailingSlashIfMissed, augmentCodeLocation, augmentLogMessage, convertAnnotations, convertNode, error, getAliasName, getAstBuffer, getImportPath, getRollupError, isAbsolute, isPathFragment, isRelative, isValidUrl, locate, logAddonNotGenerated, logAlreadyClosed, logAmbiguousExternalNamespaces, logAnonymousPluginCache, logAssetNotFinalisedForFileName, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logBadLoader, logCannotAssignModuleToChunk, logCannotCallNamespace, logCannotEmitFromOptionsHook, logChunkInvalid, logChunkNotGeneratedForFileName, logCircularChunk, 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, logMissingJsxExport, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, logMissingNodeBuiltins, logMixedExport, logModuleLevelDirective, logModuleParseError, logNamespaceConflict, logNoAssetSourceSet, logNoTransformMapOrAstWithoutCode, logOptimizeChunkStatus, logParseError, logPluginError, logRedeclarationError, logReservedNamespace, 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
package/dist/getLogFilter.js
CHANGED
package/dist/loadConfigFile.js
CHANGED
package/dist/parseAst.js
CHANGED
package/dist/rollup.d.ts
CHANGED
|
@@ -261,6 +261,7 @@ export interface PluginContext extends MinimalPluginContext {
|
|
|
261
261
|
source: string,
|
|
262
262
|
importer?: string,
|
|
263
263
|
options?: {
|
|
264
|
+
importerAttributes?: Record<string, string>;
|
|
264
265
|
attributes?: Record<string, string>;
|
|
265
266
|
custom?: CustomPluginOptions;
|
|
266
267
|
isEntry?: boolean;
|
|
@@ -312,13 +313,19 @@ export type ResolveIdHook = (
|
|
|
312
313
|
this: PluginContext,
|
|
313
314
|
source: string,
|
|
314
315
|
importer: string | undefined,
|
|
315
|
-
options: {
|
|
316
|
+
options: {
|
|
317
|
+
attributes: Record<string, string>;
|
|
318
|
+
custom?: CustomPluginOptions;
|
|
319
|
+
importerAttributes?: Record<string, string> | undefined;
|
|
320
|
+
isEntry: boolean;
|
|
321
|
+
}
|
|
316
322
|
) => ResolveIdResult;
|
|
317
323
|
|
|
318
324
|
export type ShouldTransformCachedModuleHook = (
|
|
319
325
|
this: PluginContext,
|
|
320
326
|
options: {
|
|
321
327
|
ast: ProgramNode;
|
|
328
|
+
attributes: Record<string, string>;
|
|
322
329
|
code: string;
|
|
323
330
|
id: string;
|
|
324
331
|
meta: CustomPluginOptions;
|
|
@@ -338,7 +345,19 @@ export type HasModuleSideEffects = (id: string, external: boolean) => boolean;
|
|
|
338
345
|
|
|
339
346
|
export type LoadResult = SourceDescription | string | NullValue;
|
|
340
347
|
|
|
341
|
-
export type LoadHook = (
|
|
348
|
+
export type LoadHook = (
|
|
349
|
+
this: PluginContext,
|
|
350
|
+
id: string,
|
|
351
|
+
// temporarily marked as optional for better Vite type-compatibility
|
|
352
|
+
options?:
|
|
353
|
+
| {
|
|
354
|
+
// unused, temporarily added for better Vite type-compatibility
|
|
355
|
+
ssr?: boolean | undefined;
|
|
356
|
+
// temporarily marked as optional for better Vite type-compatibility
|
|
357
|
+
attributes?: Record<string, string>;
|
|
358
|
+
}
|
|
359
|
+
| undefined
|
|
360
|
+
) => LoadResult;
|
|
342
361
|
|
|
343
362
|
export interface TransformPluginContext extends PluginContext {
|
|
344
363
|
debug: LoggingFunctionWithPosition;
|
|
@@ -353,7 +372,16 @@ export type TransformResult = string | NullValue | Partial<SourceDescription>;
|
|
|
353
372
|
export type TransformHook = (
|
|
354
373
|
this: TransformPluginContext,
|
|
355
374
|
code: string,
|
|
356
|
-
id: string
|
|
375
|
+
id: string,
|
|
376
|
+
// temporarily marked as optional for better Vite type-compatibility
|
|
377
|
+
options?:
|
|
378
|
+
| {
|
|
379
|
+
// unused, temporarily added for better Vite type-compatibility
|
|
380
|
+
ssr?: boolean | undefined;
|
|
381
|
+
// temporarily marked as optional for better Vite type-compatibility
|
|
382
|
+
attributes?: Record<string, string>;
|
|
383
|
+
}
|
|
384
|
+
| undefined
|
|
357
385
|
) => TransformResult;
|
|
358
386
|
|
|
359
387
|
export type ModuleParsedHook = (this: PluginContext, info: ModuleInfo) => void;
|
|
@@ -370,18 +398,24 @@ export type ResolveDynamicImportHook = (
|
|
|
370
398
|
this: PluginContext,
|
|
371
399
|
specifier: string | AstNode,
|
|
372
400
|
importer: string,
|
|
373
|
-
options: { attributes: Record<string, string> }
|
|
401
|
+
options: { attributes: Record<string, string>; importerAttributes: Record<string, string> }
|
|
374
402
|
) => ResolveIdResult;
|
|
375
403
|
|
|
376
404
|
export type ResolveImportMetaHook = (
|
|
377
405
|
this: PluginContext,
|
|
378
406
|
property: string | null,
|
|
379
|
-
options: {
|
|
407
|
+
options: {
|
|
408
|
+
attributes: Record<string, string>;
|
|
409
|
+
chunkId: string;
|
|
410
|
+
format: InternalModuleFormat;
|
|
411
|
+
moduleId: string;
|
|
412
|
+
}
|
|
380
413
|
) => string | NullValue;
|
|
381
414
|
|
|
382
415
|
export type ResolveFileUrlHook = (
|
|
383
416
|
this: PluginContext,
|
|
384
417
|
options: {
|
|
418
|
+
attributes: Record<string, string>;
|
|
385
419
|
chunkId: string;
|
|
386
420
|
fileName: string;
|
|
387
421
|
format: InternalModuleFormat;
|
|
@@ -463,6 +497,7 @@ export interface FunctionPluginHooks {
|
|
|
463
497
|
chunk: PreRenderedChunkWithFileName;
|
|
464
498
|
targetChunk: PreRenderedChunkWithFileName | null;
|
|
465
499
|
getTargetChunkImports: () => DynamicImportTargetChunk[] | null;
|
|
500
|
+
targetModuleAttributes: Record<string, string>;
|
|
466
501
|
}
|
|
467
502
|
) => { left: string; right: string } | NullValue;
|
|
468
503
|
renderError: (this: PluginContext, error?: Error) => void;
|
package/dist/rollup.js
CHANGED
package/dist/shared/index.js
CHANGED
package/dist/shared/parseAst.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.57.1
|
|
4
|
+
Fri, 30 Jan 2026 08:13:08 GMT - commit d37675f25150d6a94dcf4138853bdc2ecb3ce57b
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -276,6 +276,8 @@ const URL_WATCH = 'configuration-options/#watch';
|
|
|
276
276
|
const URL_BUNDLE_CONFIG_AS_CJS = 'command-line-interface/#bundleconfigascjs';
|
|
277
277
|
const URL_CONFIGURATION_FILES = 'command-line-interface/#configuration-files';
|
|
278
278
|
const URL_GENERATEBUNDLE = 'plugin-development/#generatebundle';
|
|
279
|
+
const URL_LOAD = 'plugin-development/#load';
|
|
280
|
+
const URL_TRANSFORM = 'plugin-development/#transform';
|
|
279
281
|
|
|
280
282
|
function error(base) {
|
|
281
283
|
throw base instanceof Error ? base : getRollupError(base);
|
|
@@ -2186,6 +2188,7 @@ exports.TemplateLiteral = TemplateLiteral;
|
|
|
2186
2188
|
exports.URL_AVOIDING_EVAL = URL_AVOIDING_EVAL;
|
|
2187
2189
|
exports.URL_GENERATEBUNDLE = URL_GENERATEBUNDLE;
|
|
2188
2190
|
exports.URL_JSX = URL_JSX;
|
|
2191
|
+
exports.URL_LOAD = URL_LOAD;
|
|
2189
2192
|
exports.URL_NAME_IS_NOT_EXPORTED = URL_NAME_IS_NOT_EXPORTED;
|
|
2190
2193
|
exports.URL_OUTPUT_AMD_BASEPATH = URL_OUTPUT_AMD_BASEPATH;
|
|
2191
2194
|
exports.URL_OUTPUT_AMD_ID = URL_OUTPUT_AMD_ID;
|
|
@@ -2203,6 +2206,7 @@ exports.URL_OUTPUT_SOURCEMAPFILE = URL_OUTPUT_SOURCEMAPFILE;
|
|
|
2203
2206
|
exports.URL_PRESERVEENTRYSIGNATURES = URL_PRESERVEENTRYSIGNATURES;
|
|
2204
2207
|
exports.URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT = URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT;
|
|
2205
2208
|
exports.URL_THIS_IS_UNDEFINED = URL_THIS_IS_UNDEFINED;
|
|
2209
|
+
exports.URL_TRANSFORM = URL_TRANSFORM;
|
|
2206
2210
|
exports.URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY = URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY;
|
|
2207
2211
|
exports.URL_TREESHAKE = URL_TREESHAKE;
|
|
2208
2212
|
exports.URL_TREESHAKE_MODULESIDEEFFECTS = URL_TREESHAKE_MODULESIDEEFFECTS;
|
package/dist/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.57.1
|
|
4
|
+
Fri, 30 Jan 2026 08:13:08 GMT - commit d37675f25150d6a94dcf4138853bdc2ecb3ce57b
|
|
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.57.1";
|
|
46
46
|
|
|
47
47
|
function ensureArray$1(items) {
|
|
48
48
|
if (Array.isArray(items)) {
|
|
@@ -926,9 +926,9 @@ function getPluginContext(plugin, pluginCache, graph, options, fileEmitter, exis
|
|
|
926
926
|
watchMode: graph.watchMode
|
|
927
927
|
},
|
|
928
928
|
parse: parseAst_js.parseAst,
|
|
929
|
-
resolve(source, importer, { attributes, custom, isEntry, skipSelf } = parseAst_js.BLANK) {
|
|
929
|
+
resolve(source, importer, { attributes, custom, isEntry, skipSelf, importerAttributes } = parseAst_js.BLANK) {
|
|
930
930
|
skipSelf ??= true;
|
|
931
|
-
return graph.moduleLoader.resolveId(source, importer, custom, isEntry, attributes || parseAst_js.EMPTY_OBJECT, skipSelf ? [{ importer, plugin, source }] : null);
|
|
931
|
+
return graph.moduleLoader.resolveId(source, importer, custom, isEntry, attributes || parseAst_js.EMPTY_OBJECT, importerAttributes, skipSelf ? [{ importer, plugin, source }] : null);
|
|
932
932
|
},
|
|
933
933
|
setAssetSource: fileEmitter.setAssetSource,
|
|
934
934
|
warn: getLogHandler(parseAst_js.LOGLEVEL_WARN, 'PLUGIN_WARNING', onLog, plugin.name, logLevel)
|
|
@@ -11558,7 +11558,7 @@ class MetaProperty extends NodeBase {
|
|
|
11558
11558
|
render(code, renderOptions) {
|
|
11559
11559
|
const { format, pluginDriver, snippets } = renderOptions;
|
|
11560
11560
|
const { scope: { context: { module } }, meta: { name }, metaProperty, parent, preliminaryChunkId, referenceId, start, end } = this;
|
|
11561
|
-
const { id: moduleId } = module;
|
|
11561
|
+
const { id: moduleId, info: { attributes } } = module;
|
|
11562
11562
|
if (name !== IMPORT)
|
|
11563
11563
|
return;
|
|
11564
11564
|
const chunkId = preliminaryChunkId;
|
|
@@ -11567,14 +11567,14 @@ class MetaProperty extends NodeBase {
|
|
|
11567
11567
|
const relativePath = parseAst_js.normalize(path.relative(path.dirname(chunkId), fileName));
|
|
11568
11568
|
const isUrlObject = !!metaProperty?.startsWith(FILE_OBJ_PREFIX);
|
|
11569
11569
|
const replacement = pluginDriver.hookFirstSync('resolveFileUrl', [
|
|
11570
|
-
{ chunkId, fileName, format, moduleId, referenceId, relativePath }
|
|
11570
|
+
{ attributes, chunkId, fileName, format, moduleId, referenceId, relativePath }
|
|
11571
11571
|
]) || relativeUrlMechanisms[format](relativePath, isUrlObject);
|
|
11572
11572
|
code.overwrite(parent.start, parent.end, replacement, { contentOnly: true });
|
|
11573
11573
|
return;
|
|
11574
11574
|
}
|
|
11575
11575
|
let replacement = pluginDriver.hookFirstSync('resolveImportMeta', [
|
|
11576
11576
|
metaProperty,
|
|
11577
|
-
{ chunkId, format, moduleId }
|
|
11577
|
+
{ attributes, chunkId, format, moduleId }
|
|
11578
11578
|
]);
|
|
11579
11579
|
if (!replacement) {
|
|
11580
11580
|
replacement = importMetaMechanisms[format]?.(metaProperty, { chunkId, snippets });
|
|
@@ -14839,6 +14839,9 @@ class ImportExpression extends NodeBase {
|
|
|
14839
14839
|
if (this.shouldIncludeDynamicAttributes) {
|
|
14840
14840
|
this.options?.include(context, includeChildrenRecursively);
|
|
14841
14841
|
}
|
|
14842
|
+
if (includeChildrenRecursively) {
|
|
14843
|
+
this.localResolution?.resolution.includeAllExports();
|
|
14844
|
+
}
|
|
14842
14845
|
}
|
|
14843
14846
|
includeNode(context) {
|
|
14844
14847
|
this.included = true;
|
|
@@ -14963,6 +14966,7 @@ class ImportExpression extends NodeBase {
|
|
|
14963
14966
|
},
|
|
14964
14967
|
moduleId: scope.context.module.id,
|
|
14965
14968
|
targetChunk: targetChunk ? getChunkInfoWithPath(targetChunk) : null,
|
|
14969
|
+
targetModuleAttributes: resolution && typeof resolution !== 'string' ? resolution.info.attributes : {},
|
|
14966
14970
|
targetModuleId: resolution && typeof resolution !== 'string' ? resolution.id : null
|
|
14967
14971
|
}
|
|
14968
14972
|
]);
|
|
@@ -22324,7 +22328,7 @@ class GlobalScope extends Scope {
|
|
|
22324
22328
|
}
|
|
22325
22329
|
}
|
|
22326
22330
|
|
|
22327
|
-
function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes) {
|
|
22331
|
+
function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes, importerAttributes) {
|
|
22328
22332
|
let skipped = null;
|
|
22329
22333
|
let replaceContext = null;
|
|
22330
22334
|
if (skip) {
|
|
@@ -22336,7 +22340,7 @@ function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolve
|
|
|
22336
22340
|
}
|
|
22337
22341
|
replaceContext = (pluginContext, plugin) => ({
|
|
22338
22342
|
...pluginContext,
|
|
22339
|
-
resolve: (source, importer, { attributes, custom, isEntry, skipSelf } = parseAst_js.BLANK) => {
|
|
22343
|
+
resolve: (source, importer, { attributes, custom, isEntry, skipSelf, importerAttributes } = parseAst_js.BLANK) => {
|
|
22340
22344
|
skipSelf ??= true;
|
|
22341
22345
|
if (skipSelf &&
|
|
22342
22346
|
skip.findIndex(skippedCall => {
|
|
@@ -22348,15 +22352,15 @@ function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolve
|
|
|
22348
22352
|
// Thus returning Promise.resolve(null) in purpose of fallback to default behavior of `resolveId` plugin hook.
|
|
22349
22353
|
return Promise.resolve(null);
|
|
22350
22354
|
}
|
|
22351
|
-
return moduleLoaderResolveId(source, importer, custom, isEntry, attributes || parseAst_js.EMPTY_OBJECT, skipSelf ? [...skip, { importer, plugin, source }] : skip);
|
|
22355
|
+
return moduleLoaderResolveId(source, importer, custom, isEntry, attributes || parseAst_js.EMPTY_OBJECT, importerAttributes, skipSelf ? [...skip, { importer, plugin, source }] : skip);
|
|
22352
22356
|
}
|
|
22353
22357
|
});
|
|
22354
22358
|
}
|
|
22355
|
-
return pluginDriver.hookFirstAndGetPlugin('resolveId', [source, importer, { attributes, custom: customOptions, isEntry }], replaceContext, skipped);
|
|
22359
|
+
return pluginDriver.hookFirstAndGetPlugin('resolveId', [source, importer, { attributes, custom: customOptions, importerAttributes, isEntry }], replaceContext, skipped);
|
|
22356
22360
|
}
|
|
22357
22361
|
|
|
22358
|
-
async function resolveId(source, importer, preserveSymlinks, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes, fs) {
|
|
22359
|
-
const pluginResult = await resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes);
|
|
22362
|
+
async function resolveId(source, importer, preserveSymlinks, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes, importerAttributes, fs) {
|
|
22363
|
+
const pluginResult = await resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes, importerAttributes);
|
|
22360
22364
|
if (pluginResult != null) {
|
|
22361
22365
|
const [resolveIdResult, plugin] = pluginResult;
|
|
22362
22366
|
if (typeof resolveIdResult === 'object' && !resolveIdResult.resolvedBy) {
|
|
@@ -22413,7 +22417,7 @@ function stripBom(content) {
|
|
|
22413
22417
|
return content;
|
|
22414
22418
|
}
|
|
22415
22419
|
|
|
22416
|
-
async function transform(source, module, pluginDriver,
|
|
22420
|
+
async function transform(source, module, pluginDriver, options) {
|
|
22417
22421
|
const id = module.id;
|
|
22418
22422
|
const sourcemapChain = [];
|
|
22419
22423
|
let originalSourcemap = source.map === null ? null : decodedSourcemap(source.map);
|
|
@@ -22435,10 +22439,13 @@ async function transform(source, module, pluginDriver, log) {
|
|
|
22435
22439
|
module.updateOptions(result);
|
|
22436
22440
|
if (result.code == null) {
|
|
22437
22441
|
if (result.map || result.ast) {
|
|
22438
|
-
|
|
22442
|
+
options.onLog(parseAst_js.LOGLEVEL_WARN, parseAst_js.logNoTransformMapOrAstWithoutCode(plugin.name));
|
|
22439
22443
|
}
|
|
22440
22444
|
return previousCode;
|
|
22441
22445
|
}
|
|
22446
|
+
if (result.attributes) {
|
|
22447
|
+
parseAst_js.warnDeprecation('Returning attributes from the "transform" hook is forbidden.', parseAst_js.URL_TRANSFORM, false, options);
|
|
22448
|
+
}
|
|
22442
22449
|
({ code, map, ast } = result);
|
|
22443
22450
|
}
|
|
22444
22451
|
else {
|
|
@@ -22465,7 +22472,13 @@ async function transform(source, module, pluginDriver, log) {
|
|
|
22465
22472
|
};
|
|
22466
22473
|
let code;
|
|
22467
22474
|
try {
|
|
22468
|
-
code = await pluginDriver.hookReduceArg0('transform', [
|
|
22475
|
+
code = await pluginDriver.hookReduceArg0('transform', [
|
|
22476
|
+
currentSource,
|
|
22477
|
+
id,
|
|
22478
|
+
{
|
|
22479
|
+
attributes: module.info.attributes
|
|
22480
|
+
}
|
|
22481
|
+
], transformReducer, (pluginContext, plugin) => {
|
|
22469
22482
|
pluginName = plugin.name;
|
|
22470
22483
|
return {
|
|
22471
22484
|
...pluginContext,
|
|
@@ -22491,7 +22504,7 @@ async function transform(source, module, pluginDriver, log) {
|
|
|
22491
22504
|
return pluginContext.error(error_);
|
|
22492
22505
|
},
|
|
22493
22506
|
getCombinedSourcemap() {
|
|
22494
|
-
const combinedMap = collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain,
|
|
22507
|
+
const combinedMap = collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, options.onLog);
|
|
22495
22508
|
if (!combinedMap) {
|
|
22496
22509
|
const magicString = new MagicString(originalCode);
|
|
22497
22510
|
return magicString.generateMap({ hires: true, includeContent: true, source: id });
|
|
@@ -22546,15 +22559,15 @@ class ModuleLoader {
|
|
|
22546
22559
|
this.modulesWithLoadedDependencies = new Set();
|
|
22547
22560
|
this.nextChunkNamePriority = 0;
|
|
22548
22561
|
this.nextEntryModuleIndex = 0;
|
|
22549
|
-
this.resolveId = async (source, importer, customOptions, isEntry, attributes, skip = null) => this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(this.options.external(source, importer, false)
|
|
22562
|
+
this.resolveId = async (source, importer, customOptions, isEntry, attributes, importerAttributes, skip = null) => this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(this.options.external(source, importer, false)
|
|
22550
22563
|
? false
|
|
22551
|
-
: await resolveId(source, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, skip, customOptions, typeof isEntry === 'boolean' ? isEntry : !importer, attributes, this.options.fs), importer, source), attributes);
|
|
22564
|
+
: await resolveId(source, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, skip, customOptions, typeof isEntry === 'boolean' ? isEntry : !importer, attributes, importerAttributes, this.options.fs), importer, source), attributes);
|
|
22552
22565
|
this.hasModuleSideEffects = options.treeshake
|
|
22553
22566
|
? options.treeshake.moduleSideEffects
|
|
22554
22567
|
: () => true;
|
|
22555
22568
|
}
|
|
22556
22569
|
async addAdditionalModules(unresolvedModules, isAddForManualChunks) {
|
|
22557
|
-
const result = this.extendLoadModulesPromise(Promise.all(unresolvedModules.map(id => this.loadEntryModule(id, false, undefined, null, isAddForManualChunks))));
|
|
22570
|
+
const result = this.extendLoadModulesPromise(Promise.all(unresolvedModules.map(id => this.loadEntryModule(id, false, undefined, null, isAddForManualChunks, undefined))));
|
|
22558
22571
|
await this.awaitLoadModulesPromise();
|
|
22559
22572
|
return result;
|
|
22560
22573
|
}
|
|
@@ -22563,7 +22576,7 @@ class ModuleLoader {
|
|
|
22563
22576
|
this.nextEntryModuleIndex += unresolvedEntryModules.length;
|
|
22564
22577
|
const firstChunkNamePriority = this.nextChunkNamePriority;
|
|
22565
22578
|
this.nextChunkNamePriority += unresolvedEntryModules.length;
|
|
22566
|
-
const newEntryModules = await this.extendLoadModulesPromise(Promise.all(unresolvedEntryModules.map(({ id, importer }) => this.loadEntryModule(id, true, importer, null))).then(entryModules => {
|
|
22579
|
+
const newEntryModules = await this.extendLoadModulesPromise(Promise.all(unresolvedEntryModules.map(({ id, importer }) => this.loadEntryModule(id, true, importer, null, undefined, undefined))).then(entryModules => {
|
|
22567
22580
|
for (const [index, entryModule] of entryModules.entries()) {
|
|
22568
22581
|
entryModule.isUserDefinedEntryPoint =
|
|
22569
22582
|
entryModule.isUserDefinedEntryPoint || isUserDefined;
|
|
@@ -22610,10 +22623,10 @@ class ModuleLoader {
|
|
|
22610
22623
|
}
|
|
22611
22624
|
addEntryWithImplicitDependants(unresolvedModule, implicitlyLoadedAfter) {
|
|
22612
22625
|
const chunkNamePriority = this.nextChunkNamePriority++;
|
|
22613
|
-
return this.extendLoadModulesPromise(this.loadEntryModule(unresolvedModule.id, false, unresolvedModule.importer, null).then(async (entryModule) => {
|
|
22626
|
+
return this.extendLoadModulesPromise(this.loadEntryModule(unresolvedModule.id, false, unresolvedModule.importer, null, undefined, undefined).then(async (entryModule) => {
|
|
22614
22627
|
addChunkNamesToModule(entryModule, unresolvedModule, false, chunkNamePriority);
|
|
22615
22628
|
if (!entryModule.info.isEntry) {
|
|
22616
|
-
const implicitlyLoadedAfterModules = await Promise.all(implicitlyLoadedAfter.map(id => this.loadEntryModule(id, false, unresolvedModule.importer, entryModule.id)));
|
|
22629
|
+
const implicitlyLoadedAfterModules = await Promise.all(implicitlyLoadedAfter.map(id => this.loadEntryModule(id, false, unresolvedModule.importer, entryModule.id, undefined, undefined)));
|
|
22617
22630
|
// We need to check again if this is still an entry module as these
|
|
22618
22631
|
// changes need to be performed atomically to avoid race conditions
|
|
22619
22632
|
// if the same module is re-emitted as an entry module.
|
|
@@ -22635,9 +22648,16 @@ class ModuleLoader {
|
|
|
22635
22648
|
let source;
|
|
22636
22649
|
try {
|
|
22637
22650
|
source = await this.graph.fileOperationQueue.run(async () => {
|
|
22638
|
-
const content = await this.pluginDriver.hookFirst('load', [
|
|
22639
|
-
|
|
22651
|
+
const content = await this.pluginDriver.hookFirst('load', [
|
|
22652
|
+
id,
|
|
22653
|
+
{ attributes: module.info.attributes }
|
|
22654
|
+
]);
|
|
22655
|
+
if (content !== null) {
|
|
22656
|
+
if (typeof content === 'object' && content.attributes) {
|
|
22657
|
+
parseAst_js.warnDeprecation('Returning attributes from the "load" hook is forbidden.', parseAst_js.URL_LOAD, false, this.options);
|
|
22658
|
+
}
|
|
22640
22659
|
return content;
|
|
22660
|
+
}
|
|
22641
22661
|
this.graph.watchFiles[id] = true;
|
|
22642
22662
|
return (await this.options.fs.readFile(id, { encoding: 'utf8' }));
|
|
22643
22663
|
});
|
|
@@ -22663,6 +22683,7 @@ class ModuleLoader {
|
|
|
22663
22683
|
!(await this.pluginDriver.hookFirst('shouldTransformCachedModule', [
|
|
22664
22684
|
{
|
|
22665
22685
|
ast: cachedModule.ast,
|
|
22686
|
+
attributes: cachedModule.attributes,
|
|
22666
22687
|
code: cachedModule.code,
|
|
22667
22688
|
id: cachedModule.id,
|
|
22668
22689
|
meta: cachedModule.meta,
|
|
@@ -22679,7 +22700,7 @@ class ModuleLoader {
|
|
|
22679
22700
|
}
|
|
22680
22701
|
else {
|
|
22681
22702
|
module.updateOptions(sourceDescription);
|
|
22682
|
-
await module.setSource(await transform(sourceDescription, module, this.pluginDriver, this.options
|
|
22703
|
+
await module.setSource(await transform(sourceDescription, module, this.pluginDriver, this.options));
|
|
22683
22704
|
}
|
|
22684
22705
|
}
|
|
22685
22706
|
async awaitLoadModulesPromise() {
|
|
@@ -22852,7 +22873,7 @@ class ModuleLoader {
|
|
|
22852
22873
|
source,
|
|
22853
22874
|
(module.resolvedIds[source] =
|
|
22854
22875
|
module.resolvedIds[source] ||
|
|
22855
|
-
this.handleInvalidResolvedId(await this.resolveId(source, module.id, parseAst_js.EMPTY_OBJECT, false, attributes), source, module.id, attributes))
|
|
22876
|
+
this.handleInvalidResolvedId(await this.resolveId(source, module.id, parseAst_js.EMPTY_OBJECT, false, attributes, module.info.attributes), source, module.id, attributes))
|
|
22856
22877
|
]);
|
|
22857
22878
|
}
|
|
22858
22879
|
getResolvedIdWithDefaults(resolvedId, attributes) {
|
|
@@ -22910,8 +22931,8 @@ class ModuleLoader {
|
|
|
22910
22931
|
}
|
|
22911
22932
|
return resolvedId;
|
|
22912
22933
|
}
|
|
22913
|
-
async loadEntryModule(unresolvedId, isEntry, importer, implicitlyLoadedBefore, isLoadForManualChunks = false) {
|
|
22914
|
-
const resolveIdResult = await resolveId(unresolvedId, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, null, parseAst_js.EMPTY_OBJECT, true, parseAst_js.EMPTY_OBJECT, this.options.fs);
|
|
22934
|
+
async loadEntryModule(unresolvedId, isEntry, importer, implicitlyLoadedBefore, isLoadForManualChunks = false, importerAttributes) {
|
|
22935
|
+
const resolveIdResult = await resolveId(unresolvedId, importer, this.options.preserveSymlinks, this.pluginDriver, this.resolveId, null, parseAst_js.EMPTY_OBJECT, true, parseAst_js.EMPTY_OBJECT, importerAttributes, this.options.fs);
|
|
22915
22936
|
if (resolveIdResult == null) {
|
|
22916
22937
|
return parseAst_js.error(implicitlyLoadedBefore === null
|
|
22917
22938
|
? parseAst_js.logUnresolvedEntry(unresolvedId)
|
|
@@ -22933,7 +22954,7 @@ class ModuleLoader {
|
|
|
22933
22954
|
const resolution = await this.pluginDriver.hookFirst('resolveDynamicImport', [
|
|
22934
22955
|
specifier,
|
|
22935
22956
|
importer,
|
|
22936
|
-
{ attributes }
|
|
22957
|
+
{ attributes, importerAttributes: module.info.attributes }
|
|
22937
22958
|
]);
|
|
22938
22959
|
if (typeof specifier !== 'string') {
|
|
22939
22960
|
if (typeof resolution === 'string') {
|
|
@@ -22952,7 +22973,7 @@ class ModuleLoader {
|
|
|
22952
22973
|
}
|
|
22953
22974
|
return existingResolution;
|
|
22954
22975
|
}
|
|
22955
|
-
return (module.resolvedIds[specifier] = this.handleInvalidResolvedId(await this.resolveId(specifier, module.id, parseAst_js.EMPTY_OBJECT, false, attributes), specifier, module.id, attributes));
|
|
22976
|
+
return (module.resolvedIds[specifier] = this.handleInvalidResolvedId(await this.resolveId(specifier, module.id, parseAst_js.EMPTY_OBJECT, false, attributes, module.info.attributes), specifier, module.id, attributes));
|
|
22956
22977
|
}
|
|
22957
22978
|
return this.handleInvalidResolvedId(this.getResolvedIdWithDefaults(this.getNormalizedResolvedIdWithoutDefaults(resolution, importer, specifier), attributes), specifier, importer, attributes);
|
|
22958
22979
|
}
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rollup/wasm-node",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.57.1",
|
|
4
4
|
"description": "Next-generation ES module bundler with Node wasm",
|
|
5
5
|
"main": "dist/rollup.js",
|
|
6
6
|
"module": "dist/es/rollup.js",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@codemirror/lang-javascript": "^6.2.4",
|
|
40
40
|
"@codemirror/language": "^6.12.1",
|
|
41
41
|
"@codemirror/search": "^6.6.0",
|
|
42
|
-
"@codemirror/state": "^6.5.
|
|
43
|
-
"@codemirror/view": "^6.39.
|
|
42
|
+
"@codemirror/state": "^6.5.4",
|
|
43
|
+
"@codemirror/view": "^6.39.11",
|
|
44
44
|
"@eslint/js": "^9.39.2",
|
|
45
45
|
"@inquirer/prompts": "^7.10.1",
|
|
46
46
|
"@jridgewell/sourcemap-codec": "^1.5.5",
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
"@rollup/pluginutils": "^5.3.0",
|
|
58
58
|
"@shikijs/vitepress-twoslash": "^3.21.0",
|
|
59
59
|
"@types/mocha": "^10.0.10",
|
|
60
|
-
"@types/node": "^20.19.
|
|
60
|
+
"@types/node": "^20.19.30",
|
|
61
61
|
"@types/picomatch": "^4.0.2",
|
|
62
62
|
"@types/semver": "^7.7.1",
|
|
63
63
|
"@types/yargs-parser": "^21.0.3",
|
|
64
|
-
"@vue/language-server": "^3.2.
|
|
64
|
+
"@vue/language-server": "^3.2.4",
|
|
65
65
|
"acorn": "^8.15.0",
|
|
66
66
|
"acorn-import-assertions": "^1.9.0",
|
|
67
67
|
"acorn-jsx": "^5.3.2",
|
|
@@ -76,20 +76,20 @@
|
|
|
76
76
|
"es6-shim": "^0.35.8",
|
|
77
77
|
"eslint": "^9.39.2",
|
|
78
78
|
"eslint-config-prettier": "^10.1.8",
|
|
79
|
-
"eslint-plugin-prettier": "^5.5.
|
|
79
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
80
80
|
"eslint-plugin-unicorn": "^62.0.0",
|
|
81
|
-
"eslint-plugin-vue": "^10.
|
|
81
|
+
"eslint-plugin-vue": "^10.7.0",
|
|
82
82
|
"fixturify": "^3.0.0",
|
|
83
83
|
"flru": "^1.0.2",
|
|
84
84
|
"fs-extra": "^11.3.3",
|
|
85
85
|
"github-api": "^3.4.0",
|
|
86
|
-
"globals": "^17.
|
|
86
|
+
"globals": "^17.1.0",
|
|
87
87
|
"husky": "^9.1.7",
|
|
88
88
|
"is-reference": "^3.0.3",
|
|
89
89
|
"lint-staged": "^16.2.7",
|
|
90
90
|
"locate-character": "^3.0.0",
|
|
91
91
|
"magic-string": "^0.30.21",
|
|
92
|
-
"memfs": "^4.
|
|
92
|
+
"memfs": "^4.56.10",
|
|
93
93
|
"mocha": "^11.7.5",
|
|
94
94
|
"nodemon": "^3.1.11",
|
|
95
95
|
"npm-audit-resolver": "^3.0.0-RC.0",
|
|
@@ -98,12 +98,12 @@
|
|
|
98
98
|
"picocolors": "^1.1.1",
|
|
99
99
|
"picomatch": "^4.0.3",
|
|
100
100
|
"pinia": "^3.0.4",
|
|
101
|
-
"prettier": "^3.
|
|
101
|
+
"prettier": "^3.8.1",
|
|
102
102
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
103
103
|
"pretty-bytes": "^7.1.0",
|
|
104
104
|
"pretty-ms": "^9.3.0",
|
|
105
105
|
"requirejs": "^2.3.8",
|
|
106
|
-
"rollup": "^4.
|
|
106
|
+
"rollup": "^4.56.0",
|
|
107
107
|
"rollup-plugin-license": "^3.6.0",
|
|
108
108
|
"semver": "^7.7.3",
|
|
109
109
|
"shx": "^0.4.0",
|
|
@@ -111,26 +111,26 @@
|
|
|
111
111
|
"source-map": "^0.7.6",
|
|
112
112
|
"source-map-support": "^0.5.21",
|
|
113
113
|
"systemjs": "^6.15.1",
|
|
114
|
-
"terser": "^5.
|
|
114
|
+
"terser": "^5.46.0",
|
|
115
115
|
"tslib": "^2.8.1",
|
|
116
116
|
"typescript": "^5.9.3",
|
|
117
|
-
"typescript-eslint": "^8.
|
|
117
|
+
"typescript-eslint": "^8.54.0",
|
|
118
118
|
"vite": "^7.3.1",
|
|
119
119
|
"vitepress": "^1.6.4",
|
|
120
|
-
"vue": "^3.5.
|
|
120
|
+
"vue": "^3.5.27",
|
|
121
121
|
"vue-eslint-parser": "^10.2.0",
|
|
122
|
-
"vue-tsc": "^3.2.
|
|
123
|
-
"wasm-pack": "^0.
|
|
122
|
+
"vue-tsc": "^3.2.4",
|
|
123
|
+
"wasm-pack": "^0.14.0",
|
|
124
124
|
"yargs-parser": "^21.1.1"
|
|
125
125
|
},
|
|
126
126
|
"overrides": {
|
|
127
|
-
"axios": "^1.13.
|
|
127
|
+
"axios": "^1.13.3",
|
|
128
128
|
"esbuild": ">0.24.2",
|
|
129
129
|
"readable-stream": "npm:@built-in/readable-stream@1",
|
|
130
130
|
"semver": "^7.7.3",
|
|
131
131
|
"vite": "$vite",
|
|
132
132
|
"path-scurry": {
|
|
133
|
-
"lru-cache": "^11.2.
|
|
133
|
+
"lru-cache": "^11.2.5"
|
|
134
134
|
}
|
|
135
135
|
},
|
|
136
136
|
"comments": {
|