@rollup/wasm-node 4.40.1 → 4.41.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 +34 -6
- 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 +152 -77
- package/dist/es/shared/parseAst.js +6 -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.js +31 -2
- package/dist/shared/fsevents-importer.js +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +4 -3
- package/dist/shared/parseAst.js +8 -2
- package/dist/shared/rollup.js +122 -76
- 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 +24 -24
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.41.0
|
|
5
|
+
Sun, 18 May 2025 05:33:01 GMT - commit 0928185cd544907dab472754634ddf988452aae6
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
8
8
|
|
|
@@ -1577,8 +1577,36 @@ const toLocaleString = (number, locale, options) => {
|
|
|
1577
1577
|
return result;
|
|
1578
1578
|
};
|
|
1579
1579
|
|
|
1580
|
+
const log10 = numberOrBigInt => {
|
|
1581
|
+
if (typeof numberOrBigInt === 'number') {
|
|
1582
|
+
return Math.log10(numberOrBigInt);
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
const string = numberOrBigInt.toString(10);
|
|
1586
|
+
|
|
1587
|
+
return string.length + Math.log10('0.' + string.slice(0, 15));
|
|
1588
|
+
};
|
|
1589
|
+
|
|
1590
|
+
const log = numberOrBigInt => {
|
|
1591
|
+
if (typeof numberOrBigInt === 'number') {
|
|
1592
|
+
return Math.log(numberOrBigInt);
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
return log10(numberOrBigInt) * Math.log(10);
|
|
1596
|
+
};
|
|
1597
|
+
|
|
1598
|
+
const divide = (numberOrBigInt, divisor) => {
|
|
1599
|
+
if (typeof numberOrBigInt === 'number') {
|
|
1600
|
+
return numberOrBigInt / divisor;
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
const integerPart = numberOrBigInt / BigInt(divisor);
|
|
1604
|
+
const remainder = numberOrBigInt % BigInt(divisor);
|
|
1605
|
+
return Number(integerPart) + (Number(remainder) / divisor);
|
|
1606
|
+
};
|
|
1607
|
+
|
|
1580
1608
|
function prettyBytes(number, options) {
|
|
1581
|
-
if (!Number.isFinite(number)) {
|
|
1609
|
+
if (typeof number !== 'bigint' && !Number.isFinite(number)) {
|
|
1582
1610
|
throw new TypeError(`Expected a finite number, got ${typeof number}: ${number}`);
|
|
1583
1611
|
}
|
|
1584
1612
|
|
|
@@ -1595,7 +1623,7 @@ function prettyBytes(number, options) {
|
|
|
1595
1623
|
|
|
1596
1624
|
const separator = options.space ? ' ' : '';
|
|
1597
1625
|
|
|
1598
|
-
if (options.signed && number === 0) {
|
|
1626
|
+
if (options.signed && (typeof number === 'number' ? number === 0 : number === 0n)) {
|
|
1599
1627
|
return ` 0${separator}${UNITS[0]}`;
|
|
1600
1628
|
}
|
|
1601
1629
|
|
|
@@ -1621,8 +1649,8 @@ function prettyBytes(number, options) {
|
|
|
1621
1649
|
return prefix + numberString + separator + UNITS[0];
|
|
1622
1650
|
}
|
|
1623
1651
|
|
|
1624
|
-
const exponent = Math.min(Math.floor(options.binary ?
|
|
1625
|
-
number
|
|
1652
|
+
const exponent = Math.min(Math.floor(options.binary ? log(number) / Math.log(1024) : log10(number) / 3), UNITS.length - 1);
|
|
1653
|
+
number = divide(number, (options.binary ? 1024 : 1000) ** exponent);
|
|
1626
1654
|
|
|
1627
1655
|
if (!localeOptions) {
|
|
1628
1656
|
number = number.toPrecision(3);
|
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.41.0
|
|
4
|
+
Sun, 18 May 2025 05:33:01 GMT - commit 0928185cd544907dab472754634ddf988452aae6
|
|
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, 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, ExpressionStatement as ExpressionStatement$1, logMissingExport, normalize, getImportPath, logMissingNodeBuiltins, logReservedNamespace, error, logIllegalIdentifierAsName, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, RestElement as RestElement$1, logConstVariableReassignError,
|
|
10
|
+
import { EMPTY_OBJECT, ExportDefaultDeclaration as ExportDefaultDeclaration$1, CallExpression as CallExpression$1, EMPTY_ARRAY, LOGLEVEL_WARN, logUnusedExternalImports, ANNOTATION_KEY, INVALID_ANNOTATION_KEY, ArrowFunctionExpression as ArrowFunctionExpression$1, MemberExpression as MemberExpression$1, Identifier as Identifier$1, ImportExpression as ImportExpression$1, AwaitExpression as AwaitExpression$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, ExpressionStatement as ExpressionStatement$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, logSyntheticNamedExportsNeedNamespaceExport, logMissingEntryExport, logDuplicateExportError, logInvalidSourcemapForError, augmentCodeLocation, logInconsistentImportAttributes, logMissingJsxExport, logNamespaceConflict, logAmbiguousExternalNamespaces, logShimmedExport, parseAst, logInvalidFormatForTopLevelAwait, TemplateLiteral as TemplateLiteral$1, Literal as Literal$1, logCircularReexport, 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, logUnknownOption, LOGLEVEL_ERROR, logLevelPriority, LOGLEVEL_DEBUG, printQuotedStringList, logInvalidSetAssetSourceCall, logPluginError, logNoTransformMapOrAstWithoutCode, relativeId, logBadLoader, logExternalModulesCannotBeTransformedToModules, logInternalIdCannotBeExternal, isRelative, logUnresolvedImport, logUnresolvedImportTreatedAsExternal, logExternalSyntheticExports, logUnresolvedEntry, logUnresolvedImplicitDependant, logExternalModulesCannotBeIncludedInManualChunks, logEntryCannotBeExternal, logImplicitDependantCannotBeExternal, logNoAssetSourceSet, logFileReferenceIdNotFoundForFilename, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logInvalidRollupPhaseForChunkEmission, warnDeprecation, logChunkNotGeneratedForFileName, logAssetNotFinalisedForFileName, logFileNameConflict, URL_GENERATEBUNDLE, logInvalidLogPosition, logInputHookInOutputPlugin, logInvalidAddonPluginHook, logInvalidFunctionPluginHook, logImplicitDependantIsNotIncluded, logCircularDependency, augmentLogMessage, URL_JSX, URL_TREESHAKE_MODULESIDEEFFECTS, URL_TREESHAKE, 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';
|
|
@@ -15,7 +15,7 @@ import process$1, { env } from 'node:process';
|
|
|
15
15
|
import { performance } from 'node:perf_hooks';
|
|
16
16
|
import { lstat, realpath, readdir, readFile, mkdir, writeFile } from 'node:fs/promises';
|
|
17
17
|
|
|
18
|
-
var version = "4.
|
|
18
|
+
var version = "4.41.0";
|
|
19
19
|
|
|
20
20
|
const comma = ','.charCodeAt(0);
|
|
21
21
|
const semicolon = ';'.charCodeAt(0);
|
|
@@ -2192,8 +2192,7 @@ function createInclusionContext() {
|
|
|
2192
2192
|
hasBreak: false,
|
|
2193
2193
|
hasContinue: false,
|
|
2194
2194
|
includedCallArguments: new Set(),
|
|
2195
|
-
includedLabels: new Set()
|
|
2196
|
-
withinTopLevelAwait: false
|
|
2195
|
+
includedLabels: new Set()
|
|
2197
2196
|
};
|
|
2198
2197
|
}
|
|
2199
2198
|
function createHasEffectsContext() {
|
|
@@ -2288,10 +2287,13 @@ const deoptimizeInteraction = (interaction) => {
|
|
|
2288
2287
|
argument?.deoptimizePath(UNKNOWN_PATH);
|
|
2289
2288
|
}
|
|
2290
2289
|
};
|
|
2291
|
-
const includeInteraction = (
|
|
2290
|
+
const includeInteraction = (interaction, context) => {
|
|
2292
2291
|
// We do not re-include the "this" argument as we expect this is already
|
|
2293
2292
|
// re-included at the call site
|
|
2294
|
-
args[0]?.includePath(UNKNOWN_PATH, context);
|
|
2293
|
+
interaction.args[0]?.includePath(UNKNOWN_PATH, context);
|
|
2294
|
+
includeInteractionWithoutThis(interaction, context);
|
|
2295
|
+
};
|
|
2296
|
+
const includeInteractionWithoutThis = ({ args }, context) => {
|
|
2295
2297
|
for (let argumentIndex = 1; argumentIndex < args.length; argumentIndex++) {
|
|
2296
2298
|
const argument = args[argumentIndex];
|
|
2297
2299
|
if (argument) {
|
|
@@ -2968,7 +2970,25 @@ function isObjectExpressionNode(node) {
|
|
|
2968
2970
|
return node instanceof NodeBase && node.type === ObjectExpression$1;
|
|
2969
2971
|
}
|
|
2970
2972
|
function isPropertyNode(node) {
|
|
2971
|
-
return node.type === Property$1;
|
|
2973
|
+
return node instanceof NodeBase && node.type === Property$1;
|
|
2974
|
+
}
|
|
2975
|
+
function isArrowFunctionExpressionNode(node) {
|
|
2976
|
+
return node instanceof NodeBase && node.type === ArrowFunctionExpression$1;
|
|
2977
|
+
}
|
|
2978
|
+
function isCallExpressionNode(node) {
|
|
2979
|
+
return node instanceof NodeBase && node.type === CallExpression$1;
|
|
2980
|
+
}
|
|
2981
|
+
function isMemberExpressionNode(node) {
|
|
2982
|
+
return node instanceof NodeBase && node.type === MemberExpression$1;
|
|
2983
|
+
}
|
|
2984
|
+
function isImportExpressionNode(node) {
|
|
2985
|
+
return node instanceof NodeBase && node.type === ImportExpression$1;
|
|
2986
|
+
}
|
|
2987
|
+
function isAwaitExpressionNode(node) {
|
|
2988
|
+
return node instanceof NodeBase && node.type === AwaitExpression$1;
|
|
2989
|
+
}
|
|
2990
|
+
function isIdentifierNode(node) {
|
|
2991
|
+
return node instanceof NodeBase && node.type === Identifier$1;
|
|
2972
2992
|
}
|
|
2973
2993
|
|
|
2974
2994
|
function assembleMemberDescriptions(memberDescriptions, inheritedDescriptions = null) {
|
|
@@ -5103,6 +5123,20 @@ class LocalVariable extends Variable {
|
|
|
5103
5123
|
break;
|
|
5104
5124
|
node = node.parent;
|
|
5105
5125
|
}
|
|
5126
|
+
/**
|
|
5127
|
+
* import('foo').then(m => {
|
|
5128
|
+
* console.log(m.foo)
|
|
5129
|
+
* })
|
|
5130
|
+
*/
|
|
5131
|
+
if (this.kind === 'parameter' &&
|
|
5132
|
+
isArrowFunctionExpressionNode(declaration.parent) &&
|
|
5133
|
+
isCallExpressionNode(declaration.parent.parent) &&
|
|
5134
|
+
isMemberExpressionNode(declaration.parent.parent.callee) &&
|
|
5135
|
+
isIdentifierNode(declaration.parent.parent.callee.property) &&
|
|
5136
|
+
declaration.parent.parent.callee.property.name === 'then' &&
|
|
5137
|
+
isImportExpressionNode(declaration.parent.parent.callee.object)) {
|
|
5138
|
+
declaration.parent.parent.callee.object.includePath(path);
|
|
5139
|
+
}
|
|
5106
5140
|
}
|
|
5107
5141
|
// We need to make sure we include the correct path of the init
|
|
5108
5142
|
if (path.length > 0) {
|
|
@@ -7493,7 +7527,21 @@ class MemberExpression extends NodeBase {
|
|
|
7493
7527
|
this.variable.includeCallArguments(interaction, context);
|
|
7494
7528
|
}
|
|
7495
7529
|
else {
|
|
7496
|
-
|
|
7530
|
+
if (isImportExpressionNode(this.object) ||
|
|
7531
|
+
/**
|
|
7532
|
+
* const c = await import('foo')
|
|
7533
|
+
* c.foo();
|
|
7534
|
+
*/
|
|
7535
|
+
(this.object.variable &&
|
|
7536
|
+
!this.object.variable.isReassigned &&
|
|
7537
|
+
this.object.variable instanceof LocalVariable &&
|
|
7538
|
+
isAwaitExpressionNode(this.object.variable.init) &&
|
|
7539
|
+
isImportExpressionNode(this.object.variable.init.argument))) {
|
|
7540
|
+
includeInteractionWithoutThis(interaction, context);
|
|
7541
|
+
}
|
|
7542
|
+
else {
|
|
7543
|
+
includeInteraction(interaction, context);
|
|
7544
|
+
}
|
|
7497
7545
|
}
|
|
7498
7546
|
}
|
|
7499
7547
|
includeDestructuredIfNecessary(context, destructuredInitPath, init) {
|
|
@@ -8424,7 +8472,7 @@ function amd(magicString, { accessedGlobals, dependencies, exports, hasDefaultEx
|
|
|
8424
8472
|
const deps = dependencies.map(m => `'${updateExtensionForRelativeAmdId(m.importPath, amd.forceJsExtensionForImports)}'`);
|
|
8425
8473
|
const parameters = dependencies.map(m => m.name);
|
|
8426
8474
|
const { n, getNonArrowFunctionIntro, _ } = snippets;
|
|
8427
|
-
if (
|
|
8475
|
+
if (hasExports && (namedExportsMode || exports[0]?.local === 'exports.default')) {
|
|
8428
8476
|
parameters.unshift(`exports`);
|
|
8429
8477
|
deps.unshift(`'exports'`);
|
|
8430
8478
|
}
|
|
@@ -8683,7 +8731,7 @@ function iife(magicString, { accessedGlobals, dependencies, exports, hasDefaultE
|
|
|
8683
8731
|
if (hasExports && !name) {
|
|
8684
8732
|
log(LOGLEVEL_WARN, logMissingNameOptionForIifeExport());
|
|
8685
8733
|
}
|
|
8686
|
-
if (
|
|
8734
|
+
if (hasExports && (namedExportsMode || exports[0]?.local === 'exports.default')) {
|
|
8687
8735
|
if (extend) {
|
|
8688
8736
|
deps.unshift(`this${keypath(name, getPropertyAccess)}${_}=${_}this${keypath(name, getPropertyAccess)}${_}||${_}{}`);
|
|
8689
8737
|
parameters.unshift('exports');
|
|
@@ -8902,7 +8950,8 @@ function umd(magicString, { accessedGlobals, dependencies, exports, hasDefaultEx
|
|
|
8902
8950
|
const trimmedImports = trimEmptyImports(dependencies);
|
|
8903
8951
|
const globalDeps = trimmedImports.map(module => globalProperty(module.globalName, globalVariable, getPropertyAccess));
|
|
8904
8952
|
const factoryParameters = trimmedImports.map(m => m.name);
|
|
8905
|
-
if (
|
|
8953
|
+
if ((hasExports || noConflict) &&
|
|
8954
|
+
(namedExportsMode || (hasExports && exports[0]?.local === 'exports.default'))) {
|
|
8906
8955
|
amdDeps.unshift(`'exports'`);
|
|
8907
8956
|
cjsDeps.unshift(`exports`);
|
|
8908
8957
|
globalDeps.unshift(assignToDeepVariable(name, globalVariable, globals, `${extend ? `${globalProperty(name, globalVariable, getPropertyAccess)}${_}||${_}` : ''}{}`, snippets, log));
|
|
@@ -11658,44 +11707,38 @@ class AssignmentPattern extends NodeBase {
|
|
|
11658
11707
|
}
|
|
11659
11708
|
|
|
11660
11709
|
class AwaitExpression extends NodeBase {
|
|
11661
|
-
get isTopLevelAwait() {
|
|
11662
|
-
return isFlagSet(this.flags, 134217728 /* Flag.isTopLevelAwait */);
|
|
11663
|
-
}
|
|
11664
|
-
set isTopLevelAwait(value) {
|
|
11665
|
-
this.flags = setFlag(this.flags, 134217728 /* Flag.isTopLevelAwait */, value);
|
|
11666
|
-
}
|
|
11667
11710
|
hasEffects() {
|
|
11668
11711
|
if (!this.deoptimized)
|
|
11669
11712
|
this.applyDeoptimizations();
|
|
11670
11713
|
return true;
|
|
11671
11714
|
}
|
|
11715
|
+
initialise() {
|
|
11716
|
+
super.initialise();
|
|
11717
|
+
let parent = this.parent;
|
|
11718
|
+
do {
|
|
11719
|
+
if (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression)
|
|
11720
|
+
return;
|
|
11721
|
+
} while ((parent = parent.parent));
|
|
11722
|
+
this.scope.context.usesTopLevelAwait = true;
|
|
11723
|
+
}
|
|
11672
11724
|
include(context, includeChildrenRecursively) {
|
|
11673
11725
|
if (!this.included)
|
|
11674
11726
|
this.includeNode(context);
|
|
11675
|
-
this.argument.include(
|
|
11727
|
+
this.argument.include(context, includeChildrenRecursively);
|
|
11676
11728
|
}
|
|
11677
11729
|
includeNode(context) {
|
|
11678
11730
|
this.included = true;
|
|
11679
11731
|
if (!this.deoptimized)
|
|
11680
11732
|
this.applyDeoptimizations();
|
|
11681
|
-
checkTopLevelAwait: {
|
|
11682
|
-
let parent = this.parent;
|
|
11683
|
-
do {
|
|
11684
|
-
if (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression)
|
|
11685
|
-
break checkTopLevelAwait;
|
|
11686
|
-
} while ((parent = parent.parent));
|
|
11687
|
-
this.scope.context.usesTopLevelAwait = true;
|
|
11688
|
-
this.isTopLevelAwait = true;
|
|
11689
|
-
}
|
|
11690
11733
|
// Thenables need to be included
|
|
11691
|
-
this.argument.includePath(THEN_PATH,
|
|
11734
|
+
this.argument.includePath(THEN_PATH, context);
|
|
11692
11735
|
}
|
|
11693
11736
|
includePath(path, context) {
|
|
11694
11737
|
if (!this.deoptimized)
|
|
11695
11738
|
this.applyDeoptimizations();
|
|
11696
11739
|
if (!this.included)
|
|
11697
11740
|
this.includeNode(context);
|
|
11698
|
-
this.argument.includePath(path,
|
|
11741
|
+
this.argument.includePath(path, context);
|
|
11699
11742
|
}
|
|
11700
11743
|
}
|
|
11701
11744
|
const THEN_PATH = ['then'];
|
|
@@ -11920,10 +11963,10 @@ class CallExpressionBase extends NodeBase {
|
|
|
11920
11963
|
|
|
11921
11964
|
class CallExpression extends CallExpressionBase {
|
|
11922
11965
|
get hasCheckedForWarnings() {
|
|
11923
|
-
return isFlagSet(this.flags,
|
|
11966
|
+
return isFlagSet(this.flags, 268435456 /* Flag.checkedForWarnings */);
|
|
11924
11967
|
}
|
|
11925
11968
|
set hasCheckedForWarnings(value) {
|
|
11926
|
-
this.flags = setFlag(this.flags,
|
|
11969
|
+
this.flags = setFlag(this.flags, 268435456 /* Flag.checkedForWarnings */, value);
|
|
11927
11970
|
}
|
|
11928
11971
|
get optional() {
|
|
11929
11972
|
return isFlagSet(this.flags, 128 /* Flag.optional */);
|
|
@@ -12929,10 +12972,10 @@ class ImportExpression extends NodeBase {
|
|
|
12929
12972
|
this.resolutionString = null;
|
|
12930
12973
|
}
|
|
12931
12974
|
get withinTopLevelAwait() {
|
|
12932
|
-
return isFlagSet(this.flags,
|
|
12975
|
+
return isFlagSet(this.flags, 134217728 /* Flag.withinTopLevelAwait */);
|
|
12933
12976
|
}
|
|
12934
12977
|
set withinTopLevelAwait(value) {
|
|
12935
|
-
this.flags = setFlag(this.flags,
|
|
12978
|
+
this.flags = setFlag(this.flags, 134217728 /* Flag.withinTopLevelAwait */, value);
|
|
12936
12979
|
}
|
|
12937
12980
|
// Do not bind attributes
|
|
12938
12981
|
bind() {
|
|
@@ -12943,8 +12986,7 @@ class ImportExpression extends NodeBase {
|
|
|
12943
12986
|
*
|
|
12944
12987
|
* 1. `const { foo } = await import('bar')`.
|
|
12945
12988
|
* 2. `(await import('bar')).foo`
|
|
12946
|
-
* 3. `import('bar').then((
|
|
12947
|
-
* 4. `import('bar').then(({ foo }) => {})`
|
|
12989
|
+
* 3. `import('bar').then(({ foo }) => {})`
|
|
12948
12990
|
*
|
|
12949
12991
|
* Returns empty array if it's side-effect only import.
|
|
12950
12992
|
* Returns undefined if it's not fully deterministic.
|
|
@@ -13008,30 +13050,11 @@ class ImportExpression extends NodeBase {
|
|
|
13008
13050
|
if (thenCallback.params.length === 0) {
|
|
13009
13051
|
return EMPTY_ARRAY;
|
|
13010
13052
|
}
|
|
13011
|
-
|
|
13012
|
-
|
|
13013
|
-
|
|
13014
|
-
// Case 3: import('bar').then(m => m.foo)
|
|
13015
|
-
if (declaration instanceof Identifier) {
|
|
13016
|
-
const starName = declaration.name;
|
|
13017
|
-
const memberExpression = thenCallback.body;
|
|
13018
|
-
if (!(memberExpression instanceof MemberExpression) ||
|
|
13019
|
-
memberExpression.computed ||
|
|
13020
|
-
!(memberExpression.property instanceof Identifier)) {
|
|
13021
|
-
return;
|
|
13022
|
-
}
|
|
13023
|
-
const returnVariable = memberExpression.object;
|
|
13024
|
-
if (!(returnVariable instanceof Identifier) || returnVariable.name !== starName) {
|
|
13025
|
-
return;
|
|
13026
|
-
}
|
|
13027
|
-
return [memberExpression.property.name];
|
|
13028
|
-
}
|
|
13029
|
-
// Case 4: import('bar').then(({ foo }) => {})
|
|
13030
|
-
if (declaration instanceof ObjectPattern) {
|
|
13031
|
-
return getDeterministicObjectDestructure(declaration);
|
|
13032
|
-
}
|
|
13053
|
+
const declaration = thenCallback.params[0];
|
|
13054
|
+
if (thenCallback.params.length === 1 && declaration instanceof ObjectPattern) {
|
|
13055
|
+
return getDeterministicObjectDestructure(declaration);
|
|
13033
13056
|
}
|
|
13034
|
-
return;
|
|
13057
|
+
return this.hasUnknownAccessedKey ? undefined : [...this.accessedPropKey];
|
|
13035
13058
|
}
|
|
13036
13059
|
}
|
|
13037
13060
|
hasEffects() {
|
|
@@ -13039,18 +13062,17 @@ class ImportExpression extends NodeBase {
|
|
|
13039
13062
|
}
|
|
13040
13063
|
include(context, includeChildrenRecursively) {
|
|
13041
13064
|
if (!this.included)
|
|
13042
|
-
this.includeNode(
|
|
13065
|
+
this.includeNode();
|
|
13043
13066
|
this.source.include(context, includeChildrenRecursively);
|
|
13044
13067
|
}
|
|
13045
|
-
includeNode(
|
|
13068
|
+
includeNode() {
|
|
13046
13069
|
this.included = true;
|
|
13047
|
-
this.withinTopLevelAwait = context.withinTopLevelAwait;
|
|
13048
13070
|
this.scope.context.includeDynamicImport(this);
|
|
13049
13071
|
this.scope.addAccessedDynamicImport(this);
|
|
13050
13072
|
}
|
|
13051
|
-
includePath(path
|
|
13073
|
+
includePath(path) {
|
|
13052
13074
|
if (!this.included)
|
|
13053
|
-
this.includeNode(
|
|
13075
|
+
this.includeNode();
|
|
13054
13076
|
// Technically, this is not correct as dynamic imports return a Promise.
|
|
13055
13077
|
if (this.hasUnknownAccessedKey)
|
|
13056
13078
|
return;
|
|
@@ -13066,6 +13088,22 @@ class ImportExpression extends NodeBase {
|
|
|
13066
13088
|
initialise() {
|
|
13067
13089
|
super.initialise();
|
|
13068
13090
|
this.scope.context.addDynamicImport(this);
|
|
13091
|
+
let parent = this.parent;
|
|
13092
|
+
let withinAwaitExpression = false;
|
|
13093
|
+
let withinTopLevelAwait = false;
|
|
13094
|
+
do {
|
|
13095
|
+
if (withinAwaitExpression &&
|
|
13096
|
+
(parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression)) {
|
|
13097
|
+
withinTopLevelAwait = false;
|
|
13098
|
+
}
|
|
13099
|
+
if (parent instanceof AwaitExpression) {
|
|
13100
|
+
withinAwaitExpression = true;
|
|
13101
|
+
withinTopLevelAwait = true;
|
|
13102
|
+
}
|
|
13103
|
+
} while ((parent = parent.parent));
|
|
13104
|
+
if (withinAwaitExpression && withinTopLevelAwait) {
|
|
13105
|
+
this.withinTopLevelAwait = true;
|
|
13106
|
+
}
|
|
13069
13107
|
}
|
|
13070
13108
|
parseNode(esTreeNode) {
|
|
13071
13109
|
this.sourceAstNode = esTreeNode.source;
|
|
@@ -14696,10 +14734,10 @@ SwitchStatement.prototype.applyDeoptimizations = doNotDeoptimize;
|
|
|
14696
14734
|
|
|
14697
14735
|
class TaggedTemplateExpression extends CallExpressionBase {
|
|
14698
14736
|
get hasCheckedForWarnings() {
|
|
14699
|
-
return isFlagSet(this.flags,
|
|
14737
|
+
return isFlagSet(this.flags, 268435456 /* Flag.checkedForWarnings */);
|
|
14700
14738
|
}
|
|
14701
14739
|
set hasCheckedForWarnings(value) {
|
|
14702
|
-
this.flags = setFlag(this.flags,
|
|
14740
|
+
this.flags = setFlag(this.flags, 268435456 /* Flag.checkedForWarnings */, value);
|
|
14703
14741
|
}
|
|
14704
14742
|
bind() {
|
|
14705
14743
|
super.bind();
|
|
@@ -19770,24 +19808,32 @@ function analyseModuleExecution(entryModules) {
|
|
|
19770
19808
|
const dynamicImports = new Set();
|
|
19771
19809
|
const parents = new Map();
|
|
19772
19810
|
const orderedModules = [];
|
|
19811
|
+
const handleSyncLoadedModule = (module, parent) => {
|
|
19812
|
+
if (parents.has(module)) {
|
|
19813
|
+
if (!analysedModules.has(module)) {
|
|
19814
|
+
cyclePaths.push(getCyclePath(module, parent, parents));
|
|
19815
|
+
}
|
|
19816
|
+
return;
|
|
19817
|
+
}
|
|
19818
|
+
parents.set(module, parent);
|
|
19819
|
+
analyseModule(module);
|
|
19820
|
+
};
|
|
19773
19821
|
const analyseModule = (module) => {
|
|
19774
19822
|
if (module instanceof Module) {
|
|
19775
19823
|
for (const dependency of module.dependencies) {
|
|
19776
|
-
|
|
19777
|
-
if (!analysedModules.has(dependency)) {
|
|
19778
|
-
cyclePaths.push(getCyclePath(dependency, module, parents));
|
|
19779
|
-
}
|
|
19780
|
-
continue;
|
|
19781
|
-
}
|
|
19782
|
-
parents.set(dependency, module);
|
|
19783
|
-
analyseModule(dependency);
|
|
19824
|
+
handleSyncLoadedModule(dependency, module);
|
|
19784
19825
|
}
|
|
19785
19826
|
for (const dependency of module.implicitlyLoadedBefore) {
|
|
19786
19827
|
dynamicImports.add(dependency);
|
|
19787
19828
|
}
|
|
19788
|
-
for (const { resolution } of module.dynamicImports) {
|
|
19829
|
+
for (const { resolution, node } of module.dynamicImports) {
|
|
19789
19830
|
if (resolution instanceof Module) {
|
|
19790
|
-
|
|
19831
|
+
if (node.withinTopLevelAwait) {
|
|
19832
|
+
handleSyncLoadedModule(resolution, module);
|
|
19833
|
+
}
|
|
19834
|
+
else {
|
|
19835
|
+
dynamicImports.add(resolution);
|
|
19836
|
+
}
|
|
19791
19837
|
}
|
|
19792
19838
|
}
|
|
19793
19839
|
orderedModules.push(module);
|
|
@@ -23635,12 +23681,41 @@ function watch(configs) {
|
|
|
23635
23681
|
});
|
|
23636
23682
|
return emitter;
|
|
23637
23683
|
}
|
|
23684
|
+
function withTrailingSlash(path) {
|
|
23685
|
+
if (path[path.length - 1] !== '/') {
|
|
23686
|
+
return `${path}/`;
|
|
23687
|
+
}
|
|
23688
|
+
return path;
|
|
23689
|
+
}
|
|
23690
|
+
function checkWatchConfig(config) {
|
|
23691
|
+
for (const item of config) {
|
|
23692
|
+
if (item.input && item.output) {
|
|
23693
|
+
const input = typeof item.input === 'string' ? ensureArray(item.input) : item.input;
|
|
23694
|
+
const output = ensureArray(item.output);
|
|
23695
|
+
for (const index in input) {
|
|
23696
|
+
const inputPath = input[index];
|
|
23697
|
+
const subPath = output.find(o => {
|
|
23698
|
+
if (!o.dir || typeof inputPath !== 'string') {
|
|
23699
|
+
return false;
|
|
23700
|
+
}
|
|
23701
|
+
const _outPath = withTrailingSlash(o.dir);
|
|
23702
|
+
const _inputPath = withTrailingSlash(inputPath);
|
|
23703
|
+
return _inputPath.startsWith(_outPath);
|
|
23704
|
+
});
|
|
23705
|
+
if (subPath) {
|
|
23706
|
+
error(logInvalidOption('watch', URL_WATCH, `the input "${inputPath}" is a subpath of the output "${subPath.dir}"`));
|
|
23707
|
+
}
|
|
23708
|
+
}
|
|
23709
|
+
}
|
|
23710
|
+
}
|
|
23711
|
+
}
|
|
23638
23712
|
async function watchInternal(configs, emitter) {
|
|
23639
23713
|
const optionsList = await Promise.all(ensureArray(configs).map(config => mergeOptions(config, true)));
|
|
23640
23714
|
const watchOptionsList = optionsList.filter(config => config.watch !== false);
|
|
23641
23715
|
if (watchOptionsList.length === 0) {
|
|
23642
23716
|
return error(logInvalidOption('watch', URL_WATCH, 'there must be at least one config where "watch" is not set to "false"'));
|
|
23643
23717
|
}
|
|
23718
|
+
checkWatchConfig(watchOptionsList);
|
|
23644
23719
|
await loadFsEvents();
|
|
23645
23720
|
const { Watcher } = await import('./watch.js');
|
|
23646
23721
|
new Watcher(watchOptionsList, emitter);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.41.0
|
|
4
|
+
Sun, 18 May 2025 05:33:01 GMT - commit 0928185cd544907dab472754634ddf988452aae6
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -13,13 +13,16 @@ import { resolve, dirname, basename, extname } from 'node:path';
|
|
|
13
13
|
// This file is generated by scripts/generate-node-types.js.
|
|
14
14
|
// Do not edit this file directly.
|
|
15
15
|
const ArrowFunctionExpression = 'ArrowFunctionExpression';
|
|
16
|
+
const AwaitExpression = 'AwaitExpression';
|
|
16
17
|
const BlockStatement = 'BlockStatement';
|
|
17
18
|
const CallExpression = 'CallExpression';
|
|
18
19
|
const CatchClause = 'CatchClause';
|
|
19
20
|
const ExportDefaultDeclaration = 'ExportDefaultDeclaration';
|
|
20
21
|
const ExpressionStatement = 'ExpressionStatement';
|
|
21
22
|
const Identifier = 'Identifier';
|
|
23
|
+
const ImportExpression = 'ImportExpression';
|
|
22
24
|
const Literal = 'Literal';
|
|
25
|
+
const MemberExpression = 'MemberExpression';
|
|
23
26
|
const ObjectExpression = 'ObjectExpression';
|
|
24
27
|
const PanicError = 'PanicError';
|
|
25
28
|
const ParseError = 'ParseError';
|
|
@@ -2070,4 +2073,4 @@ function getAstBuffer(astBuffer) {
|
|
|
2070
2073
|
const parseAst = (input, { allowReturnOutsideFunction = false, jsx = false } = {}) => convertProgram(getAstBuffer(parse(input, allowReturnOutsideFunction, jsx)));
|
|
2071
2074
|
const parseAstAsync = async (input, { allowReturnOutsideFunction = false, jsx = false, signal } = {}) => convertProgram(getAstBuffer(await parseAsync(input, allowReturnOutsideFunction, jsx, signal)));
|
|
2072
2075
|
|
|
2073
|
-
export { ANNOTATION_KEY, ArrowFunctionExpression, BLANK, BlockStatement, CallExpression, CatchClause, EMPTY_ARRAY, EMPTY_OBJECT, EMPTY_SET, ExportDefaultDeclaration, ExpressionStatement, FIXED_STRINGS, INVALID_ANNOTATION_KEY, Identifier, LOGLEVEL_DEBUG, LOGLEVEL_ERROR, LOGLEVEL_INFO, LOGLEVEL_WARN, Literal, 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, 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 };
|
|
2076
|
+
export { ANNOTATION_KEY, ArrowFunctionExpression, AwaitExpression, BLANK, BlockStatement, CallExpression, CatchClause, EMPTY_ARRAY, EMPTY_OBJECT, EMPTY_SET, ExportDefaultDeclaration, ExpressionStatement, FIXED_STRINGS, INVALID_ANNOTATION_KEY, Identifier, ImportExpression, 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, 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.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.41.0
|
|
4
|
+
Sun, 18 May 2025 05:33:01 GMT - commit 0928185cd544907dab472754634ddf988452aae6
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -81,12 +81,41 @@ function watch(configs) {
|
|
|
81
81
|
});
|
|
82
82
|
return emitter;
|
|
83
83
|
}
|
|
84
|
+
function withTrailingSlash(path) {
|
|
85
|
+
if (path[path.length - 1] !== '/') {
|
|
86
|
+
return `${path}/`;
|
|
87
|
+
}
|
|
88
|
+
return path;
|
|
89
|
+
}
|
|
90
|
+
function checkWatchConfig(config) {
|
|
91
|
+
for (const item of config) {
|
|
92
|
+
if (item.input && item.output) {
|
|
93
|
+
const input = typeof item.input === 'string' ? rollup.ensureArray(item.input) : item.input;
|
|
94
|
+
const output = rollup.ensureArray(item.output);
|
|
95
|
+
for (const index in input) {
|
|
96
|
+
const inputPath = input[index];
|
|
97
|
+
const subPath = output.find(o => {
|
|
98
|
+
if (!o.dir || typeof inputPath !== 'string') {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
const _outPath = withTrailingSlash(o.dir);
|
|
102
|
+
const _inputPath = withTrailingSlash(inputPath);
|
|
103
|
+
return _inputPath.startsWith(_outPath);
|
|
104
|
+
});
|
|
105
|
+
if (subPath) {
|
|
106
|
+
parseAst_js.error(parseAst_js.logInvalidOption('watch', parseAst_js.URL_WATCH, `the input "${inputPath}" is a subpath of the output "${subPath.dir}"`));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
84
112
|
async function watchInternal(configs, emitter) {
|
|
85
113
|
const optionsList = await Promise.all(rollup.ensureArray(configs).map(config => rollup.mergeOptions(config, true)));
|
|
86
114
|
const watchOptionsList = optionsList.filter(config => config.watch !== false);
|
|
87
115
|
if (watchOptionsList.length === 0) {
|
|
88
116
|
return parseAst_js.error(parseAst_js.logInvalidOption('watch', parseAst_js.URL_WATCH, 'there must be at least one config where "watch" is not set to "false"'));
|
|
89
117
|
}
|
|
118
|
+
checkWatchConfig(watchOptionsList);
|
|
90
119
|
await fseventsImporter.loadFsEvents();
|
|
91
120
|
const { Watcher } = await Promise.resolve().then(() => require('./shared/watch.js'));
|
|
92
121
|
new Watcher(watchOptionsList, emitter);
|
package/dist/shared/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.41.0
|
|
4
|
+
Sun, 18 May 2025 05:33:01 GMT - commit 0928185cd544907dab472754634ddf988452aae6
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -457,7 +457,8 @@ async function getConfigFileExport(fileName, commandOptions, watchMode) {
|
|
|
457
457
|
}
|
|
458
458
|
let cannotLoadEsm = false;
|
|
459
459
|
const handleWarning = (warning) => {
|
|
460
|
-
if (warning.message
|
|
460
|
+
if (warning.message?.includes('To load an ES module') ||
|
|
461
|
+
warning.message?.includes('Failed to load the ES module')) {
|
|
461
462
|
cannotLoadEsm = true;
|
|
462
463
|
}
|
|
463
464
|
};
|
package/dist/shared/parseAst.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.41.0
|
|
4
|
+
Sun, 18 May 2025 05:33:01 GMT - commit 0928185cd544907dab472754634ddf988452aae6
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -1031,13 +1031,16 @@ const EMPTY_SET = Object.freeze(new (class extends Set {
|
|
|
1031
1031
|
// This file is generated by scripts/generate-node-types.js.
|
|
1032
1032
|
// Do not edit this file directly.
|
|
1033
1033
|
const ArrowFunctionExpression = 'ArrowFunctionExpression';
|
|
1034
|
+
const AwaitExpression = 'AwaitExpression';
|
|
1034
1035
|
const BlockStatement = 'BlockStatement';
|
|
1035
1036
|
const CallExpression = 'CallExpression';
|
|
1036
1037
|
const CatchClause = 'CatchClause';
|
|
1037
1038
|
const ExportDefaultDeclaration = 'ExportDefaultDeclaration';
|
|
1038
1039
|
const ExpressionStatement = 'ExpressionStatement';
|
|
1039
1040
|
const Identifier = 'Identifier';
|
|
1041
|
+
const ImportExpression = 'ImportExpression';
|
|
1040
1042
|
const Literal = 'Literal';
|
|
1043
|
+
const MemberExpression = 'MemberExpression';
|
|
1041
1044
|
const ObjectExpression = 'ObjectExpression';
|
|
1042
1045
|
const PanicError = 'PanicError';
|
|
1043
1046
|
const ParseError = 'ParseError';
|
|
@@ -2135,6 +2138,7 @@ const parseAstAsync = async (input, { allowReturnOutsideFunction = false, jsx =
|
|
|
2135
2138
|
|
|
2136
2139
|
exports.ANNOTATION_KEY = ANNOTATION_KEY;
|
|
2137
2140
|
exports.ArrowFunctionExpression = ArrowFunctionExpression;
|
|
2141
|
+
exports.AwaitExpression = AwaitExpression;
|
|
2138
2142
|
exports.BLANK = BLANK;
|
|
2139
2143
|
exports.BlockStatement = BlockStatement;
|
|
2140
2144
|
exports.CallExpression = CallExpression;
|
|
@@ -2147,11 +2151,13 @@ exports.ExpressionStatement = ExpressionStatement;
|
|
|
2147
2151
|
exports.FIXED_STRINGS = FIXED_STRINGS;
|
|
2148
2152
|
exports.INVALID_ANNOTATION_KEY = INVALID_ANNOTATION_KEY;
|
|
2149
2153
|
exports.Identifier = Identifier;
|
|
2154
|
+
exports.ImportExpression = ImportExpression;
|
|
2150
2155
|
exports.LOGLEVEL_DEBUG = LOGLEVEL_DEBUG;
|
|
2151
2156
|
exports.LOGLEVEL_ERROR = LOGLEVEL_ERROR;
|
|
2152
2157
|
exports.LOGLEVEL_INFO = LOGLEVEL_INFO;
|
|
2153
2158
|
exports.LOGLEVEL_WARN = LOGLEVEL_WARN;
|
|
2154
2159
|
exports.Literal = Literal;
|
|
2160
|
+
exports.MemberExpression = MemberExpression;
|
|
2155
2161
|
exports.ObjectExpression = ObjectExpression;
|
|
2156
2162
|
exports.Program = Program;
|
|
2157
2163
|
exports.Property = Property;
|
package/dist/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.41.0
|
|
4
|
+
Sun, 18 May 2025 05:33:01 GMT - commit 0928185cd544907dab472754634ddf988452aae6
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -17,7 +17,7 @@ const native_js = require('../native.js');
|
|
|
17
17
|
const node_perf_hooks = require('node:perf_hooks');
|
|
18
18
|
const promises = require('node:fs/promises');
|
|
19
19
|
|
|
20
|
-
var version = "4.
|
|
20
|
+
var version = "4.41.0";
|
|
21
21
|
|
|
22
22
|
function ensureArray$1(items) {
|
|
23
23
|
if (Array.isArray(items)) {
|
|
@@ -5962,8 +5962,7 @@ function createInclusionContext() {
|
|
|
5962
5962
|
hasBreak: false,
|
|
5963
5963
|
hasContinue: false,
|
|
5964
5964
|
includedCallArguments: new Set(),
|
|
5965
|
-
includedLabels: new Set()
|
|
5966
|
-
withinTopLevelAwait: false
|
|
5965
|
+
includedLabels: new Set()
|
|
5967
5966
|
};
|
|
5968
5967
|
}
|
|
5969
5968
|
function createHasEffectsContext() {
|
|
@@ -6058,10 +6057,13 @@ const deoptimizeInteraction = (interaction) => {
|
|
|
6058
6057
|
argument?.deoptimizePath(UNKNOWN_PATH);
|
|
6059
6058
|
}
|
|
6060
6059
|
};
|
|
6061
|
-
const includeInteraction = (
|
|
6060
|
+
const includeInteraction = (interaction, context) => {
|
|
6062
6061
|
// We do not re-include the "this" argument as we expect this is already
|
|
6063
6062
|
// re-included at the call site
|
|
6064
|
-
args[0]?.includePath(UNKNOWN_PATH, context);
|
|
6063
|
+
interaction.args[0]?.includePath(UNKNOWN_PATH, context);
|
|
6064
|
+
includeInteractionWithoutThis(interaction, context);
|
|
6065
|
+
};
|
|
6066
|
+
const includeInteractionWithoutThis = ({ args }, context) => {
|
|
6065
6067
|
for (let argumentIndex = 1; argumentIndex < args.length; argumentIndex++) {
|
|
6066
6068
|
const argument = args[argumentIndex];
|
|
6067
6069
|
if (argument) {
|
|
@@ -6736,7 +6738,25 @@ function isObjectExpressionNode(node) {
|
|
|
6736
6738
|
return node instanceof NodeBase && node.type === parseAst_js.ObjectExpression;
|
|
6737
6739
|
}
|
|
6738
6740
|
function isPropertyNode(node) {
|
|
6739
|
-
return node.type === parseAst_js.Property;
|
|
6741
|
+
return node instanceof NodeBase && node.type === parseAst_js.Property;
|
|
6742
|
+
}
|
|
6743
|
+
function isArrowFunctionExpressionNode(node) {
|
|
6744
|
+
return node instanceof NodeBase && node.type === parseAst_js.ArrowFunctionExpression;
|
|
6745
|
+
}
|
|
6746
|
+
function isCallExpressionNode(node) {
|
|
6747
|
+
return node instanceof NodeBase && node.type === parseAst_js.CallExpression;
|
|
6748
|
+
}
|
|
6749
|
+
function isMemberExpressionNode(node) {
|
|
6750
|
+
return node instanceof NodeBase && node.type === parseAst_js.MemberExpression;
|
|
6751
|
+
}
|
|
6752
|
+
function isImportExpressionNode(node) {
|
|
6753
|
+
return node instanceof NodeBase && node.type === parseAst_js.ImportExpression;
|
|
6754
|
+
}
|
|
6755
|
+
function isAwaitExpressionNode(node) {
|
|
6756
|
+
return node instanceof NodeBase && node.type === parseAst_js.AwaitExpression;
|
|
6757
|
+
}
|
|
6758
|
+
function isIdentifierNode(node) {
|
|
6759
|
+
return node instanceof NodeBase && node.type === parseAst_js.Identifier;
|
|
6740
6760
|
}
|
|
6741
6761
|
|
|
6742
6762
|
function assembleMemberDescriptions(memberDescriptions, inheritedDescriptions = null) {
|
|
@@ -8871,6 +8891,20 @@ class LocalVariable extends Variable {
|
|
|
8871
8891
|
break;
|
|
8872
8892
|
node = node.parent;
|
|
8873
8893
|
}
|
|
8894
|
+
/**
|
|
8895
|
+
* import('foo').then(m => {
|
|
8896
|
+
* console.log(m.foo)
|
|
8897
|
+
* })
|
|
8898
|
+
*/
|
|
8899
|
+
if (this.kind === 'parameter' &&
|
|
8900
|
+
isArrowFunctionExpressionNode(declaration.parent) &&
|
|
8901
|
+
isCallExpressionNode(declaration.parent.parent) &&
|
|
8902
|
+
isMemberExpressionNode(declaration.parent.parent.callee) &&
|
|
8903
|
+
isIdentifierNode(declaration.parent.parent.callee.property) &&
|
|
8904
|
+
declaration.parent.parent.callee.property.name === 'then' &&
|
|
8905
|
+
isImportExpressionNode(declaration.parent.parent.callee.object)) {
|
|
8906
|
+
declaration.parent.parent.callee.object.includePath(path);
|
|
8907
|
+
}
|
|
8874
8908
|
}
|
|
8875
8909
|
// We need to make sure we include the correct path of the init
|
|
8876
8910
|
if (path.length > 0) {
|
|
@@ -11249,7 +11283,21 @@ class MemberExpression extends NodeBase {
|
|
|
11249
11283
|
this.variable.includeCallArguments(interaction, context);
|
|
11250
11284
|
}
|
|
11251
11285
|
else {
|
|
11252
|
-
|
|
11286
|
+
if (isImportExpressionNode(this.object) ||
|
|
11287
|
+
/**
|
|
11288
|
+
* const c = await import('foo')
|
|
11289
|
+
* c.foo();
|
|
11290
|
+
*/
|
|
11291
|
+
(this.object.variable &&
|
|
11292
|
+
!this.object.variable.isReassigned &&
|
|
11293
|
+
this.object.variable instanceof LocalVariable &&
|
|
11294
|
+
isAwaitExpressionNode(this.object.variable.init) &&
|
|
11295
|
+
isImportExpressionNode(this.object.variable.init.argument))) {
|
|
11296
|
+
includeInteractionWithoutThis(interaction, context);
|
|
11297
|
+
}
|
|
11298
|
+
else {
|
|
11299
|
+
includeInteraction(interaction, context);
|
|
11300
|
+
}
|
|
11253
11301
|
}
|
|
11254
11302
|
}
|
|
11255
11303
|
includeDestructuredIfNecessary(context, destructuredInitPath, init) {
|
|
@@ -12180,7 +12228,7 @@ function amd(magicString, { accessedGlobals, dependencies, exports, hasDefaultEx
|
|
|
12180
12228
|
const deps = dependencies.map(m => `'${updateExtensionForRelativeAmdId(m.importPath, amd.forceJsExtensionForImports)}'`);
|
|
12181
12229
|
const parameters = dependencies.map(m => m.name);
|
|
12182
12230
|
const { n, getNonArrowFunctionIntro, _ } = snippets;
|
|
12183
|
-
if (
|
|
12231
|
+
if (hasExports && (namedExportsMode || exports[0]?.local === 'exports.default')) {
|
|
12184
12232
|
parameters.unshift(`exports`);
|
|
12185
12233
|
deps.unshift(`'exports'`);
|
|
12186
12234
|
}
|
|
@@ -12439,7 +12487,7 @@ function iife(magicString, { accessedGlobals, dependencies, exports, hasDefaultE
|
|
|
12439
12487
|
if (hasExports && !name) {
|
|
12440
12488
|
log(parseAst_js.LOGLEVEL_WARN, parseAst_js.logMissingNameOptionForIifeExport());
|
|
12441
12489
|
}
|
|
12442
|
-
if (
|
|
12490
|
+
if (hasExports && (namedExportsMode || exports[0]?.local === 'exports.default')) {
|
|
12443
12491
|
if (extend) {
|
|
12444
12492
|
deps.unshift(`this${keypath(name, getPropertyAccess)}${_}=${_}this${keypath(name, getPropertyAccess)}${_}||${_}{}`);
|
|
12445
12493
|
parameters.unshift('exports');
|
|
@@ -12658,7 +12706,8 @@ function umd(magicString, { accessedGlobals, dependencies, exports, hasDefaultEx
|
|
|
12658
12706
|
const trimmedImports = trimEmptyImports(dependencies);
|
|
12659
12707
|
const globalDeps = trimmedImports.map(module => globalProperty(module.globalName, globalVariable, getPropertyAccess));
|
|
12660
12708
|
const factoryParameters = trimmedImports.map(m => m.name);
|
|
12661
|
-
if (
|
|
12709
|
+
if ((hasExports || noConflict) &&
|
|
12710
|
+
(namedExportsMode || (hasExports && exports[0]?.local === 'exports.default'))) {
|
|
12662
12711
|
amdDeps.unshift(`'exports'`);
|
|
12663
12712
|
cjsDeps.unshift(`exports`);
|
|
12664
12713
|
globalDeps.unshift(assignToDeepVariable(name, globalVariable, globals, `${extend ? `${globalProperty(name, globalVariable, getPropertyAccess)}${_}||${_}` : ''}{}`, snippets, log));
|
|
@@ -13252,44 +13301,38 @@ class AssignmentPattern extends NodeBase {
|
|
|
13252
13301
|
}
|
|
13253
13302
|
|
|
13254
13303
|
class AwaitExpression extends NodeBase {
|
|
13255
|
-
get isTopLevelAwait() {
|
|
13256
|
-
return isFlagSet(this.flags, 134217728 /* Flag.isTopLevelAwait */);
|
|
13257
|
-
}
|
|
13258
|
-
set isTopLevelAwait(value) {
|
|
13259
|
-
this.flags = setFlag(this.flags, 134217728 /* Flag.isTopLevelAwait */, value);
|
|
13260
|
-
}
|
|
13261
13304
|
hasEffects() {
|
|
13262
13305
|
if (!this.deoptimized)
|
|
13263
13306
|
this.applyDeoptimizations();
|
|
13264
13307
|
return true;
|
|
13265
13308
|
}
|
|
13309
|
+
initialise() {
|
|
13310
|
+
super.initialise();
|
|
13311
|
+
let parent = this.parent;
|
|
13312
|
+
do {
|
|
13313
|
+
if (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression)
|
|
13314
|
+
return;
|
|
13315
|
+
} while ((parent = parent.parent));
|
|
13316
|
+
this.scope.context.usesTopLevelAwait = true;
|
|
13317
|
+
}
|
|
13266
13318
|
include(context, includeChildrenRecursively) {
|
|
13267
13319
|
if (!this.included)
|
|
13268
13320
|
this.includeNode(context);
|
|
13269
|
-
this.argument.include(
|
|
13321
|
+
this.argument.include(context, includeChildrenRecursively);
|
|
13270
13322
|
}
|
|
13271
13323
|
includeNode(context) {
|
|
13272
13324
|
this.included = true;
|
|
13273
13325
|
if (!this.deoptimized)
|
|
13274
13326
|
this.applyDeoptimizations();
|
|
13275
|
-
checkTopLevelAwait: {
|
|
13276
|
-
let parent = this.parent;
|
|
13277
|
-
do {
|
|
13278
|
-
if (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression)
|
|
13279
|
-
break checkTopLevelAwait;
|
|
13280
|
-
} while ((parent = parent.parent));
|
|
13281
|
-
this.scope.context.usesTopLevelAwait = true;
|
|
13282
|
-
this.isTopLevelAwait = true;
|
|
13283
|
-
}
|
|
13284
13327
|
// Thenables need to be included
|
|
13285
|
-
this.argument.includePath(THEN_PATH,
|
|
13328
|
+
this.argument.includePath(THEN_PATH, context);
|
|
13286
13329
|
}
|
|
13287
13330
|
includePath(path, context) {
|
|
13288
13331
|
if (!this.deoptimized)
|
|
13289
13332
|
this.applyDeoptimizations();
|
|
13290
13333
|
if (!this.included)
|
|
13291
13334
|
this.includeNode(context);
|
|
13292
|
-
this.argument.includePath(path,
|
|
13335
|
+
this.argument.includePath(path, context);
|
|
13293
13336
|
}
|
|
13294
13337
|
}
|
|
13295
13338
|
const THEN_PATH = ['then'];
|
|
@@ -13514,10 +13557,10 @@ class CallExpressionBase extends NodeBase {
|
|
|
13514
13557
|
|
|
13515
13558
|
class CallExpression extends CallExpressionBase {
|
|
13516
13559
|
get hasCheckedForWarnings() {
|
|
13517
|
-
return isFlagSet(this.flags,
|
|
13560
|
+
return isFlagSet(this.flags, 268435456 /* Flag.checkedForWarnings */);
|
|
13518
13561
|
}
|
|
13519
13562
|
set hasCheckedForWarnings(value) {
|
|
13520
|
-
this.flags = setFlag(this.flags,
|
|
13563
|
+
this.flags = setFlag(this.flags, 268435456 /* Flag.checkedForWarnings */, value);
|
|
13521
13564
|
}
|
|
13522
13565
|
get optional() {
|
|
13523
13566
|
return isFlagSet(this.flags, 128 /* Flag.optional */);
|
|
@@ -14523,10 +14566,10 @@ class ImportExpression extends NodeBase {
|
|
|
14523
14566
|
this.resolutionString = null;
|
|
14524
14567
|
}
|
|
14525
14568
|
get withinTopLevelAwait() {
|
|
14526
|
-
return isFlagSet(this.flags,
|
|
14569
|
+
return isFlagSet(this.flags, 134217728 /* Flag.withinTopLevelAwait */);
|
|
14527
14570
|
}
|
|
14528
14571
|
set withinTopLevelAwait(value) {
|
|
14529
|
-
this.flags = setFlag(this.flags,
|
|
14572
|
+
this.flags = setFlag(this.flags, 134217728 /* Flag.withinTopLevelAwait */, value);
|
|
14530
14573
|
}
|
|
14531
14574
|
// Do not bind attributes
|
|
14532
14575
|
bind() {
|
|
@@ -14537,8 +14580,7 @@ class ImportExpression extends NodeBase {
|
|
|
14537
14580
|
*
|
|
14538
14581
|
* 1. `const { foo } = await import('bar')`.
|
|
14539
14582
|
* 2. `(await import('bar')).foo`
|
|
14540
|
-
* 3. `import('bar').then((
|
|
14541
|
-
* 4. `import('bar').then(({ foo }) => {})`
|
|
14583
|
+
* 3. `import('bar').then(({ foo }) => {})`
|
|
14542
14584
|
*
|
|
14543
14585
|
* Returns empty array if it's side-effect only import.
|
|
14544
14586
|
* Returns undefined if it's not fully deterministic.
|
|
@@ -14602,30 +14644,11 @@ class ImportExpression extends NodeBase {
|
|
|
14602
14644
|
if (thenCallback.params.length === 0) {
|
|
14603
14645
|
return parseAst_js.EMPTY_ARRAY;
|
|
14604
14646
|
}
|
|
14605
|
-
|
|
14606
|
-
|
|
14607
|
-
|
|
14608
|
-
// Case 3: import('bar').then(m => m.foo)
|
|
14609
|
-
if (declaration instanceof Identifier) {
|
|
14610
|
-
const starName = declaration.name;
|
|
14611
|
-
const memberExpression = thenCallback.body;
|
|
14612
|
-
if (!(memberExpression instanceof MemberExpression) ||
|
|
14613
|
-
memberExpression.computed ||
|
|
14614
|
-
!(memberExpression.property instanceof Identifier)) {
|
|
14615
|
-
return;
|
|
14616
|
-
}
|
|
14617
|
-
const returnVariable = memberExpression.object;
|
|
14618
|
-
if (!(returnVariable instanceof Identifier) || returnVariable.name !== starName) {
|
|
14619
|
-
return;
|
|
14620
|
-
}
|
|
14621
|
-
return [memberExpression.property.name];
|
|
14622
|
-
}
|
|
14623
|
-
// Case 4: import('bar').then(({ foo }) => {})
|
|
14624
|
-
if (declaration instanceof ObjectPattern) {
|
|
14625
|
-
return getDeterministicObjectDestructure(declaration);
|
|
14626
|
-
}
|
|
14647
|
+
const declaration = thenCallback.params[0];
|
|
14648
|
+
if (thenCallback.params.length === 1 && declaration instanceof ObjectPattern) {
|
|
14649
|
+
return getDeterministicObjectDestructure(declaration);
|
|
14627
14650
|
}
|
|
14628
|
-
return;
|
|
14651
|
+
return this.hasUnknownAccessedKey ? undefined : [...this.accessedPropKey];
|
|
14629
14652
|
}
|
|
14630
14653
|
}
|
|
14631
14654
|
hasEffects() {
|
|
@@ -14633,18 +14656,17 @@ class ImportExpression extends NodeBase {
|
|
|
14633
14656
|
}
|
|
14634
14657
|
include(context, includeChildrenRecursively) {
|
|
14635
14658
|
if (!this.included)
|
|
14636
|
-
this.includeNode(
|
|
14659
|
+
this.includeNode();
|
|
14637
14660
|
this.source.include(context, includeChildrenRecursively);
|
|
14638
14661
|
}
|
|
14639
|
-
includeNode(
|
|
14662
|
+
includeNode() {
|
|
14640
14663
|
this.included = true;
|
|
14641
|
-
this.withinTopLevelAwait = context.withinTopLevelAwait;
|
|
14642
14664
|
this.scope.context.includeDynamicImport(this);
|
|
14643
14665
|
this.scope.addAccessedDynamicImport(this);
|
|
14644
14666
|
}
|
|
14645
|
-
includePath(path
|
|
14667
|
+
includePath(path) {
|
|
14646
14668
|
if (!this.included)
|
|
14647
|
-
this.includeNode(
|
|
14669
|
+
this.includeNode();
|
|
14648
14670
|
// Technically, this is not correct as dynamic imports return a Promise.
|
|
14649
14671
|
if (this.hasUnknownAccessedKey)
|
|
14650
14672
|
return;
|
|
@@ -14660,6 +14682,22 @@ class ImportExpression extends NodeBase {
|
|
|
14660
14682
|
initialise() {
|
|
14661
14683
|
super.initialise();
|
|
14662
14684
|
this.scope.context.addDynamicImport(this);
|
|
14685
|
+
let parent = this.parent;
|
|
14686
|
+
let withinAwaitExpression = false;
|
|
14687
|
+
let withinTopLevelAwait = false;
|
|
14688
|
+
do {
|
|
14689
|
+
if (withinAwaitExpression &&
|
|
14690
|
+
(parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression)) {
|
|
14691
|
+
withinTopLevelAwait = false;
|
|
14692
|
+
}
|
|
14693
|
+
if (parent instanceof AwaitExpression) {
|
|
14694
|
+
withinAwaitExpression = true;
|
|
14695
|
+
withinTopLevelAwait = true;
|
|
14696
|
+
}
|
|
14697
|
+
} while ((parent = parent.parent));
|
|
14698
|
+
if (withinAwaitExpression && withinTopLevelAwait) {
|
|
14699
|
+
this.withinTopLevelAwait = true;
|
|
14700
|
+
}
|
|
14663
14701
|
}
|
|
14664
14702
|
parseNode(esTreeNode) {
|
|
14665
14703
|
this.sourceAstNode = esTreeNode.source;
|
|
@@ -16290,10 +16328,10 @@ SwitchStatement.prototype.applyDeoptimizations = doNotDeoptimize;
|
|
|
16290
16328
|
|
|
16291
16329
|
class TaggedTemplateExpression extends CallExpressionBase {
|
|
16292
16330
|
get hasCheckedForWarnings() {
|
|
16293
|
-
return isFlagSet(this.flags,
|
|
16331
|
+
return isFlagSet(this.flags, 268435456 /* Flag.checkedForWarnings */);
|
|
16294
16332
|
}
|
|
16295
16333
|
set hasCheckedForWarnings(value) {
|
|
16296
|
-
this.flags = setFlag(this.flags,
|
|
16334
|
+
this.flags = setFlag(this.flags, 268435456 /* Flag.checkedForWarnings */, value);
|
|
16297
16335
|
}
|
|
16298
16336
|
bind() {
|
|
16299
16337
|
super.bind();
|
|
@@ -21248,24 +21286,32 @@ function analyseModuleExecution(entryModules) {
|
|
|
21248
21286
|
const dynamicImports = new Set();
|
|
21249
21287
|
const parents = new Map();
|
|
21250
21288
|
const orderedModules = [];
|
|
21289
|
+
const handleSyncLoadedModule = (module, parent) => {
|
|
21290
|
+
if (parents.has(module)) {
|
|
21291
|
+
if (!analysedModules.has(module)) {
|
|
21292
|
+
cyclePaths.push(getCyclePath(module, parent, parents));
|
|
21293
|
+
}
|
|
21294
|
+
return;
|
|
21295
|
+
}
|
|
21296
|
+
parents.set(module, parent);
|
|
21297
|
+
analyseModule(module);
|
|
21298
|
+
};
|
|
21251
21299
|
const analyseModule = (module) => {
|
|
21252
21300
|
if (module instanceof Module) {
|
|
21253
21301
|
for (const dependency of module.dependencies) {
|
|
21254
|
-
|
|
21255
|
-
if (!analysedModules.has(dependency)) {
|
|
21256
|
-
cyclePaths.push(getCyclePath(dependency, module, parents));
|
|
21257
|
-
}
|
|
21258
|
-
continue;
|
|
21259
|
-
}
|
|
21260
|
-
parents.set(dependency, module);
|
|
21261
|
-
analyseModule(dependency);
|
|
21302
|
+
handleSyncLoadedModule(dependency, module);
|
|
21262
21303
|
}
|
|
21263
21304
|
for (const dependency of module.implicitlyLoadedBefore) {
|
|
21264
21305
|
dynamicImports.add(dependency);
|
|
21265
21306
|
}
|
|
21266
|
-
for (const { resolution } of module.dynamicImports) {
|
|
21307
|
+
for (const { resolution, node } of module.dynamicImports) {
|
|
21267
21308
|
if (resolution instanceof Module) {
|
|
21268
|
-
|
|
21309
|
+
if (node.withinTopLevelAwait) {
|
|
21310
|
+
handleSyncLoadedModule(resolution, module);
|
|
21311
|
+
}
|
|
21312
|
+
else {
|
|
21313
|
+
dynamicImports.add(resolution);
|
|
21314
|
+
}
|
|
21269
21315
|
}
|
|
21270
21316
|
}
|
|
21271
21317
|
orderedModules.push(module);
|
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.41.0",
|
|
4
4
|
"description": "Next-generation ES module bundler with Node wasm",
|
|
5
5
|
"main": "dist/rollup.js",
|
|
6
6
|
"module": "dist/es/rollup.js",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"@codemirror/language": "^6.11.0",
|
|
38
38
|
"@codemirror/search": "^6.5.10",
|
|
39
39
|
"@codemirror/state": "^6.5.2",
|
|
40
|
-
"@codemirror/view": "^6.36.
|
|
41
|
-
"@eslint/js": "^9.
|
|
42
|
-
"@inquirer/prompts": "^7.
|
|
40
|
+
"@codemirror/view": "^6.36.8",
|
|
41
|
+
"@eslint/js": "^9.26.0",
|
|
42
|
+
"@inquirer/prompts": "^7.5.1",
|
|
43
43
|
"@jridgewell/sourcemap-codec": "^1.5.0",
|
|
44
44
|
"@mermaid-js/mermaid-cli": "^11.4.2",
|
|
45
45
|
"@napi-rs/cli": "^2.18.4",
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
"@rollup/plugin-terser": "^0.4.4",
|
|
53
53
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
54
54
|
"@rollup/pluginutils": "^5.1.4",
|
|
55
|
-
"@shikijs/vitepress-twoslash": "^3.
|
|
55
|
+
"@shikijs/vitepress-twoslash": "^3.4.0",
|
|
56
56
|
"@types/mocha": "^10.0.10",
|
|
57
|
-
"@types/node": "^18.19.
|
|
57
|
+
"@types/node": "^18.19.100",
|
|
58
58
|
"@types/picomatch": "^4.0.0",
|
|
59
59
|
"@types/semver": "^7.7.0",
|
|
60
60
|
"@types/yargs-parser": "^21.0.3",
|
|
61
|
-
"@vue/language-server": "^2.2.
|
|
61
|
+
"@vue/language-server": "^2.2.10",
|
|
62
62
|
"acorn": "^8.14.1",
|
|
63
63
|
"acorn-import-assertions": "^1.9.0",
|
|
64
64
|
"acorn-jsx": "^5.3.2",
|
|
@@ -71,36 +71,36 @@
|
|
|
71
71
|
"date-time": "^4.0.0",
|
|
72
72
|
"es5-shim": "^4.6.7",
|
|
73
73
|
"es6-shim": "^0.35.8",
|
|
74
|
-
"eslint": "^9.
|
|
75
|
-
"eslint-config-prettier": "^10.1.
|
|
76
|
-
"eslint-plugin-prettier": "^5.
|
|
77
|
-
"eslint-plugin-unicorn": "^
|
|
78
|
-
"eslint-plugin-vue": "^10.
|
|
74
|
+
"eslint": "^9.26.0",
|
|
75
|
+
"eslint-config-prettier": "^10.1.5",
|
|
76
|
+
"eslint-plugin-prettier": "^5.4.0",
|
|
77
|
+
"eslint-plugin-unicorn": "^59.0.1",
|
|
78
|
+
"eslint-plugin-vue": "^10.1.0",
|
|
79
79
|
"fixturify": "^3.0.0",
|
|
80
80
|
"flru": "^1.0.2",
|
|
81
81
|
"fs-extra": "^11.3.0",
|
|
82
82
|
"github-api": "^3.4.0",
|
|
83
|
-
"globals": "^16.
|
|
83
|
+
"globals": "^16.1.0",
|
|
84
84
|
"husky": "^9.1.7",
|
|
85
85
|
"is-reference": "^3.0.3",
|
|
86
|
-
"lint-staged": "^
|
|
86
|
+
"lint-staged": "^16.0.0",
|
|
87
87
|
"locate-character": "^3.0.0",
|
|
88
88
|
"magic-string": "^0.30.17",
|
|
89
|
-
"mocha": "^11.
|
|
90
|
-
"nodemon": "^3.1.
|
|
89
|
+
"mocha": "^11.2.2",
|
|
90
|
+
"nodemon": "^3.1.10",
|
|
91
91
|
"nyc": "^17.1.0",
|
|
92
92
|
"picocolors": "^1.1.1",
|
|
93
93
|
"picomatch": "^4.0.2",
|
|
94
94
|
"pinia": "^3.0.2",
|
|
95
95
|
"prettier": "^3.5.3",
|
|
96
96
|
"prettier-plugin-organize-imports": "^4.1.0",
|
|
97
|
-
"pretty-bytes": "^
|
|
97
|
+
"pretty-bytes": "^7.0.0",
|
|
98
98
|
"pretty-ms": "^9.2.0",
|
|
99
99
|
"requirejs": "^2.3.7",
|
|
100
|
-
"rollup": "^4.40.
|
|
100
|
+
"rollup": "^4.40.2",
|
|
101
101
|
"rollup-plugin-license": "^3.6.0",
|
|
102
102
|
"rollup-plugin-string": "^3.0.0",
|
|
103
|
-
"semver": "^7.7.
|
|
103
|
+
"semver": "^7.7.2",
|
|
104
104
|
"shx": "^0.4.0",
|
|
105
105
|
"signal-exit": "^4.1.0",
|
|
106
106
|
"source-map": "^0.7.4",
|
|
@@ -109,17 +109,17 @@
|
|
|
109
109
|
"terser": "^5.39.0",
|
|
110
110
|
"tslib": "^2.8.1",
|
|
111
111
|
"typescript": "^5.8.3",
|
|
112
|
-
"typescript-eslint": "^8.
|
|
113
|
-
"vite": "^6.3.
|
|
112
|
+
"typescript-eslint": "^8.32.1",
|
|
113
|
+
"vite": "^6.3.5",
|
|
114
114
|
"vitepress": "^1.6.3",
|
|
115
115
|
"vue": "^3.5.13",
|
|
116
|
-
"vue-tsc": "^2.2.
|
|
116
|
+
"vue-tsc": "^2.2.10",
|
|
117
117
|
"wasm-pack": "^0.13.1",
|
|
118
118
|
"yargs-parser": "^21.1.1"
|
|
119
119
|
},
|
|
120
120
|
"overrides": {
|
|
121
|
-
"axios": "^1.
|
|
122
|
-
"semver": "^7.7.
|
|
121
|
+
"axios": "^1.9.0",
|
|
122
|
+
"semver": "^7.7.2",
|
|
123
123
|
"readable-stream": "npm:@built-in/readable-stream@1",
|
|
124
124
|
"esbuild": ">0.24.2"
|
|
125
125
|
},
|