rollup 4.20.0 → 4.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/rollup +3 -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 +74 -63
- package/dist/es/shared/parseAst.js +2 -3
- package/dist/es/shared/watch.js +4 -4
- package/dist/getLogFilter.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/parseAst.js +2 -2
- package/dist/rollup.d.ts +19 -31
- 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 +3 -3
- package/dist/shared/parseAst.js +2 -3
- package/dist/shared/rollup.js +157 -146
- package/dist/shared/watch-cli.js +9 -8
- package/dist/shared/watch.js +4 -4
- package/package.json +35 -36
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.21.1
|
|
5
|
+
Mon, 26 Aug 2024 15:53:42 GMT - commit c33c6ceb7da712c3d14b67b81febf9303fbbd96c
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
8
8
|
|
|
@@ -1614,12 +1614,10 @@ async function getConfigPath(commandConfig) {
|
|
|
1614
1614
|
if (commandConfig.slice(0, 5) === 'node:') {
|
|
1615
1615
|
const packageName = commandConfig.slice(5);
|
|
1616
1616
|
try {
|
|
1617
|
-
// eslint-disable-next-line unicorn/prefer-module
|
|
1618
1617
|
return require.resolve(`rollup-config-${packageName}`, { paths: [process$1.cwd()] });
|
|
1619
1618
|
}
|
|
1620
1619
|
catch {
|
|
1621
1620
|
try {
|
|
1622
|
-
// eslint-disable-next-line unicorn/prefer-module
|
|
1623
1621
|
return require.resolve(packageName, { paths: [process$1.cwd()] });
|
|
1624
1622
|
}
|
|
1625
1623
|
catch (error) {
|
|
@@ -1745,7 +1743,7 @@ else if (command.version) {
|
|
|
1745
1743
|
}
|
|
1746
1744
|
else {
|
|
1747
1745
|
try {
|
|
1748
|
-
// eslint-disable-next-line
|
|
1746
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
1749
1747
|
require('source-map-support').install();
|
|
1750
1748
|
}
|
|
1751
1749
|
catch {
|
|
@@ -1753,7 +1751,6 @@ else {
|
|
|
1753
1751
|
}
|
|
1754
1752
|
const promise = runRollup(command);
|
|
1755
1753
|
if (command.forceExit) {
|
|
1756
|
-
// eslint-disable-next-line unicorn/no-process-exit
|
|
1757
1754
|
promise.then(() => process$1.exit());
|
|
1758
1755
|
}
|
|
1759
1756
|
}
|
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.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.21.1
|
|
4
|
+
Mon, 26 Aug 2024 15:53:42 GMT - commit c33c6ceb7da712c3d14b67b81febf9303fbbd96c
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -16,7 +16,7 @@ import { performance } from 'node:perf_hooks';
|
|
|
16
16
|
import { lstat, realpath, readdir, readFile, mkdir, writeFile } from 'node:fs/promises';
|
|
17
17
|
import * as tty from 'tty';
|
|
18
18
|
|
|
19
|
-
var version = "4.
|
|
19
|
+
var version = "4.21.1";
|
|
20
20
|
|
|
21
21
|
const comma = ','.charCodeAt(0);
|
|
22
22
|
const semicolon = ';'.charCodeAt(0);
|
|
@@ -7414,7 +7414,9 @@ class ChildScope extends Scope {
|
|
|
7414
7414
|
this.parent.addNamespaceMemberAccess(name, variable);
|
|
7415
7415
|
}
|
|
7416
7416
|
addReturnExpression(expression) {
|
|
7417
|
-
this.parent instanceof ChildScope
|
|
7417
|
+
if (this.parent instanceof ChildScope) {
|
|
7418
|
+
this.parent.addReturnExpression(expression);
|
|
7419
|
+
}
|
|
7418
7420
|
}
|
|
7419
7421
|
addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope) {
|
|
7420
7422
|
for (const variable of this.accessedOutsideVariables.values()) {
|
|
@@ -7730,12 +7732,15 @@ function renderStatementList(statements, code, start, end, options) {
|
|
|
7730
7732
|
currentNode.end +
|
|
7731
7733
|
findFirstLineBreakOutsideComment(code.original.slice(currentNode.end, nextNode === undefined ? end : nextNode.start))[1];
|
|
7732
7734
|
if (currentNode.included) {
|
|
7733
|
-
currentNodeNeedsBoundaries
|
|
7734
|
-
|
|
7735
|
+
if (currentNodeNeedsBoundaries) {
|
|
7736
|
+
currentNode.render(code, options, {
|
|
7735
7737
|
end: nextNodeStart,
|
|
7736
7738
|
start: currentNodeStart
|
|
7737
|
-
})
|
|
7738
|
-
|
|
7739
|
+
});
|
|
7740
|
+
}
|
|
7741
|
+
else {
|
|
7742
|
+
currentNode.render(code, options);
|
|
7743
|
+
}
|
|
7739
7744
|
}
|
|
7740
7745
|
else {
|
|
7741
7746
|
treeshakeNode(currentNode, code, currentNodeStart, nextNodeStart);
|
|
@@ -7929,7 +7934,9 @@ class RestElement extends NodeBase {
|
|
|
7929
7934
|
return this.argument.declare(kind, UNKNOWN_EXPRESSION);
|
|
7930
7935
|
}
|
|
7931
7936
|
deoptimizePath(path) {
|
|
7932
|
-
path.length === 0
|
|
7937
|
+
if (path.length === 0) {
|
|
7938
|
+
this.argument.deoptimizePath(EMPTY_PATH);
|
|
7939
|
+
}
|
|
7933
7940
|
}
|
|
7934
7941
|
hasEffectsOnInteractionAtPath(path, interaction, context) {
|
|
7935
7942
|
return (path.length > 0 ||
|
|
@@ -8384,7 +8391,9 @@ class AssignmentPattern extends NodeBase {
|
|
|
8384
8391
|
return this.left.declare(kind, init);
|
|
8385
8392
|
}
|
|
8386
8393
|
deoptimizePath(path) {
|
|
8387
|
-
path.length === 0
|
|
8394
|
+
if (path.length === 0) {
|
|
8395
|
+
this.left.deoptimizePath(path);
|
|
8396
|
+
}
|
|
8388
8397
|
}
|
|
8389
8398
|
hasEffectsOnInteractionAtPath(path, interaction, context) {
|
|
8390
8399
|
return (path.length > 0 || this.left.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context));
|
|
@@ -10496,7 +10505,7 @@ const getHelpersBlock = (additionalHelpers, accessedGlobals, indent, snippets, l
|
|
|
10496
10505
|
};
|
|
10497
10506
|
const HELPER_GENERATORS = {
|
|
10498
10507
|
[DOCUMENT_CURRENT_SCRIPT](_t, { _, n }) {
|
|
10499
|
-
return `var${
|
|
10508
|
+
return `var ${DOCUMENT_CURRENT_SCRIPT}${_}=${_}typeof document${_}!==${_}'undefined'${_}?${_}document.currentScript${_}:${_}null;${n}`;
|
|
10500
10509
|
},
|
|
10501
10510
|
[INTEROP_DEFAULT_COMPAT_VARIABLE](_t, snippets, liveBindings) {
|
|
10502
10511
|
const { _, getDirectReturnFunction, n } = snippets;
|
|
@@ -11774,7 +11783,9 @@ class SwitchCase extends NodeBase {
|
|
|
11774
11783
|
}
|
|
11775
11784
|
render(code, options, nodeRenderOptions) {
|
|
11776
11785
|
if (this.consequent.length > 0) {
|
|
11777
|
-
|
|
11786
|
+
if (this.test) {
|
|
11787
|
+
this.test.render(code, options);
|
|
11788
|
+
}
|
|
11778
11789
|
const testEnd = this.test
|
|
11779
11790
|
? this.test.end
|
|
11780
11791
|
: findFirstOccurrenceOutsideComment(code.original, 'default', this.start) + 7;
|
|
@@ -13897,21 +13908,17 @@ class Module {
|
|
|
13897
13908
|
},
|
|
13898
13909
|
id,
|
|
13899
13910
|
get implicitlyLoadedAfterOneOf() {
|
|
13900
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
13901
13911
|
return Array.from(implicitlyLoadedAfter, getId).sort();
|
|
13902
13912
|
},
|
|
13903
13913
|
get implicitlyLoadedBefore() {
|
|
13904
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
13905
13914
|
return Array.from(implicitlyLoadedBefore, getId).sort();
|
|
13906
13915
|
},
|
|
13907
13916
|
get importedIdResolutions() {
|
|
13908
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
13909
13917
|
return Array.from(sourcesWithAttributes.keys(), source => module.resolvedIds[source]).filter(Boolean);
|
|
13910
13918
|
},
|
|
13911
13919
|
get importedIds() {
|
|
13912
13920
|
// We cannot use this.dependencies because this is needed before
|
|
13913
13921
|
// dependencies are populated
|
|
13914
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
13915
13922
|
return Array.from(sourcesWithAttributes.keys(), source => module.resolvedIds[source]?.id).filter(Boolean);
|
|
13916
13923
|
},
|
|
13917
13924
|
get importers() {
|
|
@@ -13954,7 +13961,9 @@ class Module {
|
|
|
13954
13961
|
]);
|
|
13955
13962
|
}
|
|
13956
13963
|
error(properties, pos) {
|
|
13957
|
-
pos !== undefined
|
|
13964
|
+
if (pos !== undefined) {
|
|
13965
|
+
this.addLocationToLogProps(properties, pos);
|
|
13966
|
+
}
|
|
13958
13967
|
return error(properties);
|
|
13959
13968
|
}
|
|
13960
13969
|
// sum up the length of all ast nodes that are included
|
|
@@ -14376,7 +14385,6 @@ class Module {
|
|
|
14376
14385
|
attributes: this.info.attributes,
|
|
14377
14386
|
code: this.info.code,
|
|
14378
14387
|
customTransformCache: this.customTransformCache,
|
|
14379
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
14380
14388
|
dependencies: Array.from(this.dependencies, getId),
|
|
14381
14389
|
id: this.id,
|
|
14382
14390
|
meta: this.info.meta,
|
|
@@ -14743,7 +14751,6 @@ function setAlternativeExporterIfCyclic(variable, importer, reexporter) {
|
|
|
14743
14751
|
}
|
|
14744
14752
|
}
|
|
14745
14753
|
const copyNameToModulesMap = (searchedNamesAndModules) => searchedNamesAndModules &&
|
|
14746
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
14747
14754
|
new Map(Array.from(searchedNamesAndModules, ([name, modules]) => [name, new Set(modules)]));
|
|
14748
14755
|
|
|
14749
14756
|
function removeJsExtension(name) {
|
|
@@ -15930,12 +15937,16 @@ const removeUnreferencedAssets = (outputBundle) => {
|
|
|
15930
15937
|
const unreferencedAssets = new Set();
|
|
15931
15938
|
const bundleEntries = Object.values(outputBundle);
|
|
15932
15939
|
for (const asset of bundleEntries) {
|
|
15933
|
-
asset.type === 'asset' && asset.needsCodeReference
|
|
15940
|
+
if (asset.type === 'asset' && asset.needsCodeReference) {
|
|
15941
|
+
unreferencedAssets.add(asset.fileName);
|
|
15942
|
+
}
|
|
15934
15943
|
}
|
|
15935
15944
|
for (const chunk of bundleEntries) {
|
|
15936
15945
|
if (chunk.type === 'chunk') {
|
|
15937
15946
|
for (const referencedFile of chunk.referencedFiles) {
|
|
15938
|
-
unreferencedAssets.has(referencedFile)
|
|
15947
|
+
if (unreferencedAssets.has(referencedFile)) {
|
|
15948
|
+
unreferencedAssets.delete(referencedFile);
|
|
15949
|
+
}
|
|
15939
15950
|
}
|
|
15940
15951
|
}
|
|
15941
15952
|
}
|
|
@@ -16164,7 +16175,6 @@ class Chunk {
|
|
|
16164
16175
|
}
|
|
16165
16176
|
}
|
|
16166
16177
|
for (const module of entryModules) {
|
|
16167
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
16168
16178
|
const requiredFacades = Array.from(new Set(module.chunkNames.filter(({ isUserDefined }) => isUserDefined).map(({ name }) => name)),
|
|
16169
16179
|
// mapping must run after Set 'name' dedupe
|
|
16170
16180
|
name => ({
|
|
@@ -16173,7 +16183,6 @@ class Chunk {
|
|
|
16173
16183
|
if (requiredFacades.length === 0 && module.isUserDefinedEntryPoint) {
|
|
16174
16184
|
requiredFacades.push({});
|
|
16175
16185
|
}
|
|
16176
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
16177
16186
|
requiredFacades.push(...Array.from(module.chunkFileNames, fileName => ({ fileName })));
|
|
16178
16187
|
if (requiredFacades.length === 0) {
|
|
16179
16188
|
requiredFacades.push({});
|
|
@@ -16298,10 +16307,8 @@ class Chunk {
|
|
|
16298
16307
|
...this.getPreRenderedChunkInfo(),
|
|
16299
16308
|
dynamicImports: this.getDynamicDependencies().map(resolveFileName),
|
|
16300
16309
|
fileName: this.getFileName(),
|
|
16301
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
16302
16310
|
implicitlyLoadedBefore: Array.from(this.implicitlyLoadedBefore, resolveFileName),
|
|
16303
16311
|
importedBindings: getImportedBindingsPerDependency(this.getRenderedDependencies(), resolveFileName),
|
|
16304
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
16305
16312
|
imports: Array.from(this.dependencies, resolveFileName),
|
|
16306
16313
|
modules: this.renderedModules,
|
|
16307
16314
|
referencedFiles: this.getReferencedFiles()
|
|
@@ -16346,9 +16353,7 @@ class Chunk {
|
|
|
16346
16353
|
hasDefaultExport = true;
|
|
16347
16354
|
}
|
|
16348
16355
|
if (format === 'es') {
|
|
16349
|
-
renderedDependency.reexports = reexports.filter(
|
|
16350
|
-
// eslint-disable-next-line unicorn/prefer-array-some
|
|
16351
|
-
({ reexported }) => !renderedExports.find(({ exported }) => exported === reexported));
|
|
16356
|
+
renderedDependency.reexports = reexports.filter(({ reexported }) => !renderedExports.find(({ exported }) => exported === reexported));
|
|
16352
16357
|
}
|
|
16353
16358
|
}
|
|
16354
16359
|
}
|
|
@@ -16382,7 +16387,9 @@ class Chunk {
|
|
|
16382
16387
|
magicString.prepend(banner);
|
|
16383
16388
|
if (format === 'es' || format === 'cjs') {
|
|
16384
16389
|
const shebang = facadeModule !== null && facadeModule.info.isEntry && facadeModule.shebang;
|
|
16385
|
-
|
|
16390
|
+
if (shebang) {
|
|
16391
|
+
magicString.prepend(`#!${shebang}\n`);
|
|
16392
|
+
}
|
|
16386
16393
|
}
|
|
16387
16394
|
if (footer)
|
|
16388
16395
|
magicString.append(footer);
|
|
@@ -16698,12 +16705,19 @@ class Chunk {
|
|
|
16698
16705
|
? sanitizedId.slice(0, -extensionName.length)
|
|
16699
16706
|
: sanitizedId;
|
|
16700
16707
|
if (isAbsolute$1(idWithoutExtension)) {
|
|
16701
|
-
|
|
16702
|
-
|
|
16703
|
-
|
|
16708
|
+
if (preserveModulesRoot && resolve$1(idWithoutExtension).startsWith(preserveModulesRoot)) {
|
|
16709
|
+
return idWithoutExtension.slice(preserveModulesRoot.length).replace(/^[/\\]/, '');
|
|
16710
|
+
}
|
|
16711
|
+
else {
|
|
16712
|
+
// handle edge case in Windows
|
|
16713
|
+
if (this.inputBase === '/' && !idWithoutExtension.startsWith('/')) {
|
|
16714
|
+
return relative$1(this.inputBase, idWithoutExtension.replace(/^[a-zA-Z]:[/\\]/, '/'));
|
|
16715
|
+
}
|
|
16716
|
+
return relative$1(this.inputBase, idWithoutExtension);
|
|
16717
|
+
}
|
|
16704
16718
|
}
|
|
16705
16719
|
else {
|
|
16706
|
-
return
|
|
16720
|
+
return (this.outputOptions.virtualDirname.replace(/\/$/, '') + '/' + basename(idWithoutExtension));
|
|
16707
16721
|
}
|
|
16708
16722
|
}
|
|
16709
16723
|
getReexportSpecifiers() {
|
|
@@ -16840,7 +16854,6 @@ class Chunk {
|
|
|
16840
16854
|
const rendered = module.render(renderOptions);
|
|
16841
16855
|
if (!renderOptions.accessedDocumentCurrentScript &&
|
|
16842
16856
|
formatsMaybeAccessDocumentCurrentScript.includes(format)) {
|
|
16843
|
-
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
16844
16857
|
this.accessedGlobalsByScope.get(module.scope)?.delete(DOCUMENT_CURRENT_SCRIPT);
|
|
16845
16858
|
}
|
|
16846
16859
|
renderOptions.accessedDocumentCurrentScript = false;
|
|
@@ -16882,7 +16895,6 @@ class Chunk {
|
|
|
16882
16895
|
}
|
|
16883
16896
|
if (hoistedSource)
|
|
16884
16897
|
magicString.prepend(hoistedSource + n + n);
|
|
16885
|
-
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
16886
16898
|
if (this.needsExportsShim) {
|
|
16887
16899
|
magicString.prepend(`${n}${cnst} ${MISSING_EXPORT_SHIM_VARIABLE}${_}=${_}void 0;${n}${n}`);
|
|
16888
16900
|
}
|
|
@@ -17542,11 +17554,13 @@ function getOptimizedChunks(chunks, minChunkSize, sideEffectAtoms, sizeByAtom, l
|
|
|
17542
17554
|
timeEnd('optimize chunks', 3);
|
|
17543
17555
|
return chunks; // the actual modules
|
|
17544
17556
|
}
|
|
17545
|
-
minChunkSize > 1
|
|
17557
|
+
if (minChunkSize > 1) {
|
|
17546
17558
|
log('info', logOptimizeChunkStatus(chunks.length, chunkPartition.small.size, 'Initially'));
|
|
17559
|
+
}
|
|
17547
17560
|
mergeChunks(chunkPartition, minChunkSize, sideEffectAtoms, sizeByAtom);
|
|
17548
|
-
minChunkSize > 1
|
|
17561
|
+
if (minChunkSize > 1) {
|
|
17549
17562
|
log('info', logOptimizeChunkStatus(chunkPartition.small.size + chunkPartition.big.size, chunkPartition.small.size, 'After merging chunks'));
|
|
17563
|
+
}
|
|
17550
17564
|
timeEnd('optimize chunks', 3);
|
|
17551
17565
|
return [...chunkPartition.small, ...chunkPartition.big];
|
|
17552
17566
|
}
|
|
@@ -18285,7 +18299,6 @@ class Bundle {
|
|
|
18285
18299
|
return manualChunkAliasByEntry;
|
|
18286
18300
|
}
|
|
18287
18301
|
assignManualChunks(getManualChunk) {
|
|
18288
|
-
// eslint-disable-next-line unicorn/prefer-module
|
|
18289
18302
|
const manualChunkAliasesWithEntry = [];
|
|
18290
18303
|
const manualChunksApi = {
|
|
18291
18304
|
getModuleIds: () => this.graph.modulesById.keys(),
|
|
@@ -18441,6 +18454,22 @@ function flru (max) {
|
|
|
18441
18454
|
};
|
|
18442
18455
|
}
|
|
18443
18456
|
|
|
18457
|
+
class GlobalScope extends Scope {
|
|
18458
|
+
constructor() {
|
|
18459
|
+
super();
|
|
18460
|
+
this.parent = null;
|
|
18461
|
+
this.variables.set('undefined', new UndefinedVariable());
|
|
18462
|
+
}
|
|
18463
|
+
findVariable(name) {
|
|
18464
|
+
let variable = this.variables.get(name);
|
|
18465
|
+
if (!variable) {
|
|
18466
|
+
variable = new GlobalVariable(name);
|
|
18467
|
+
this.variables.set(name, variable);
|
|
18468
|
+
}
|
|
18469
|
+
return variable;
|
|
18470
|
+
}
|
|
18471
|
+
}
|
|
18472
|
+
|
|
18444
18473
|
function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry, attributes) {
|
|
18445
18474
|
let skipped = null;
|
|
18446
18475
|
let replaceContext = null;
|
|
@@ -19165,7 +19194,6 @@ class ModuleLoader {
|
|
|
19165
19194
|
});
|
|
19166
19195
|
}
|
|
19167
19196
|
getResolveStaticDependencyPromises(module) {
|
|
19168
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
19169
19197
|
return Array.from(module.sourcesWithAttributes, async ([source, attributes]) => [
|
|
19170
19198
|
source,
|
|
19171
19199
|
(module.resolvedIds[source] =
|
|
@@ -19304,22 +19332,6 @@ async function waitForDependencyResolution(loadPromise) {
|
|
|
19304
19332
|
return Promise.all([...resolveStaticDependencyPromises, ...resolveDynamicImportPromises]);
|
|
19305
19333
|
}
|
|
19306
19334
|
|
|
19307
|
-
class GlobalScope extends Scope {
|
|
19308
|
-
constructor() {
|
|
19309
|
-
super();
|
|
19310
|
-
this.parent = null;
|
|
19311
|
-
this.variables.set('undefined', new UndefinedVariable());
|
|
19312
|
-
}
|
|
19313
|
-
findVariable(name) {
|
|
19314
|
-
let variable = this.variables.get(name);
|
|
19315
|
-
if (!variable) {
|
|
19316
|
-
variable = new GlobalVariable(name);
|
|
19317
|
-
this.variables.set(name, variable);
|
|
19318
|
-
}
|
|
19319
|
-
return variable;
|
|
19320
|
-
}
|
|
19321
|
-
}
|
|
19322
|
-
|
|
19323
19335
|
function generateAssetFileName(name, source, originalFileName, sourceHash, outputOptions, bundle) {
|
|
19324
19336
|
const emittedName = outputOptions.sanitizeFileName(name || 'asset');
|
|
19325
19337
|
return makeUnique(renderNamePattern(typeof outputOptions.assetFileNames === 'function'
|
|
@@ -19888,7 +19900,7 @@ class PluginDriver {
|
|
|
19888
19900
|
if (typeof handler !== 'function') {
|
|
19889
19901
|
return handler;
|
|
19890
19902
|
}
|
|
19891
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
19903
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
19892
19904
|
const hookResult = handler.apply(context, parameters);
|
|
19893
19905
|
if (!hookResult?.then) {
|
|
19894
19906
|
// short circuit for non-thenables and non-Promises
|
|
@@ -19933,7 +19945,7 @@ class PluginDriver {
|
|
|
19933
19945
|
context = replaceContext(context, plugin);
|
|
19934
19946
|
}
|
|
19935
19947
|
try {
|
|
19936
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
19948
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
19937
19949
|
return handler.apply(context, parameters);
|
|
19938
19950
|
}
|
|
19939
19951
|
catch (error_) {
|
|
@@ -20495,7 +20507,8 @@ async function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
|
|
|
20495
20507
|
sourcemapPathTransform: config.sourcemapPathTransform,
|
|
20496
20508
|
strict: config.strict ?? true,
|
|
20497
20509
|
systemNullSetters: config.systemNullSetters ?? true,
|
|
20498
|
-
validate: config.validate || false
|
|
20510
|
+
validate: config.validate || false,
|
|
20511
|
+
virtualDirname: config.virtualDirname || '_virtual'
|
|
20499
20512
|
};
|
|
20500
20513
|
warnUnknownOptions(config, Object.keys(outputOptions), 'output options', inputOptions.onLog);
|
|
20501
20514
|
return { options: outputOptions, unsetOptions };
|
|
@@ -20600,7 +20613,6 @@ const getAddon = (config, name) => {
|
|
|
20600
20613
|
}
|
|
20601
20614
|
return () => configAddon || '';
|
|
20602
20615
|
};
|
|
20603
|
-
// eslint-disable-next-line unicorn/prevent-abbreviations
|
|
20604
20616
|
const getDir = (config, file) => {
|
|
20605
20617
|
const { dir } = config;
|
|
20606
20618
|
if (typeof dir === 'string' && typeof file === 'string') {
|
|
@@ -20670,9 +20682,7 @@ const getInterop = (config) => {
|
|
|
20670
20682
|
};
|
|
20671
20683
|
const validateInterop = (interop) => {
|
|
20672
20684
|
if (!ALLOWED_INTEROP_TYPES.has(interop)) {
|
|
20673
|
-
return error(logInvalidOption('output.interop', URL_OUTPUT_INTEROP,
|
|
20674
|
-
// eslint-disable-next-line unicorn/prefer-spread
|
|
20675
|
-
`use one of ${Array.from(ALLOWED_INTEROP_TYPES, value => JSON.stringify(value)).join(', ')}`, interop));
|
|
20685
|
+
return error(logInvalidOption('output.interop', URL_OUTPUT_INTEROP, `use one of ${Array.from(ALLOWED_INTEROP_TYPES, value => JSON.stringify(value)).join(', ')}`, interop));
|
|
20676
20686
|
}
|
|
20677
20687
|
return interop;
|
|
20678
20688
|
};
|
|
@@ -21203,7 +21213,8 @@ async function mergeOutputOptions(config, overrides, log) {
|
|
|
21203
21213
|
sourcemapPathTransform: getOption('sourcemapPathTransform'),
|
|
21204
21214
|
strict: getOption('strict'),
|
|
21205
21215
|
systemNullSetters: getOption('systemNullSetters'),
|
|
21206
|
-
validate: getOption('validate')
|
|
21216
|
+
validate: getOption('validate'),
|
|
21217
|
+
virtualDirname: getOption('virtualDirname')
|
|
21207
21218
|
};
|
|
21208
21219
|
warnUnknownOptions(config, Object.keys(outputOptions), 'output options', log);
|
|
21209
21220
|
return outputOptions;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.21.1
|
|
4
|
+
Mon, 26 Aug 2024 15:53:42 GMT - commit c33c6ceb7da712c3d14b67b81febf9303fbbd96c
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -808,7 +808,6 @@ function logMissingNodeBuiltins(externalBuiltins) {
|
|
|
808
808
|
message: `Creating a browser bundle that depends on Node.js built-in modules (${printQuotedStringList(externalBuiltins)}). You might need to include https://github.com/FredKSchott/rollup-plugin-polyfill-node`
|
|
809
809
|
};
|
|
810
810
|
}
|
|
811
|
-
// eslint-disable-next-line unicorn/prevent-abbreviations
|
|
812
811
|
function logMissingFileOrDirOption() {
|
|
813
812
|
return {
|
|
814
813
|
code: MISSING_OPTION,
|
package/dist/es/shared/watch.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v4.
|
|
4
|
-
|
|
3
|
+
Rollup.js v4.21.1
|
|
4
|
+
Mon, 26 Aug 2024 15:53:42 GMT - commit c33c6ceb7da712c3d14b67b81febf9303fbbd96c
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
8
8
|
Released under the MIT License.
|
|
9
9
|
*/
|
|
10
|
+
import { picomatch as picomatch$2, getAugmentedNamespace, fseventsImporter, createFilter, rollupInternal } from './node-entry.js';
|
|
10
11
|
import path$1 from 'node:path';
|
|
11
12
|
import process$1 from 'node:process';
|
|
12
|
-
import { picomatch as picomatch$2, getAugmentedNamespace, fseventsImporter, createFilter, rollupInternal } from './node-entry.js';
|
|
13
|
-
import { platform } from 'node:os';
|
|
14
13
|
import require$$0$1 from 'fs';
|
|
15
14
|
import require$$2 from 'util';
|
|
16
15
|
import require$$1 from 'stream';
|
|
17
16
|
import require$$0$2 from 'path';
|
|
18
17
|
import require$$2$1 from 'os';
|
|
19
18
|
import require$$0$3 from 'events';
|
|
19
|
+
import { platform } from 'node:os';
|
|
20
20
|
import './parseAst.js';
|
|
21
21
|
import '../../native.js';
|
|
22
22
|
import 'node:perf_hooks';
|
package/dist/getLogFilter.js
CHANGED
package/dist/loadConfigFile.js
CHANGED
package/dist/parseAst.js
CHANGED