@rollup/wasm-node 4.64.9 → 4.64.11
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 +69 -35
- package/dist/es/shared/parseAst.js +2 -2
- 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 +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/node-entry.js +2 -2
- package/dist/shared/parseAst.js +2 -2
- package/dist/shared/rollup.js +69 -35
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/package.json +1 -1
package/dist/bin/rollup
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/*
|
|
3
3
|
@license
|
|
4
|
-
Rollup.js v4.64.
|
|
5
|
-
|
|
4
|
+
Rollup.js v4.64.11
|
|
5
|
+
Mon, 19 Oct 2026 16:09:38 GMT - commit 509d86c8e54eb5e4cdfc5e99073449a14946b5dd
|
|
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.64.
|
|
30
|
+
const help = "rollup version 4.64.11\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,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.64.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.64.11
|
|
4
|
+
Mon, 19 Oct 2026 16:09:38 GMT - commit 509d86c8e54eb5e4cdfc5e99073449a14946b5dd
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -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.64.
|
|
30
|
+
var version = "4.64.11";
|
|
31
31
|
const pkg = {
|
|
32
32
|
version: version};
|
|
33
33
|
|
|
@@ -14462,19 +14462,17 @@ class JSXAttribute extends NodeBase {
|
|
|
14462
14462
|
}
|
|
14463
14463
|
if (value) {
|
|
14464
14464
|
code.overwrite(name.end, value.start, ': ', { contentOnly: true });
|
|
14465
|
-
// foo="aa \n aa"
|
|
14466
|
-
if (value instanceof Literal &&
|
|
14467
|
-
typeof value.value === 'string' &&
|
|
14468
|
-
value.value.includes('\n')) {
|
|
14469
|
-
code.overwrite(value.start, value.end, JSON.stringify(value.value), {
|
|
14470
|
-
contentOnly: true
|
|
14471
|
-
});
|
|
14472
|
-
}
|
|
14473
14465
|
}
|
|
14474
14466
|
else {
|
|
14475
14467
|
code.appendLeft(name.end, ': true');
|
|
14476
14468
|
}
|
|
14477
14469
|
}
|
|
14470
|
+
// JSX strings contain HTML entities but no escape sequences
|
|
14471
|
+
if (value instanceof Literal && typeof value.value === 'string') {
|
|
14472
|
+
code.overwrite(value.start, value.end, JSON.stringify(value.value), {
|
|
14473
|
+
contentOnly: true
|
|
14474
|
+
});
|
|
14475
|
+
}
|
|
14478
14476
|
}
|
|
14479
14477
|
}
|
|
14480
14478
|
}
|
|
@@ -20421,7 +20419,8 @@ function getChunkAssignments(entries, manualChunkAliasByEntry, minChunkSize, log
|
|
|
20421
20419
|
const { entriesAndManualChunksCount, dependentEntriesByModule, dynamicallyDependentEntriesByDynamicEntry, dynamicImportsByEntry, dynamicallyDependentEntriesByAwaitedDynamicEntry, awaitedDynamicImportsByEntry } = analyzeModuleGraph(entries, manualChunkModules, manualChunkModulesByModule);
|
|
20422
20420
|
// Each chunk is identified by its position in this array
|
|
20423
20421
|
const chunkAtoms = getChunksWithSameDependentEntries(getModulesWithDependentEntriesAndHandleTLACycles(dependentEntriesByModule, manualChunkModulesByModule, chunkDefinitions));
|
|
20424
|
-
const
|
|
20422
|
+
const manualChunkAtoms = getManualChunkAtoms(manualChunkModules, dependentEntriesByModule);
|
|
20423
|
+
const staticDependencyAtomsByEntry = getStaticDependencyAtomsByEntry(entriesAndManualChunksCount, concatLazy([chunkAtoms, manualChunkAtoms]));
|
|
20425
20424
|
// Warning: This will consume dynamicallyDependentEntriesByDynamicEntry.
|
|
20426
20425
|
// If we no longer want this, we should make a copy here.
|
|
20427
20426
|
const alreadyLoadedAtomsByEntry = getAlreadyLoadedAtomsByEntry(staticDependencyAtomsByEntry, dynamicallyDependentEntriesByDynamicEntry, dynamicImportsByEntry, entriesAndManualChunksCount);
|
|
@@ -20429,7 +20428,7 @@ function getChunkAssignments(entries, manualChunkAliasByEntry, minChunkSize, log
|
|
|
20429
20428
|
const awaitedAlreadyLoadedAtomsByEntry = getAwaitedAlreadyLoadedAtomsByEntry(staticDependencyAtomsByEntry, dynamicallyDependentEntriesByAwaitedDynamicEntry, awaitedDynamicImportsByEntry, entriesAndManualChunksCount);
|
|
20430
20429
|
// This mutates the dependentEntries in chunkAtoms
|
|
20431
20430
|
removeUnnecessaryDependentEntries(chunkAtoms, alreadyLoadedAtomsByEntry, awaitedAlreadyLoadedAtomsByEntry);
|
|
20432
|
-
const { chunks, sideEffectAtoms, sizeByAtom } = getChunksWithSameDependentEntriesAndCorrelatedAtoms(chunkAtoms, staticDependencyAtomsByEntry, alreadyLoadedAtomsByEntry, minChunkSize);
|
|
20431
|
+
const { chunks, sideEffectAtoms, sizeByAtom } = getChunksWithSameDependentEntriesAndCorrelatedAtoms(chunkAtoms, manualChunkAtoms, staticDependencyAtomsByEntry, alreadyLoadedAtomsByEntry, minChunkSize);
|
|
20433
20432
|
chunkDefinitions.push(...getOptimizedChunks(chunks, minChunkSize, sideEffectAtoms, sizeByAtom, log).map(({ modules }) => ({
|
|
20434
20433
|
alias: null,
|
|
20435
20434
|
modules
|
|
@@ -20650,6 +20649,12 @@ function* getModulesWithDependentEntriesAndHandleTLACycles(dependentEntriesByMod
|
|
|
20650
20649
|
}
|
|
20651
20650
|
}
|
|
20652
20651
|
}
|
|
20652
|
+
function getManualChunkAtoms(manualChunkModules, dependentEntriesByModule) {
|
|
20653
|
+
return manualChunkModules.map(modules => ({
|
|
20654
|
+
dependentEntries: dependentEntriesByModule.get(modules[0]),
|
|
20655
|
+
modules
|
|
20656
|
+
}));
|
|
20657
|
+
}
|
|
20653
20658
|
function getStaticDependencyAtomsByEntry(entriesAndManualChunksCount, chunkAtoms) {
|
|
20654
20659
|
// The indices correspond to the indices in allEntries. The atoms correspond
|
|
20655
20660
|
// to bits in the bigint values where chunk 0 is the lowest bit.
|
|
@@ -20741,10 +20746,10 @@ function removeUnnecessaryDependentEntries(chunkAtoms, alreadyLoadedAtomsByEntry
|
|
|
20741
20746
|
chunkMask <<= 1n;
|
|
20742
20747
|
}
|
|
20743
20748
|
}
|
|
20744
|
-
function getChunksWithSameDependentEntriesAndCorrelatedAtoms(chunkAtoms, staticDependencyAtomsByEntry, alreadyLoadedAtomsByEntry, minChunkSize) {
|
|
20749
|
+
function getChunksWithSameDependentEntriesAndCorrelatedAtoms(chunkAtoms, manualChunkAtoms, staticDependencyAtomsByEntry, alreadyLoadedAtomsByEntry, minChunkSize) {
|
|
20745
20750
|
const chunksBySignature = Object.create(null);
|
|
20746
20751
|
const chunkByModule = new Map();
|
|
20747
|
-
const sizeByAtom = new Array(chunkAtoms.length);
|
|
20752
|
+
const sizeByAtom = new Array(chunkAtoms.length + manualChunkAtoms.length);
|
|
20748
20753
|
let sideEffectAtoms = 0n;
|
|
20749
20754
|
let atomMask = 1n;
|
|
20750
20755
|
let index = 0;
|
|
@@ -20769,34 +20774,54 @@ function getChunksWithSameDependentEntriesAndCorrelatedAtoms(chunkAtoms, staticD
|
|
|
20769
20774
|
pure: true,
|
|
20770
20775
|
size: 0
|
|
20771
20776
|
});
|
|
20772
|
-
let atomSize = 0;
|
|
20773
|
-
let pure = true;
|
|
20774
20777
|
for (const module of modules) {
|
|
20775
20778
|
chunkByModule.set(module, chunk);
|
|
20776
|
-
// Unfortunately, we cannot take tree-shaking into account here because
|
|
20777
|
-
// rendering did not happen yet, but we can detect empty modules
|
|
20778
|
-
if (module.isIncluded()) {
|
|
20779
|
-
pure &&= !module.hasEffects();
|
|
20780
|
-
// we use a trivial size for the default minChunkSize to improve
|
|
20781
|
-
// performance
|
|
20782
|
-
atomSize += minChunkSize > 1 ? module.estimateSize() : 1;
|
|
20783
|
-
}
|
|
20784
20779
|
}
|
|
20780
|
+
const { pure, size } = getAtomPurityAndSize(modules, minChunkSize);
|
|
20785
20781
|
if (!pure) {
|
|
20786
20782
|
sideEffectAtoms |= atomMask;
|
|
20787
20783
|
}
|
|
20788
|
-
sizeByAtom[index++] =
|
|
20784
|
+
sizeByAtom[index++] = size;
|
|
20789
20785
|
chunk.containedAtoms |= atomMask;
|
|
20790
20786
|
chunk.modules.push(...modules);
|
|
20791
20787
|
chunk.pure &&= pure;
|
|
20792
|
-
chunk.size +=
|
|
20788
|
+
chunk.size += size;
|
|
20789
|
+
atomMask <<= 1n;
|
|
20790
|
+
}
|
|
20791
|
+
// Manual chunks are not merged, but chunks importing them need to know
|
|
20792
|
+
// their size and side effects
|
|
20793
|
+
const manualChunkAtomByModule = new Map();
|
|
20794
|
+
for (const { modules } of manualChunkAtoms) {
|
|
20795
|
+
for (const module of modules) {
|
|
20796
|
+
manualChunkAtomByModule.set(module, atomMask);
|
|
20797
|
+
}
|
|
20798
|
+
const { pure, size } = getAtomPurityAndSize(modules, minChunkSize);
|
|
20799
|
+
if (!pure) {
|
|
20800
|
+
sideEffectAtoms |= atomMask;
|
|
20801
|
+
}
|
|
20802
|
+
sizeByAtom[index++] = size;
|
|
20793
20803
|
atomMask <<= 1n;
|
|
20794
20804
|
}
|
|
20795
20805
|
const chunks = Object.values(chunksBySignature);
|
|
20796
|
-
sideEffectAtoms |= addChunkDependenciesAndGetExternalSideEffectAtoms(chunks, chunkByModule, atomMask);
|
|
20806
|
+
sideEffectAtoms |= addChunkDependenciesAndGetExternalSideEffectAtoms(chunks, chunkByModule, manualChunkAtomByModule, atomMask);
|
|
20797
20807
|
return { chunks, sideEffectAtoms, sizeByAtom };
|
|
20798
20808
|
}
|
|
20799
|
-
function
|
|
20809
|
+
function getAtomPurityAndSize(modules, minChunkSize) {
|
|
20810
|
+
let pure = true;
|
|
20811
|
+
let size = 0;
|
|
20812
|
+
for (const module of modules) {
|
|
20813
|
+
// Unfortunately, we cannot take tree-shaking into account here because
|
|
20814
|
+
// rendering did not happen yet, but we can detect empty modules
|
|
20815
|
+
if (module.isIncluded()) {
|
|
20816
|
+
pure &&= !module.hasEffects();
|
|
20817
|
+
// we use a trivial size for the default minChunkSize to improve
|
|
20818
|
+
// performance
|
|
20819
|
+
size += minChunkSize > 1 ? module.estimateSize() : 1;
|
|
20820
|
+
}
|
|
20821
|
+
}
|
|
20822
|
+
return { pure, size };
|
|
20823
|
+
}
|
|
20824
|
+
function addChunkDependenciesAndGetExternalSideEffectAtoms(chunks, chunkByModule, manualChunkAtomByModule, nextAvailableAtomMask) {
|
|
20800
20825
|
const signatureByExternalModule = new Map();
|
|
20801
20826
|
let externalSideEffectAtoms = 0n;
|
|
20802
20827
|
for (const chunk of chunks) {
|
|
@@ -20817,9 +20842,17 @@ function addChunkDependenciesAndGetExternalSideEffectAtoms(chunks, chunkByModule
|
|
|
20817
20842
|
}
|
|
20818
20843
|
else {
|
|
20819
20844
|
const dependencyChunk = chunkByModule.get(dependency);
|
|
20820
|
-
if (dependencyChunk
|
|
20821
|
-
|
|
20822
|
-
|
|
20845
|
+
if (dependencyChunk) {
|
|
20846
|
+
if (dependencyChunk !== chunk) {
|
|
20847
|
+
dependencies.add(dependencyChunk);
|
|
20848
|
+
dependencyChunk.dependentChunks.add(chunk);
|
|
20849
|
+
}
|
|
20850
|
+
}
|
|
20851
|
+
else {
|
|
20852
|
+
const manualChunkAtom = manualChunkAtomByModule.get(dependency);
|
|
20853
|
+
if (manualChunkAtom) {
|
|
20854
|
+
chunk.containedAtoms |= manualChunkAtom;
|
|
20855
|
+
}
|
|
20823
20856
|
}
|
|
20824
20857
|
}
|
|
20825
20858
|
}
|
|
@@ -22340,7 +22373,7 @@ async function transform(source, module, pluginDriver, options) {
|
|
|
22340
22373
|
}
|
|
22341
22374
|
const getLogHandler = (handler) => (log, pos) => {
|
|
22342
22375
|
log = normalizeLog(log);
|
|
22343
|
-
if (pos)
|
|
22376
|
+
if (pos != null)
|
|
22344
22377
|
augmentCodeLocation(log, pos, currentSource, id);
|
|
22345
22378
|
log.id = id;
|
|
22346
22379
|
log.hook = 'transform';
|
|
@@ -22373,7 +22406,7 @@ async function transform(source, module, pluginDriver, options) {
|
|
|
22373
22406
|
error(error_, pos) {
|
|
22374
22407
|
if (typeof error_ === 'string')
|
|
22375
22408
|
error_ = { message: error_ };
|
|
22376
|
-
if (pos)
|
|
22409
|
+
if (pos != null)
|
|
22377
22410
|
augmentCodeLocation(error_, pos, currentSource, id);
|
|
22378
22411
|
error_.id = id;
|
|
22379
22412
|
error_.hook = 'transform';
|
|
@@ -24119,7 +24152,8 @@ const getIdMatcher = (option) => {
|
|
|
24119
24152
|
ids.add(value);
|
|
24120
24153
|
}
|
|
24121
24154
|
}
|
|
24122
|
-
return (id, ..._arguments) => ids.has(id) ||
|
|
24155
|
+
return (id, ..._arguments) => ids.has(id) ||
|
|
24156
|
+
matchers.some(matcher => matcher.global || matcher.sticky ? id.search(matcher) !== -1 : matcher.test(id));
|
|
24123
24157
|
}
|
|
24124
24158
|
return () => false;
|
|
24125
24159
|
};
|
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
package/dist/shared/index.js
CHANGED
package/dist/shared/parseAst.js
CHANGED
package/dist/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.64.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.64.11
|
|
4
|
+
Mon, 19 Oct 2026 16:09:38 GMT - commit 509d86c8e54eb5e4cdfc5e99073449a14946b5dd
|
|
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.64.
|
|
45
|
+
var version = "4.64.11";
|
|
46
46
|
const package_ = {
|
|
47
47
|
version: version};
|
|
48
48
|
|
|
@@ -16079,19 +16079,17 @@ class JSXAttribute extends NodeBase {
|
|
|
16079
16079
|
}
|
|
16080
16080
|
if (value) {
|
|
16081
16081
|
code.overwrite(name.end, value.start, ': ', { contentOnly: true });
|
|
16082
|
-
// foo="aa \n aa"
|
|
16083
|
-
if (value instanceof Literal &&
|
|
16084
|
-
typeof value.value === 'string' &&
|
|
16085
|
-
value.value.includes('\n')) {
|
|
16086
|
-
code.overwrite(value.start, value.end, JSON.stringify(value.value), {
|
|
16087
|
-
contentOnly: true
|
|
16088
|
-
});
|
|
16089
|
-
}
|
|
16090
16082
|
}
|
|
16091
16083
|
else {
|
|
16092
16084
|
code.appendLeft(name.end, ': true');
|
|
16093
16085
|
}
|
|
16094
16086
|
}
|
|
16087
|
+
// JSX strings contain HTML entities but no escape sequences
|
|
16088
|
+
if (value instanceof Literal && typeof value.value === 'string') {
|
|
16089
|
+
code.overwrite(value.start, value.end, JSON.stringify(value.value), {
|
|
16090
|
+
contentOnly: true
|
|
16091
|
+
});
|
|
16092
|
+
}
|
|
16095
16093
|
}
|
|
16096
16094
|
}
|
|
16097
16095
|
}
|
|
@@ -21917,7 +21915,8 @@ function getChunkAssignments(entries, manualChunkAliasByEntry, minChunkSize, log
|
|
|
21917
21915
|
const { entriesAndManualChunksCount, dependentEntriesByModule, dynamicallyDependentEntriesByDynamicEntry, dynamicImportsByEntry, dynamicallyDependentEntriesByAwaitedDynamicEntry, awaitedDynamicImportsByEntry } = analyzeModuleGraph(entries, manualChunkModules, manualChunkModulesByModule);
|
|
21918
21916
|
// Each chunk is identified by its position in this array
|
|
21919
21917
|
const chunkAtoms = getChunksWithSameDependentEntries(getModulesWithDependentEntriesAndHandleTLACycles(dependentEntriesByModule, manualChunkModulesByModule, chunkDefinitions));
|
|
21920
|
-
const
|
|
21918
|
+
const manualChunkAtoms = getManualChunkAtoms(manualChunkModules, dependentEntriesByModule);
|
|
21919
|
+
const staticDependencyAtomsByEntry = getStaticDependencyAtomsByEntry(entriesAndManualChunksCount, concatLazy([chunkAtoms, manualChunkAtoms]));
|
|
21921
21920
|
// Warning: This will consume dynamicallyDependentEntriesByDynamicEntry.
|
|
21922
21921
|
// If we no longer want this, we should make a copy here.
|
|
21923
21922
|
const alreadyLoadedAtomsByEntry = getAlreadyLoadedAtomsByEntry(staticDependencyAtomsByEntry, dynamicallyDependentEntriesByDynamicEntry, dynamicImportsByEntry, entriesAndManualChunksCount);
|
|
@@ -21925,7 +21924,7 @@ function getChunkAssignments(entries, manualChunkAliasByEntry, minChunkSize, log
|
|
|
21925
21924
|
const awaitedAlreadyLoadedAtomsByEntry = getAwaitedAlreadyLoadedAtomsByEntry(staticDependencyAtomsByEntry, dynamicallyDependentEntriesByAwaitedDynamicEntry, awaitedDynamicImportsByEntry, entriesAndManualChunksCount);
|
|
21926
21925
|
// This mutates the dependentEntries in chunkAtoms
|
|
21927
21926
|
removeUnnecessaryDependentEntries(chunkAtoms, alreadyLoadedAtomsByEntry, awaitedAlreadyLoadedAtomsByEntry);
|
|
21928
|
-
const { chunks, sideEffectAtoms, sizeByAtom } = getChunksWithSameDependentEntriesAndCorrelatedAtoms(chunkAtoms, staticDependencyAtomsByEntry, alreadyLoadedAtomsByEntry, minChunkSize);
|
|
21927
|
+
const { chunks, sideEffectAtoms, sizeByAtom } = getChunksWithSameDependentEntriesAndCorrelatedAtoms(chunkAtoms, manualChunkAtoms, staticDependencyAtomsByEntry, alreadyLoadedAtomsByEntry, minChunkSize);
|
|
21929
21928
|
chunkDefinitions.push(...getOptimizedChunks(chunks, minChunkSize, sideEffectAtoms, sizeByAtom, log).map(({ modules }) => ({
|
|
21930
21929
|
alias: null,
|
|
21931
21930
|
modules
|
|
@@ -22146,6 +22145,12 @@ function* getModulesWithDependentEntriesAndHandleTLACycles(dependentEntriesByMod
|
|
|
22146
22145
|
}
|
|
22147
22146
|
}
|
|
22148
22147
|
}
|
|
22148
|
+
function getManualChunkAtoms(manualChunkModules, dependentEntriesByModule) {
|
|
22149
|
+
return manualChunkModules.map(modules => ({
|
|
22150
|
+
dependentEntries: dependentEntriesByModule.get(modules[0]),
|
|
22151
|
+
modules
|
|
22152
|
+
}));
|
|
22153
|
+
}
|
|
22149
22154
|
function getStaticDependencyAtomsByEntry(entriesAndManualChunksCount, chunkAtoms) {
|
|
22150
22155
|
// The indices correspond to the indices in allEntries. The atoms correspond
|
|
22151
22156
|
// to bits in the bigint values where chunk 0 is the lowest bit.
|
|
@@ -22237,10 +22242,10 @@ function removeUnnecessaryDependentEntries(chunkAtoms, alreadyLoadedAtomsByEntry
|
|
|
22237
22242
|
chunkMask <<= 1n;
|
|
22238
22243
|
}
|
|
22239
22244
|
}
|
|
22240
|
-
function getChunksWithSameDependentEntriesAndCorrelatedAtoms(chunkAtoms, staticDependencyAtomsByEntry, alreadyLoadedAtomsByEntry, minChunkSize) {
|
|
22245
|
+
function getChunksWithSameDependentEntriesAndCorrelatedAtoms(chunkAtoms, manualChunkAtoms, staticDependencyAtomsByEntry, alreadyLoadedAtomsByEntry, minChunkSize) {
|
|
22241
22246
|
const chunksBySignature = Object.create(null);
|
|
22242
22247
|
const chunkByModule = new Map();
|
|
22243
|
-
const sizeByAtom = new Array(chunkAtoms.length);
|
|
22248
|
+
const sizeByAtom = new Array(chunkAtoms.length + manualChunkAtoms.length);
|
|
22244
22249
|
let sideEffectAtoms = 0n;
|
|
22245
22250
|
let atomMask = 1n;
|
|
22246
22251
|
let index = 0;
|
|
@@ -22265,34 +22270,54 @@ function getChunksWithSameDependentEntriesAndCorrelatedAtoms(chunkAtoms, staticD
|
|
|
22265
22270
|
pure: true,
|
|
22266
22271
|
size: 0
|
|
22267
22272
|
});
|
|
22268
|
-
let atomSize = 0;
|
|
22269
|
-
let pure = true;
|
|
22270
22273
|
for (const module of modules) {
|
|
22271
22274
|
chunkByModule.set(module, chunk);
|
|
22272
|
-
// Unfortunately, we cannot take tree-shaking into account here because
|
|
22273
|
-
// rendering did not happen yet, but we can detect empty modules
|
|
22274
|
-
if (module.isIncluded()) {
|
|
22275
|
-
pure &&= !module.hasEffects();
|
|
22276
|
-
// we use a trivial size for the default minChunkSize to improve
|
|
22277
|
-
// performance
|
|
22278
|
-
atomSize += minChunkSize > 1 ? module.estimateSize() : 1;
|
|
22279
|
-
}
|
|
22280
22275
|
}
|
|
22276
|
+
const { pure, size } = getAtomPurityAndSize(modules, minChunkSize);
|
|
22281
22277
|
if (!pure) {
|
|
22282
22278
|
sideEffectAtoms |= atomMask;
|
|
22283
22279
|
}
|
|
22284
|
-
sizeByAtom[index++] =
|
|
22280
|
+
sizeByAtom[index++] = size;
|
|
22285
22281
|
chunk.containedAtoms |= atomMask;
|
|
22286
22282
|
chunk.modules.push(...modules);
|
|
22287
22283
|
chunk.pure &&= pure;
|
|
22288
|
-
chunk.size +=
|
|
22284
|
+
chunk.size += size;
|
|
22285
|
+
atomMask <<= 1n;
|
|
22286
|
+
}
|
|
22287
|
+
// Manual chunks are not merged, but chunks importing them need to know
|
|
22288
|
+
// their size and side effects
|
|
22289
|
+
const manualChunkAtomByModule = new Map();
|
|
22290
|
+
for (const { modules } of manualChunkAtoms) {
|
|
22291
|
+
for (const module of modules) {
|
|
22292
|
+
manualChunkAtomByModule.set(module, atomMask);
|
|
22293
|
+
}
|
|
22294
|
+
const { pure, size } = getAtomPurityAndSize(modules, minChunkSize);
|
|
22295
|
+
if (!pure) {
|
|
22296
|
+
sideEffectAtoms |= atomMask;
|
|
22297
|
+
}
|
|
22298
|
+
sizeByAtom[index++] = size;
|
|
22289
22299
|
atomMask <<= 1n;
|
|
22290
22300
|
}
|
|
22291
22301
|
const chunks = Object.values(chunksBySignature);
|
|
22292
|
-
sideEffectAtoms |= addChunkDependenciesAndGetExternalSideEffectAtoms(chunks, chunkByModule, atomMask);
|
|
22302
|
+
sideEffectAtoms |= addChunkDependenciesAndGetExternalSideEffectAtoms(chunks, chunkByModule, manualChunkAtomByModule, atomMask);
|
|
22293
22303
|
return { chunks, sideEffectAtoms, sizeByAtom };
|
|
22294
22304
|
}
|
|
22295
|
-
function
|
|
22305
|
+
function getAtomPurityAndSize(modules, minChunkSize) {
|
|
22306
|
+
let pure = true;
|
|
22307
|
+
let size = 0;
|
|
22308
|
+
for (const module of modules) {
|
|
22309
|
+
// Unfortunately, we cannot take tree-shaking into account here because
|
|
22310
|
+
// rendering did not happen yet, but we can detect empty modules
|
|
22311
|
+
if (module.isIncluded()) {
|
|
22312
|
+
pure &&= !module.hasEffects();
|
|
22313
|
+
// we use a trivial size for the default minChunkSize to improve
|
|
22314
|
+
// performance
|
|
22315
|
+
size += minChunkSize > 1 ? module.estimateSize() : 1;
|
|
22316
|
+
}
|
|
22317
|
+
}
|
|
22318
|
+
return { pure, size };
|
|
22319
|
+
}
|
|
22320
|
+
function addChunkDependenciesAndGetExternalSideEffectAtoms(chunks, chunkByModule, manualChunkAtomByModule, nextAvailableAtomMask) {
|
|
22296
22321
|
const signatureByExternalModule = new Map();
|
|
22297
22322
|
let externalSideEffectAtoms = 0n;
|
|
22298
22323
|
for (const chunk of chunks) {
|
|
@@ -22313,9 +22338,17 @@ function addChunkDependenciesAndGetExternalSideEffectAtoms(chunks, chunkByModule
|
|
|
22313
22338
|
}
|
|
22314
22339
|
else {
|
|
22315
22340
|
const dependencyChunk = chunkByModule.get(dependency);
|
|
22316
|
-
if (dependencyChunk
|
|
22317
|
-
|
|
22318
|
-
|
|
22341
|
+
if (dependencyChunk) {
|
|
22342
|
+
if (dependencyChunk !== chunk) {
|
|
22343
|
+
dependencies.add(dependencyChunk);
|
|
22344
|
+
dependencyChunk.dependentChunks.add(chunk);
|
|
22345
|
+
}
|
|
22346
|
+
}
|
|
22347
|
+
else {
|
|
22348
|
+
const manualChunkAtom = manualChunkAtomByModule.get(dependency);
|
|
22349
|
+
if (manualChunkAtom) {
|
|
22350
|
+
chunk.containedAtoms |= manualChunkAtom;
|
|
22351
|
+
}
|
|
22319
22352
|
}
|
|
22320
22353
|
}
|
|
22321
22354
|
}
|
|
@@ -23571,7 +23604,7 @@ async function transform(source, module, pluginDriver, options) {
|
|
|
23571
23604
|
}
|
|
23572
23605
|
const getLogHandler = (handler) => (log, pos) => {
|
|
23573
23606
|
log = normalizeLog(log);
|
|
23574
|
-
if (pos)
|
|
23607
|
+
if (pos != null)
|
|
23575
23608
|
parseAst_js.augmentCodeLocation(log, pos, currentSource, id);
|
|
23576
23609
|
log.id = id;
|
|
23577
23610
|
log.hook = 'transform';
|
|
@@ -23604,7 +23637,7 @@ async function transform(source, module, pluginDriver, options) {
|
|
|
23604
23637
|
error(error_, pos) {
|
|
23605
23638
|
if (typeof error_ === 'string')
|
|
23606
23639
|
error_ = { message: error_ };
|
|
23607
|
-
if (pos)
|
|
23640
|
+
if (pos != null)
|
|
23608
23641
|
parseAst_js.augmentCodeLocation(error_, pos, currentSource, id);
|
|
23609
23642
|
error_.id = id;
|
|
23610
23643
|
error_.hook = 'transform';
|
|
@@ -24456,7 +24489,8 @@ const getIdMatcher = (option) => {
|
|
|
24456
24489
|
ids.add(value);
|
|
24457
24490
|
}
|
|
24458
24491
|
}
|
|
24459
|
-
return (id, ..._arguments) => ids.has(id) ||
|
|
24492
|
+
return (id, ..._arguments) => ids.has(id) ||
|
|
24493
|
+
matchers.some(matcher => matcher.global || matcher.sticky ? id.search(matcher) !== -1 : matcher.test(id));
|
|
24460
24494
|
}
|
|
24461
24495
|
return () => false;
|
|
24462
24496
|
};
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED