rollup 3.11.0 → 3.12.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 +2 -2
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/rollup.js +70 -51
- package/dist/es/shared/watch.js +2 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/rollup.js +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/rollup.js +70 -51
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/package.json +13 -13
package/dist/bin/rollup
CHANGED
package/dist/es/rollup.js
CHANGED
package/dist/es/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v3.
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.12.1
|
|
4
|
+
Wed, 01 Feb 2023 09:25:11 GMT - commit 0c5aa76cb0e30a66ce7c7972f484c003a5b7b8c1
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -16,7 +16,7 @@ import { lstat, realpath, readdir, readFile, mkdir, writeFile } from 'node:fs/pr
|
|
|
16
16
|
import { EventEmitter } from 'node:events';
|
|
17
17
|
import * as tty from 'tty';
|
|
18
18
|
|
|
19
|
-
var version$1 = "3.
|
|
19
|
+
var version$1 = "3.12.1";
|
|
20
20
|
|
|
21
21
|
const comma = ','.charCodeAt(0);
|
|
22
22
|
const semicolon = ';'.charCodeAt(0);
|
|
@@ -222,7 +222,7 @@ let Chunk$1 = class Chunk {
|
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
clone() {
|
|
225
|
-
const chunk = new Chunk
|
|
225
|
+
const chunk = new Chunk(this.start, this.end, this.original);
|
|
226
226
|
|
|
227
227
|
chunk.intro = this.intro;
|
|
228
228
|
chunk.outro = this.outro;
|
|
@@ -282,7 +282,7 @@ let Chunk$1 = class Chunk {
|
|
|
282
282
|
|
|
283
283
|
this.original = originalBefore;
|
|
284
284
|
|
|
285
|
-
const newChunk = new Chunk
|
|
285
|
+
const newChunk = new Chunk(index, this.end, originalAfter);
|
|
286
286
|
newChunk.outro = this.outro;
|
|
287
287
|
this.outro = '';
|
|
288
288
|
|
|
@@ -1380,7 +1380,7 @@ let Bundle$1 = class Bundle {
|
|
|
1380
1380
|
}
|
|
1381
1381
|
|
|
1382
1382
|
clone() {
|
|
1383
|
-
const bundle = new Bundle
|
|
1383
|
+
const bundle = new Bundle({
|
|
1384
1384
|
intro: this.intro,
|
|
1385
1385
|
separator: this.separator,
|
|
1386
1386
|
});
|
|
@@ -1898,7 +1898,10 @@ class Variable extends ExpressionEntity {
|
|
|
1898
1898
|
getBaseVariableName() {
|
|
1899
1899
|
return this.renderBaseName || this.renderName || this.name;
|
|
1900
1900
|
}
|
|
1901
|
-
getName(getPropertyAccess) {
|
|
1901
|
+
getName(getPropertyAccess, useOriginalName) {
|
|
1902
|
+
if (useOriginalName?.(this)) {
|
|
1903
|
+
return this.name;
|
|
1904
|
+
}
|
|
1902
1905
|
const name = this.renderName || this.name;
|
|
1903
1906
|
return this.renderBaseName ? `${this.renderBaseName}${getPropertyAccess(name)}` : name;
|
|
1904
1907
|
}
|
|
@@ -2056,23 +2059,32 @@ const URL_THIS_IS_UNDEFINED = 'troubleshooting/#error-this-is-undefined';
|
|
|
2056
2059
|
const URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY = 'troubleshooting/#warning-treating-module-as-external-dependency';
|
|
2057
2060
|
const URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT = 'troubleshooting/#warning-sourcemap-is-likely-to-be-incorrect';
|
|
2058
2061
|
// configuration-options
|
|
2059
|
-
const
|
|
2062
|
+
const URL_MAXPARALLELFILEOPS = 'configuration-options/#maxparallelfileops';
|
|
2063
|
+
const URL_OUTPUT_AMD_ID = 'configuration-options/#output-amd-id';
|
|
2064
|
+
const URL_OUTPUT_AMD_BASEPATH = 'configuration-options/#output-amd-basepath';
|
|
2060
2065
|
const URL_OUTPUT_DIR = 'configuration-options/#output-dir';
|
|
2061
2066
|
const URL_OUTPUT_DYNAMICIMPORTFUNCTION = 'configuration-options/#output-dynamicimportfunction';
|
|
2062
2067
|
const URL_OUTPUT_EXPORTS = 'configuration-options/#output-exports';
|
|
2063
2068
|
const URL_OUTPUT_EXTEND = 'configuration-options/#output-extend';
|
|
2064
2069
|
const URL_OUTPUT_FORMAT = 'configuration-options/#output-format';
|
|
2065
2070
|
const URL_OUTPUT_GENERATEDCODE = 'configuration-options/#output-generatedcode';
|
|
2071
|
+
const URL_OUTPUT_GENERATEDCODE_CONSTBINDINGS = 'configuration-options/#output-generatedcode-constbindings';
|
|
2072
|
+
const URL_OUTPUT_GENERATEDCODE_SYMBOLS = 'configuration-options/#output-generatedcode-symbols';
|
|
2066
2073
|
const URL_OUTPUT_GLOBALS = 'configuration-options/#output-globals';
|
|
2067
2074
|
const URL_OUTPUT_INLINEDYNAMICIMPORTS = 'configuration-options/#output-inlinedynamicimports';
|
|
2068
2075
|
const URL_OUTPUT_INTEROP = 'configuration-options/#output-interop';
|
|
2069
2076
|
const URL_OUTPUT_MANUALCHUNKS = 'configuration-options/#output-manualchunks';
|
|
2070
2077
|
const URL_OUTPUT_NAME = 'configuration-options/#output-name';
|
|
2078
|
+
const URL_OUTPUT_PRESERVEMODULES = 'configuration-options/#output-preservemodules';
|
|
2071
2079
|
const URL_OUTPUT_SOURCEMAPBASEURL = 'configuration-options/#output-sourcemapbaseurl';
|
|
2072
2080
|
const URL_OUTPUT_SOURCEMAPFILE = 'configuration-options/#output-sourcemapfile';
|
|
2073
2081
|
const URL_PRESERVEENTRYSIGNATURES = 'configuration-options/#preserveentrysignatures';
|
|
2074
2082
|
const URL_TREESHAKE = 'configuration-options/#treeshake';
|
|
2083
|
+
const URL_TREESHAKE_MODULESIDEEFFECTS = 'configuration-options/#treeshake-modulesideeffects';
|
|
2075
2084
|
const URL_WATCH = 'configuration-options/#watch';
|
|
2085
|
+
const URL_RENDERDYNAMICIMPORT = 'plugin-development/#renderdynamicimport';
|
|
2086
|
+
const URL_THIS_GETMODULEIDS = 'plugin-development/#this-getmoduleids';
|
|
2087
|
+
const URL_THIS_GETMODULEINFO = 'plugin-development/#this-getmoduleinfo';
|
|
2076
2088
|
|
|
2077
2089
|
function error(base) {
|
|
2078
2090
|
if (!(base instanceof Error)) {
|
|
@@ -2197,19 +2209,21 @@ function errorCircularReexport(exportName, exporter) {
|
|
|
2197
2209
|
message: `"${exportName}" cannot be exported from "${relativeId(exporter)}" as it is a reexport that references itself.`
|
|
2198
2210
|
};
|
|
2199
2211
|
}
|
|
2200
|
-
function errorCyclicCrossChunkReexport(exportName, exporter, reexporter, importer) {
|
|
2212
|
+
function errorCyclicCrossChunkReexport(exportName, exporter, reexporter, importer, preserveModules) {
|
|
2201
2213
|
return {
|
|
2202
2214
|
code: CYCLIC_CROSS_CHUNK_REEXPORT,
|
|
2203
2215
|
exporter,
|
|
2204
2216
|
id: importer,
|
|
2205
|
-
message: `Export "${exportName}" of module "${relativeId(exporter)}" was reexported through module "${relativeId(reexporter)}" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "${relativeId(importer)}" to point directly to the exporting module or do not use "preserveModules" to ensure these modules end up in the same chunk.`,
|
|
2217
|
+
message: `Export "${exportName}" of module "${relativeId(exporter)}" was reexported through module "${relativeId(reexporter)}" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "${relativeId(importer)}" to point directly to the exporting module or ${preserveModules ? 'do not use "output.preserveModules"' : 'reconfigure "output.manualChunks"'} to ensure these modules end up in the same chunk.`,
|
|
2206
2218
|
reexporter
|
|
2207
2219
|
};
|
|
2208
2220
|
}
|
|
2209
|
-
function errorDeprecation(deprecation) {
|
|
2221
|
+
function errorDeprecation(deprecation, urlSnippet, plugin) {
|
|
2210
2222
|
return {
|
|
2211
2223
|
code: DEPRECATED_FEATURE,
|
|
2212
|
-
|
|
2224
|
+
message: deprecation,
|
|
2225
|
+
url: getRollupUrl(urlSnippet),
|
|
2226
|
+
...(plugin ? { plugin } : {})
|
|
2213
2227
|
};
|
|
2214
2228
|
}
|
|
2215
2229
|
function errorDuplicatePluginName(plugin) {
|
|
@@ -2611,12 +2625,12 @@ function errorFailedValidation(message) {
|
|
|
2611
2625
|
message
|
|
2612
2626
|
};
|
|
2613
2627
|
}
|
|
2614
|
-
function warnDeprecation(deprecation, activeDeprecation, options) {
|
|
2615
|
-
warnDeprecationWithOptions(deprecation, activeDeprecation, options.onwarn, options.strictDeprecations);
|
|
2628
|
+
function warnDeprecation(deprecation, urlSnippet, activeDeprecation, options, plugin) {
|
|
2629
|
+
warnDeprecationWithOptions(deprecation, urlSnippet, activeDeprecation, options.onwarn, options.strictDeprecations, plugin);
|
|
2616
2630
|
}
|
|
2617
|
-
function warnDeprecationWithOptions(deprecation, activeDeprecation, warn, strictDeprecations) {
|
|
2631
|
+
function warnDeprecationWithOptions(deprecation, urlSnippet, activeDeprecation, warn, strictDeprecations, plugin) {
|
|
2618
2632
|
if (activeDeprecation || strictDeprecations) {
|
|
2619
|
-
const warning = errorDeprecation(deprecation);
|
|
2633
|
+
const warning = errorDeprecation(deprecation, urlSnippet, plugin);
|
|
2620
2634
|
if (strictDeprecations) {
|
|
2621
2635
|
return error(warning);
|
|
2622
2636
|
}
|
|
@@ -2724,7 +2738,7 @@ class ExternalModule {
|
|
|
2724
2738
|
exports: null,
|
|
2725
2739
|
hasDefaultExport: null,
|
|
2726
2740
|
get hasModuleSideEffects() {
|
|
2727
|
-
warnDeprecation('Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', true, options);
|
|
2741
|
+
warnDeprecation('Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', URL_THIS_GETMODULEINFO, true, options);
|
|
2728
2742
|
return info.moduleSideEffects;
|
|
2729
2743
|
},
|
|
2730
2744
|
id,
|
|
@@ -8023,9 +8037,9 @@ class Identifier extends NodeBase {
|
|
|
8023
8037
|
markDeclarationReached() {
|
|
8024
8038
|
this.variable.initReached = true;
|
|
8025
8039
|
}
|
|
8026
|
-
render(code, { snippets: { getPropertyAccess } }, { renderedParentType, isCalleeOfRenderedParent, isShorthandProperty } = BLANK) {
|
|
8040
|
+
render(code, { snippets: { getPropertyAccess }, useOriginalName }, { renderedParentType, isCalleeOfRenderedParent, isShorthandProperty } = BLANK) {
|
|
8027
8041
|
if (this.variable) {
|
|
8028
|
-
const name = this.variable.getName(getPropertyAccess);
|
|
8042
|
+
const name = this.variable.getName(getPropertyAccess, useOriginalName);
|
|
8029
8043
|
if (name !== this.name) {
|
|
8030
8044
|
code.overwrite(this.start, this.end, name, {
|
|
8031
8045
|
contentOnly: true,
|
|
@@ -9824,7 +9838,10 @@ class ClassDeclaration extends ClassNode {
|
|
|
9824
9838
|
const renderedVariable = variable.getName(getPropertyAccess);
|
|
9825
9839
|
if (renderedVariable !== name) {
|
|
9826
9840
|
this.superClass?.render(code, options);
|
|
9827
|
-
this.body.render(code,
|
|
9841
|
+
this.body.render(code, {
|
|
9842
|
+
...options,
|
|
9843
|
+
useOriginalName: (_variable) => _variable === variable
|
|
9844
|
+
});
|
|
9828
9845
|
code.prependRight(this.start, `let ${renderedVariable}${_}=${_}`);
|
|
9829
9846
|
code.prependLeft(this.end, ';');
|
|
9830
9847
|
return;
|
|
@@ -13050,7 +13067,7 @@ class Module {
|
|
|
13050
13067
|
return module.exports.has('default') || reexportDescriptions.has('default');
|
|
13051
13068
|
},
|
|
13052
13069
|
get hasModuleSideEffects() {
|
|
13053
|
-
warnDeprecation('Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', true, options);
|
|
13070
|
+
warnDeprecation('Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', URL_THIS_GETMODULEINFO, true, options);
|
|
13054
13071
|
return this.moduleSideEffects;
|
|
13055
13072
|
},
|
|
13056
13073
|
id,
|
|
@@ -13815,7 +13832,7 @@ function getCompleteAmdId(options, chunkId) {
|
|
|
13815
13832
|
}
|
|
13816
13833
|
|
|
13817
13834
|
function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, mechanism = 'return ') {
|
|
13818
|
-
const { _,
|
|
13835
|
+
const { _, getDirectReturnFunction, getFunctionIntro, getPropertyAccess, n, s } = snippets;
|
|
13819
13836
|
if (!namedExportsMode) {
|
|
13820
13837
|
return `${n}${n}${mechanism}${getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings, getPropertyAccess)};`;
|
|
13821
13838
|
}
|
|
@@ -13861,13 +13878,10 @@ function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snip
|
|
|
13861
13878
|
if (exportBlock)
|
|
13862
13879
|
exportBlock += n;
|
|
13863
13880
|
const copyPropertyIfNecessary = `{${n}${t}if${_}(k${_}!==${_}'default'${_}&&${_}!exports.hasOwnProperty(k))${_}${getDefineProperty(name, specifier.needsLiveBinding, t, snippets)}${s}${n}}`;
|
|
13864
|
-
exportBlock +=
|
|
13865
|
-
|
|
13866
|
-
|
|
13867
|
-
|
|
13868
|
-
name: null
|
|
13869
|
-
})}${copyPropertyIfNecessary});`
|
|
13870
|
-
: `for${_}(${cnst} k in ${name})${_}${copyPropertyIfNecessary}`;
|
|
13881
|
+
exportBlock += `Object.keys(${name}).forEach(${getFunctionIntro(['k'], {
|
|
13882
|
+
isAsync: false,
|
|
13883
|
+
name: null
|
|
13884
|
+
})}${copyPropertyIfNecessary});`;
|
|
13871
13885
|
}
|
|
13872
13886
|
}
|
|
13873
13887
|
}
|
|
@@ -15420,8 +15434,10 @@ class Chunk {
|
|
|
15420
15434
|
alternativeReexportModule = importingModule.alternativeReexportModules.get(variable);
|
|
15421
15435
|
if (alternativeReexportModule) {
|
|
15422
15436
|
const exportingChunk = this.chunkByModule.get(alternativeReexportModule);
|
|
15423
|
-
if (exportingChunk
|
|
15424
|
-
this.inputOptions.onwarn(errorCyclicCrossChunkReexport(
|
|
15437
|
+
if (exportingChunk !== exportChunk) {
|
|
15438
|
+
this.inputOptions.onwarn(errorCyclicCrossChunkReexport(
|
|
15439
|
+
// Namespaces do not have an export name
|
|
15440
|
+
variableModule.getExportNamesByVariable().get(variable)?.[0] || '*', variableModule.id, alternativeReexportModule.id, importingModule.id, this.outputOptions.preserveModules));
|
|
15425
15441
|
}
|
|
15426
15442
|
importingModule = alternativeReexportModule;
|
|
15427
15443
|
}
|
|
@@ -15434,8 +15450,10 @@ class Chunk {
|
|
|
15434
15450
|
for (const exportedVariable of map.keys()) {
|
|
15435
15451
|
const isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable;
|
|
15436
15452
|
const importedVariable = isSynthetic ? exportedVariable.getBaseVariable() : exportedVariable;
|
|
15453
|
+
this.checkCircularDependencyImport(importedVariable, module);
|
|
15454
|
+
// When preserving modules, we do not create namespace objects but directly
|
|
15455
|
+
// use the actual namespaces, which would be broken by this logic.
|
|
15437
15456
|
if (!(importedVariable instanceof NamespaceVariable && this.outputOptions.preserveModules)) {
|
|
15438
|
-
this.checkCircularDependencyImport(importedVariable, module);
|
|
15439
15457
|
const exportingModule = importedVariable.module;
|
|
15440
15458
|
if (exportingModule instanceof Module) {
|
|
15441
15459
|
const chunk = this.chunkByModule.get(exportingModule);
|
|
@@ -15806,7 +15824,8 @@ class Chunk {
|
|
|
15806
15824
|
indent,
|
|
15807
15825
|
namespaceToStringTag,
|
|
15808
15826
|
pluginDriver,
|
|
15809
|
-
snippets
|
|
15827
|
+
snippets,
|
|
15828
|
+
useOriginalName: null
|
|
15810
15829
|
};
|
|
15811
15830
|
let usesTopLevelAwait = false;
|
|
15812
15831
|
for (const module of orderedModules) {
|
|
@@ -15964,10 +15983,13 @@ class Chunk {
|
|
|
15964
15983
|
const chunk = this.chunkByModule.get(variable.module);
|
|
15965
15984
|
if (chunk !== this) {
|
|
15966
15985
|
this.imports.add(variable);
|
|
15967
|
-
if (
|
|
15968
|
-
variable.module instanceof Module) {
|
|
15969
|
-
chunk.exports.add(variable);
|
|
15986
|
+
if (variable.module instanceof Module) {
|
|
15970
15987
|
this.checkCircularDependencyImport(variable, module);
|
|
15988
|
+
// When preserving modules, we do not create namespace objects but directly
|
|
15989
|
+
// use the actual namespaces, which would be broken by this logic.
|
|
15990
|
+
if (!(variable instanceof NamespaceVariable && this.outputOptions.preserveModules)) {
|
|
15991
|
+
chunk.exports.add(variable);
|
|
15992
|
+
}
|
|
15971
15993
|
}
|
|
15972
15994
|
}
|
|
15973
15995
|
}
|
|
@@ -16904,7 +16926,7 @@ function validateOptionsForMultiChunkOutput(outputOptions, onWarn) {
|
|
|
16904
16926
|
if (outputOptions.sourcemapFile)
|
|
16905
16927
|
return error(errorInvalidOption('output.sourcemapFile', URL_OUTPUT_SOURCEMAPFILE, '"output.sourcemapFile" is only supported for single-file builds'));
|
|
16906
16928
|
if (!outputOptions.amd.autoId && outputOptions.amd.id)
|
|
16907
|
-
onWarn(errorInvalidOption('output.amd.id',
|
|
16929
|
+
onWarn(errorInvalidOption('output.amd.id', URL_OUTPUT_AMD_ID, 'this option is only properly supported for single-file builds. Use "output.amd.autoId" and "output.amd.basePath" instead'));
|
|
16908
16930
|
}
|
|
16909
16931
|
function getIncludedModules(modulesById) {
|
|
16910
16932
|
const includedModules = [];
|
|
@@ -23577,10 +23599,7 @@ function getPluginContext(plugin, pluginCache, graph, options, fileEmitter, exis
|
|
|
23577
23599
|
get moduleIds() {
|
|
23578
23600
|
function* wrappedModuleIds() {
|
|
23579
23601
|
// We are wrapping this in a generator to only show the message once we are actually iterating
|
|
23580
|
-
warnDeprecation({
|
|
23581
|
-
message: `Accessing "this.moduleIds" on the plugin context by plugin ${plugin.name} is deprecated. The "this.getModuleIds" plugin context function should be used instead.`,
|
|
23582
|
-
plugin: plugin.name
|
|
23583
|
-
}, true, options);
|
|
23602
|
+
warnDeprecation(`Accessing "this.moduleIds" on the plugin context by plugin ${plugin.name} is deprecated. The "this.getModuleIds" plugin context function should be used instead.`, URL_THIS_GETMODULEIDS, true, options, plugin.name);
|
|
23584
23603
|
yield* moduleIds;
|
|
23585
23604
|
}
|
|
23586
23605
|
const moduleIds = graph.modulesById.keys();
|
|
@@ -24554,7 +24573,7 @@ const getIdMatcher = (option) => {
|
|
|
24554
24573
|
const getInlineDynamicImports$1 = (config, warn, strictDeprecations) => {
|
|
24555
24574
|
const configInlineDynamicImports = config.inlineDynamicImports;
|
|
24556
24575
|
if (configInlineDynamicImports) {
|
|
24557
|
-
warnDeprecationWithOptions('The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', true, warn, strictDeprecations);
|
|
24576
|
+
warnDeprecationWithOptions('The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', URL_OUTPUT_INLINEDYNAMICIMPORTS, true, warn, strictDeprecations);
|
|
24558
24577
|
}
|
|
24559
24578
|
return configInlineDynamicImports;
|
|
24560
24579
|
};
|
|
@@ -24565,14 +24584,14 @@ const getInput = (config) => {
|
|
|
24565
24584
|
const getManualChunks$1 = (config, warn, strictDeprecations) => {
|
|
24566
24585
|
const configManualChunks = config.manualChunks;
|
|
24567
24586
|
if (configManualChunks) {
|
|
24568
|
-
warnDeprecationWithOptions('The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.', true, warn, strictDeprecations);
|
|
24587
|
+
warnDeprecationWithOptions('The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.', URL_OUTPUT_MANUALCHUNKS, true, warn, strictDeprecations);
|
|
24569
24588
|
}
|
|
24570
24589
|
return configManualChunks;
|
|
24571
24590
|
};
|
|
24572
24591
|
const getmaxParallelFileOps = (config, warn, strictDeprecations) => {
|
|
24573
24592
|
const maxParallelFileReads = config.maxParallelFileReads;
|
|
24574
24593
|
if (typeof maxParallelFileReads === 'number') {
|
|
24575
|
-
warnDeprecationWithOptions('The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.', true, warn, strictDeprecations);
|
|
24594
|
+
warnDeprecationWithOptions('The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.', URL_MAXPARALLELFILEOPS, true, warn, strictDeprecations);
|
|
24576
24595
|
}
|
|
24577
24596
|
const maxParallelFileOps = config.maxParallelFileOps ?? maxParallelFileReads;
|
|
24578
24597
|
if (typeof maxParallelFileOps === 'number') {
|
|
@@ -24599,7 +24618,7 @@ const getModuleContext = (config, context) => {
|
|
|
24599
24618
|
const getPreserveModules$1 = (config, warn, strictDeprecations) => {
|
|
24600
24619
|
const configPreserveModules = config.preserveModules;
|
|
24601
24620
|
if (configPreserveModules) {
|
|
24602
|
-
warnDeprecationWithOptions('The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', true, warn, strictDeprecations);
|
|
24621
|
+
warnDeprecationWithOptions('The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', URL_OUTPUT_PRESERVEMODULES, true, warn, strictDeprecations);
|
|
24603
24622
|
}
|
|
24604
24623
|
return configPreserveModules;
|
|
24605
24624
|
};
|
|
@@ -24636,7 +24655,7 @@ const getHasModuleSideEffects = (moduleSideEffectsOption) => {
|
|
|
24636
24655
|
return id => ids.has(id);
|
|
24637
24656
|
}
|
|
24638
24657
|
if (moduleSideEffectsOption) {
|
|
24639
|
-
error(errorInvalidOption('treeshake.moduleSideEffects',
|
|
24658
|
+
error(errorInvalidOption('treeshake.moduleSideEffects', URL_TREESHAKE_MODULESIDEEFFECTS, 'please use one of false, "no-external", a function or an array'));
|
|
24640
24659
|
}
|
|
24641
24660
|
return () => true;
|
|
24642
24661
|
};
|
|
@@ -24780,7 +24799,7 @@ const getPreserveModules = (config, inlineDynamicImports, inputOptions) => {
|
|
|
24780
24799
|
const getPreferConst = (config, inputOptions) => {
|
|
24781
24800
|
const configPreferConst = config.preferConst;
|
|
24782
24801
|
if (configPreferConst != null) {
|
|
24783
|
-
warnDeprecation(`The "output.preferConst" option is deprecated. Use the "output.generatedCode.constBindings" option instead.`, true, inputOptions);
|
|
24802
|
+
warnDeprecation(`The "output.preferConst" option is deprecated. Use the "output.generatedCode.constBindings" option instead.`, URL_OUTPUT_GENERATEDCODE_CONSTBINDINGS, true, inputOptions);
|
|
24784
24803
|
}
|
|
24785
24804
|
return !!configPreferConst;
|
|
24786
24805
|
};
|
|
@@ -24800,10 +24819,10 @@ const getAmd = (config) => {
|
|
|
24800
24819
|
...config.amd
|
|
24801
24820
|
};
|
|
24802
24821
|
if ((mergedOption.autoId || mergedOption.basePath) && mergedOption.id) {
|
|
24803
|
-
return error(errorInvalidOption('output.amd.id',
|
|
24822
|
+
return error(errorInvalidOption('output.amd.id', URL_OUTPUT_AMD_ID, 'this option cannot be used together with "output.amd.autoId"/"output.amd.basePath"'));
|
|
24804
24823
|
}
|
|
24805
24824
|
if (mergedOption.basePath && !mergedOption.autoId) {
|
|
24806
|
-
return error(errorInvalidOption('output.amd.basePath',
|
|
24825
|
+
return error(errorInvalidOption('output.amd.basePath', URL_OUTPUT_AMD_BASEPATH, 'this option only works with "output.amd.autoId"'));
|
|
24807
24826
|
}
|
|
24808
24827
|
return mergedOption.autoId
|
|
24809
24828
|
? {
|
|
@@ -24837,7 +24856,7 @@ const getDir = (config, file) => {
|
|
|
24837
24856
|
const getDynamicImportFunction = (config, inputOptions, format) => {
|
|
24838
24857
|
const configDynamicImportFunction = config.dynamicImportFunction;
|
|
24839
24858
|
if (configDynamicImportFunction) {
|
|
24840
|
-
warnDeprecation(`The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.`, true, inputOptions);
|
|
24859
|
+
warnDeprecation(`The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.`, URL_RENDERDYNAMICIMPORT, true, inputOptions);
|
|
24841
24860
|
if (format !== 'es') {
|
|
24842
24861
|
inputOptions.onwarn(errorInvalidOption('output.dynamicImportFunction', URL_OUTPUT_DYNAMICIMPORTFUNCTION, 'this option is ignored for formats other than "es"'));
|
|
24843
24862
|
}
|
|
@@ -24922,7 +24941,7 @@ const getMinifyInternalExports = (config, format, compact) => config.minifyInter
|
|
|
24922
24941
|
const getNamespaceToStringTag = (config, generatedCode, inputOptions) => {
|
|
24923
24942
|
const configNamespaceToStringTag = config.namespaceToStringTag;
|
|
24924
24943
|
if (configNamespaceToStringTag != null) {
|
|
24925
|
-
warnDeprecation(`The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.`, true, inputOptions);
|
|
24944
|
+
warnDeprecation(`The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.`, URL_OUTPUT_GENERATEDCODE_SYMBOLS, true, inputOptions);
|
|
24926
24945
|
return configNamespaceToStringTag;
|
|
24927
24946
|
}
|
|
24928
24947
|
return generatedCode.symbols || false;
|
package/dist/es/shared/watch.js
CHANGED
package/dist/loadConfigFile.js
CHANGED
package/dist/rollup.js
CHANGED
package/dist/shared/index.js
CHANGED
package/dist/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v3.
|
|
4
|
-
|
|
3
|
+
Rollup.js v3.12.1
|
|
4
|
+
Wed, 01 Feb 2023 09:25:11 GMT - commit 0c5aa76cb0e30a66ce7c7972f484c003a5b7b8c1
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -31,7 +31,7 @@ function _interopNamespaceDefault(e) {
|
|
|
31
31
|
|
|
32
32
|
const tty__namespace = /*#__PURE__*/_interopNamespaceDefault(tty);
|
|
33
33
|
|
|
34
|
-
var version$1 = "3.
|
|
34
|
+
var version$1 = "3.12.1";
|
|
35
35
|
|
|
36
36
|
function ensureArray$1(items) {
|
|
37
37
|
if (Array.isArray(items)) {
|
|
@@ -50,26 +50,35 @@ const URL_THIS_IS_UNDEFINED = 'troubleshooting/#error-this-is-undefined';
|
|
|
50
50
|
const URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY = 'troubleshooting/#warning-treating-module-as-external-dependency';
|
|
51
51
|
const URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT = 'troubleshooting/#warning-sourcemap-is-likely-to-be-incorrect';
|
|
52
52
|
// configuration-options
|
|
53
|
-
const
|
|
53
|
+
const URL_MAXPARALLELFILEOPS = 'configuration-options/#maxparallelfileops';
|
|
54
|
+
const URL_OUTPUT_AMD_ID = 'configuration-options/#output-amd-id';
|
|
55
|
+
const URL_OUTPUT_AMD_BASEPATH = 'configuration-options/#output-amd-basepath';
|
|
54
56
|
const URL_OUTPUT_DIR = 'configuration-options/#output-dir';
|
|
55
57
|
const URL_OUTPUT_DYNAMICIMPORTFUNCTION = 'configuration-options/#output-dynamicimportfunction';
|
|
56
58
|
const URL_OUTPUT_EXPORTS = 'configuration-options/#output-exports';
|
|
57
59
|
const URL_OUTPUT_EXTEND = 'configuration-options/#output-extend';
|
|
58
60
|
const URL_OUTPUT_FORMAT = 'configuration-options/#output-format';
|
|
59
61
|
const URL_OUTPUT_GENERATEDCODE = 'configuration-options/#output-generatedcode';
|
|
62
|
+
const URL_OUTPUT_GENERATEDCODE_CONSTBINDINGS = 'configuration-options/#output-generatedcode-constbindings';
|
|
63
|
+
const URL_OUTPUT_GENERATEDCODE_SYMBOLS = 'configuration-options/#output-generatedcode-symbols';
|
|
60
64
|
const URL_OUTPUT_GLOBALS = 'configuration-options/#output-globals';
|
|
61
65
|
const URL_OUTPUT_INLINEDYNAMICIMPORTS = 'configuration-options/#output-inlinedynamicimports';
|
|
62
66
|
const URL_OUTPUT_INTEROP = 'configuration-options/#output-interop';
|
|
63
67
|
const URL_OUTPUT_MANUALCHUNKS = 'configuration-options/#output-manualchunks';
|
|
64
68
|
const URL_OUTPUT_NAME = 'configuration-options/#output-name';
|
|
69
|
+
const URL_OUTPUT_PRESERVEMODULES = 'configuration-options/#output-preservemodules';
|
|
65
70
|
const URL_OUTPUT_SOURCEMAPBASEURL = 'configuration-options/#output-sourcemapbaseurl';
|
|
66
71
|
const URL_OUTPUT_SOURCEMAPFILE = 'configuration-options/#output-sourcemapfile';
|
|
67
72
|
const URL_PRESERVEENTRYSIGNATURES = 'configuration-options/#preserveentrysignatures';
|
|
68
73
|
const URL_TREESHAKE = 'configuration-options/#treeshake';
|
|
74
|
+
const URL_TREESHAKE_MODULESIDEEFFECTS = 'configuration-options/#treeshake-modulesideeffects';
|
|
69
75
|
const URL_WATCH = 'configuration-options/#watch';
|
|
70
76
|
// command-line-interface
|
|
71
77
|
const URL_BUNDLE_CONFIG_AS_CJS = 'command-line-interface/#bundleconfigascjs';
|
|
72
78
|
const URL_CONFIGURATION_FILES = 'command-line-interface/#configuration-files';
|
|
79
|
+
const URL_RENDERDYNAMICIMPORT = 'plugin-development/#renderdynamicimport';
|
|
80
|
+
const URL_THIS_GETMODULEIDS = 'plugin-development/#this-getmoduleids';
|
|
81
|
+
const URL_THIS_GETMODULEINFO = 'plugin-development/#this-getmoduleinfo';
|
|
73
82
|
|
|
74
83
|
async function asyncFlatten(array) {
|
|
75
84
|
do {
|
|
@@ -369,19 +378,21 @@ function errorCircularReexport(exportName, exporter) {
|
|
|
369
378
|
message: `"${exportName}" cannot be exported from "${relativeId(exporter)}" as it is a reexport that references itself.`
|
|
370
379
|
};
|
|
371
380
|
}
|
|
372
|
-
function errorCyclicCrossChunkReexport(exportName, exporter, reexporter, importer) {
|
|
381
|
+
function errorCyclicCrossChunkReexport(exportName, exporter, reexporter, importer, preserveModules) {
|
|
373
382
|
return {
|
|
374
383
|
code: CYCLIC_CROSS_CHUNK_REEXPORT,
|
|
375
384
|
exporter,
|
|
376
385
|
id: importer,
|
|
377
|
-
message: `Export "${exportName}" of module "${relativeId(exporter)}" was reexported through module "${relativeId(reexporter)}" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "${relativeId(importer)}" to point directly to the exporting module or do not use "preserveModules" to ensure these modules end up in the same chunk.`,
|
|
386
|
+
message: `Export "${exportName}" of module "${relativeId(exporter)}" was reexported through module "${relativeId(reexporter)}" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.\nEither change the import in "${relativeId(importer)}" to point directly to the exporting module or ${preserveModules ? 'do not use "output.preserveModules"' : 'reconfigure "output.manualChunks"'} to ensure these modules end up in the same chunk.`,
|
|
378
387
|
reexporter
|
|
379
388
|
};
|
|
380
389
|
}
|
|
381
|
-
function errorDeprecation(deprecation) {
|
|
390
|
+
function errorDeprecation(deprecation, urlSnippet, plugin) {
|
|
382
391
|
return {
|
|
383
392
|
code: DEPRECATED_FEATURE,
|
|
384
|
-
|
|
393
|
+
message: deprecation,
|
|
394
|
+
url: getRollupUrl(urlSnippet),
|
|
395
|
+
...(plugin ? { plugin } : {})
|
|
385
396
|
};
|
|
386
397
|
}
|
|
387
398
|
function errorDuplicateImportOptions() {
|
|
@@ -841,12 +852,12 @@ function errorFailedValidation(message) {
|
|
|
841
852
|
message
|
|
842
853
|
};
|
|
843
854
|
}
|
|
844
|
-
function warnDeprecation(deprecation, activeDeprecation, options) {
|
|
845
|
-
warnDeprecationWithOptions(deprecation, activeDeprecation, options.onwarn, options.strictDeprecations);
|
|
855
|
+
function warnDeprecation(deprecation, urlSnippet, activeDeprecation, options, plugin) {
|
|
856
|
+
warnDeprecationWithOptions(deprecation, urlSnippet, activeDeprecation, options.onwarn, options.strictDeprecations, plugin);
|
|
846
857
|
}
|
|
847
|
-
function warnDeprecationWithOptions(deprecation, activeDeprecation, warn, strictDeprecations) {
|
|
858
|
+
function warnDeprecationWithOptions(deprecation, urlSnippet, activeDeprecation, warn, strictDeprecations, plugin) {
|
|
848
859
|
if (activeDeprecation || strictDeprecations) {
|
|
849
|
-
const warning = errorDeprecation(deprecation);
|
|
860
|
+
const warning = errorDeprecation(deprecation, urlSnippet, plugin);
|
|
850
861
|
if (strictDeprecations) {
|
|
851
862
|
return error(warning);
|
|
852
863
|
}
|
|
@@ -1481,7 +1492,7 @@ let Chunk$1 = class Chunk {
|
|
|
1481
1492
|
}
|
|
1482
1493
|
|
|
1483
1494
|
clone() {
|
|
1484
|
-
const chunk = new Chunk
|
|
1495
|
+
const chunk = new Chunk(this.start, this.end, this.original);
|
|
1485
1496
|
|
|
1486
1497
|
chunk.intro = this.intro;
|
|
1487
1498
|
chunk.outro = this.outro;
|
|
@@ -1541,7 +1552,7 @@ let Chunk$1 = class Chunk {
|
|
|
1541
1552
|
|
|
1542
1553
|
this.original = originalBefore;
|
|
1543
1554
|
|
|
1544
|
-
const newChunk = new Chunk
|
|
1555
|
+
const newChunk = new Chunk(index, this.end, originalAfter);
|
|
1545
1556
|
newChunk.outro = this.outro;
|
|
1546
1557
|
this.outro = '';
|
|
1547
1558
|
|
|
@@ -2639,7 +2650,7 @@ let Bundle$1 = class Bundle {
|
|
|
2639
2650
|
}
|
|
2640
2651
|
|
|
2641
2652
|
clone() {
|
|
2642
|
-
const bundle = new Bundle
|
|
2653
|
+
const bundle = new Bundle({
|
|
2643
2654
|
intro: this.intro,
|
|
2644
2655
|
separator: this.separator,
|
|
2645
2656
|
});
|
|
@@ -3093,7 +3104,10 @@ class Variable extends ExpressionEntity {
|
|
|
3093
3104
|
getBaseVariableName() {
|
|
3094
3105
|
return this.renderBaseName || this.renderName || this.name;
|
|
3095
3106
|
}
|
|
3096
|
-
getName(getPropertyAccess) {
|
|
3107
|
+
getName(getPropertyAccess, useOriginalName) {
|
|
3108
|
+
if (useOriginalName?.(this)) {
|
|
3109
|
+
return this.name;
|
|
3110
|
+
}
|
|
3097
3111
|
const name = this.renderName || this.name;
|
|
3098
3112
|
return this.renderBaseName ? `${this.renderBaseName}${getPropertyAccess(name)}` : name;
|
|
3099
3113
|
}
|
|
@@ -3240,7 +3254,7 @@ class ExternalModule {
|
|
|
3240
3254
|
exports: null,
|
|
3241
3255
|
hasDefaultExport: null,
|
|
3242
3256
|
get hasModuleSideEffects() {
|
|
3243
|
-
warnDeprecation('Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', true, options);
|
|
3257
|
+
warnDeprecation('Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', URL_THIS_GETMODULEINFO, true, options);
|
|
3244
3258
|
return info.moduleSideEffects;
|
|
3245
3259
|
},
|
|
3246
3260
|
id,
|
|
@@ -8541,9 +8555,9 @@ class Identifier extends NodeBase {
|
|
|
8541
8555
|
markDeclarationReached() {
|
|
8542
8556
|
this.variable.initReached = true;
|
|
8543
8557
|
}
|
|
8544
|
-
render(code, { snippets: { getPropertyAccess } }, { renderedParentType, isCalleeOfRenderedParent, isShorthandProperty } = BLANK) {
|
|
8558
|
+
render(code, { snippets: { getPropertyAccess }, useOriginalName }, { renderedParentType, isCalleeOfRenderedParent, isShorthandProperty } = BLANK) {
|
|
8545
8559
|
if (this.variable) {
|
|
8546
|
-
const name = this.variable.getName(getPropertyAccess);
|
|
8560
|
+
const name = this.variable.getName(getPropertyAccess, useOriginalName);
|
|
8547
8561
|
if (name !== this.name) {
|
|
8548
8562
|
code.overwrite(this.start, this.end, name, {
|
|
8549
8563
|
contentOnly: true,
|
|
@@ -10342,7 +10356,10 @@ class ClassDeclaration extends ClassNode {
|
|
|
10342
10356
|
const renderedVariable = variable.getName(getPropertyAccess);
|
|
10343
10357
|
if (renderedVariable !== name) {
|
|
10344
10358
|
this.superClass?.render(code, options);
|
|
10345
|
-
this.body.render(code,
|
|
10359
|
+
this.body.render(code, {
|
|
10360
|
+
...options,
|
|
10361
|
+
useOriginalName: (_variable) => _variable === variable
|
|
10362
|
+
});
|
|
10346
10363
|
code.prependRight(this.start, `let ${renderedVariable}${_}=${_}`);
|
|
10347
10364
|
code.prependLeft(this.end, ';');
|
|
10348
10365
|
return;
|
|
@@ -13568,7 +13585,7 @@ class Module {
|
|
|
13568
13585
|
return module.exports.has('default') || reexportDescriptions.has('default');
|
|
13569
13586
|
},
|
|
13570
13587
|
get hasModuleSideEffects() {
|
|
13571
|
-
warnDeprecation('Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', true, options);
|
|
13588
|
+
warnDeprecation('Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', URL_THIS_GETMODULEINFO, true, options);
|
|
13572
13589
|
return this.moduleSideEffects;
|
|
13573
13590
|
},
|
|
13574
13591
|
id,
|
|
@@ -14333,7 +14350,7 @@ function getCompleteAmdId(options, chunkId) {
|
|
|
14333
14350
|
}
|
|
14334
14351
|
|
|
14335
14352
|
function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, mechanism = 'return ') {
|
|
14336
|
-
const { _,
|
|
14353
|
+
const { _, getDirectReturnFunction, getFunctionIntro, getPropertyAccess, n, s } = snippets;
|
|
14337
14354
|
if (!namedExportsMode) {
|
|
14338
14355
|
return `${n}${n}${mechanism}${getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings, getPropertyAccess)};`;
|
|
14339
14356
|
}
|
|
@@ -14379,13 +14396,10 @@ function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snip
|
|
|
14379
14396
|
if (exportBlock)
|
|
14380
14397
|
exportBlock += n;
|
|
14381
14398
|
const copyPropertyIfNecessary = `{${n}${t}if${_}(k${_}!==${_}'default'${_}&&${_}!exports.hasOwnProperty(k))${_}${getDefineProperty(name, specifier.needsLiveBinding, t, snippets)}${s}${n}}`;
|
|
14382
|
-
exportBlock +=
|
|
14383
|
-
|
|
14384
|
-
|
|
14385
|
-
|
|
14386
|
-
name: null
|
|
14387
|
-
})}${copyPropertyIfNecessary});`
|
|
14388
|
-
: `for${_}(${cnst} k in ${name})${_}${copyPropertyIfNecessary}`;
|
|
14399
|
+
exportBlock += `Object.keys(${name}).forEach(${getFunctionIntro(['k'], {
|
|
14400
|
+
isAsync: false,
|
|
14401
|
+
name: null
|
|
14402
|
+
})}${copyPropertyIfNecessary});`;
|
|
14389
14403
|
}
|
|
14390
14404
|
}
|
|
14391
14405
|
}
|
|
@@ -15938,8 +15952,10 @@ class Chunk {
|
|
|
15938
15952
|
alternativeReexportModule = importingModule.alternativeReexportModules.get(variable);
|
|
15939
15953
|
if (alternativeReexportModule) {
|
|
15940
15954
|
const exportingChunk = this.chunkByModule.get(alternativeReexportModule);
|
|
15941
|
-
if (exportingChunk
|
|
15942
|
-
this.inputOptions.onwarn(errorCyclicCrossChunkReexport(
|
|
15955
|
+
if (exportingChunk !== exportChunk) {
|
|
15956
|
+
this.inputOptions.onwarn(errorCyclicCrossChunkReexport(
|
|
15957
|
+
// Namespaces do not have an export name
|
|
15958
|
+
variableModule.getExportNamesByVariable().get(variable)?.[0] || '*', variableModule.id, alternativeReexportModule.id, importingModule.id, this.outputOptions.preserveModules));
|
|
15943
15959
|
}
|
|
15944
15960
|
importingModule = alternativeReexportModule;
|
|
15945
15961
|
}
|
|
@@ -15952,8 +15968,10 @@ class Chunk {
|
|
|
15952
15968
|
for (const exportedVariable of map.keys()) {
|
|
15953
15969
|
const isSynthetic = exportedVariable instanceof SyntheticNamedExportVariable;
|
|
15954
15970
|
const importedVariable = isSynthetic ? exportedVariable.getBaseVariable() : exportedVariable;
|
|
15971
|
+
this.checkCircularDependencyImport(importedVariable, module);
|
|
15972
|
+
// When preserving modules, we do not create namespace objects but directly
|
|
15973
|
+
// use the actual namespaces, which would be broken by this logic.
|
|
15955
15974
|
if (!(importedVariable instanceof NamespaceVariable && this.outputOptions.preserveModules)) {
|
|
15956
|
-
this.checkCircularDependencyImport(importedVariable, module);
|
|
15957
15975
|
const exportingModule = importedVariable.module;
|
|
15958
15976
|
if (exportingModule instanceof Module) {
|
|
15959
15977
|
const chunk = this.chunkByModule.get(exportingModule);
|
|
@@ -16324,7 +16342,8 @@ class Chunk {
|
|
|
16324
16342
|
indent,
|
|
16325
16343
|
namespaceToStringTag,
|
|
16326
16344
|
pluginDriver,
|
|
16327
|
-
snippets
|
|
16345
|
+
snippets,
|
|
16346
|
+
useOriginalName: null
|
|
16328
16347
|
};
|
|
16329
16348
|
let usesTopLevelAwait = false;
|
|
16330
16349
|
for (const module of orderedModules) {
|
|
@@ -16482,10 +16501,13 @@ class Chunk {
|
|
|
16482
16501
|
const chunk = this.chunkByModule.get(variable.module);
|
|
16483
16502
|
if (chunk !== this) {
|
|
16484
16503
|
this.imports.add(variable);
|
|
16485
|
-
if (
|
|
16486
|
-
variable.module instanceof Module) {
|
|
16487
|
-
chunk.exports.add(variable);
|
|
16504
|
+
if (variable.module instanceof Module) {
|
|
16488
16505
|
this.checkCircularDependencyImport(variable, module);
|
|
16506
|
+
// When preserving modules, we do not create namespace objects but directly
|
|
16507
|
+
// use the actual namespaces, which would be broken by this logic.
|
|
16508
|
+
if (!(variable instanceof NamespaceVariable && this.outputOptions.preserveModules)) {
|
|
16509
|
+
chunk.exports.add(variable);
|
|
16510
|
+
}
|
|
16489
16511
|
}
|
|
16490
16512
|
}
|
|
16491
16513
|
}
|
|
@@ -17422,7 +17444,7 @@ function validateOptionsForMultiChunkOutput(outputOptions, onWarn) {
|
|
|
17422
17444
|
if (outputOptions.sourcemapFile)
|
|
17423
17445
|
return error(errorInvalidOption('output.sourcemapFile', URL_OUTPUT_SOURCEMAPFILE, '"output.sourcemapFile" is only supported for single-file builds'));
|
|
17424
17446
|
if (!outputOptions.amd.autoId && outputOptions.amd.id)
|
|
17425
|
-
onWarn(errorInvalidOption('output.amd.id',
|
|
17447
|
+
onWarn(errorInvalidOption('output.amd.id', URL_OUTPUT_AMD_ID, 'this option is only properly supported for single-file builds. Use "output.amd.autoId" and "output.amd.basePath" instead'));
|
|
17426
17448
|
}
|
|
17427
17449
|
function getIncludedModules(modulesById) {
|
|
17428
17450
|
const includedModules = [];
|
|
@@ -24095,10 +24117,7 @@ function getPluginContext(plugin, pluginCache, graph, options, fileEmitter, exis
|
|
|
24095
24117
|
get moduleIds() {
|
|
24096
24118
|
function* wrappedModuleIds() {
|
|
24097
24119
|
// We are wrapping this in a generator to only show the message once we are actually iterating
|
|
24098
|
-
warnDeprecation({
|
|
24099
|
-
message: `Accessing "this.moduleIds" on the plugin context by plugin ${plugin.name} is deprecated. The "this.getModuleIds" plugin context function should be used instead.`,
|
|
24100
|
-
plugin: plugin.name
|
|
24101
|
-
}, true, options);
|
|
24120
|
+
warnDeprecation(`Accessing "this.moduleIds" on the plugin context by plugin ${plugin.name} is deprecated. The "this.getModuleIds" plugin context function should be used instead.`, URL_THIS_GETMODULEIDS, true, options, plugin.name);
|
|
24102
24121
|
yield* moduleIds;
|
|
24103
24122
|
}
|
|
24104
24123
|
const moduleIds = graph.modulesById.keys();
|
|
@@ -24976,7 +24995,7 @@ const getIdMatcher = (option) => {
|
|
|
24976
24995
|
const getInlineDynamicImports$1 = (config, warn, strictDeprecations) => {
|
|
24977
24996
|
const configInlineDynamicImports = config.inlineDynamicImports;
|
|
24978
24997
|
if (configInlineDynamicImports) {
|
|
24979
|
-
warnDeprecationWithOptions('The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', true, warn, strictDeprecations);
|
|
24998
|
+
warnDeprecationWithOptions('The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', URL_OUTPUT_INLINEDYNAMICIMPORTS, true, warn, strictDeprecations);
|
|
24980
24999
|
}
|
|
24981
25000
|
return configInlineDynamicImports;
|
|
24982
25001
|
};
|
|
@@ -24987,14 +25006,14 @@ const getInput = (config) => {
|
|
|
24987
25006
|
const getManualChunks$1 = (config, warn, strictDeprecations) => {
|
|
24988
25007
|
const configManualChunks = config.manualChunks;
|
|
24989
25008
|
if (configManualChunks) {
|
|
24990
|
-
warnDeprecationWithOptions('The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.', true, warn, strictDeprecations);
|
|
25009
|
+
warnDeprecationWithOptions('The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.', URL_OUTPUT_MANUALCHUNKS, true, warn, strictDeprecations);
|
|
24991
25010
|
}
|
|
24992
25011
|
return configManualChunks;
|
|
24993
25012
|
};
|
|
24994
25013
|
const getmaxParallelFileOps = (config, warn, strictDeprecations) => {
|
|
24995
25014
|
const maxParallelFileReads = config.maxParallelFileReads;
|
|
24996
25015
|
if (typeof maxParallelFileReads === 'number') {
|
|
24997
|
-
warnDeprecationWithOptions('The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.', true, warn, strictDeprecations);
|
|
25016
|
+
warnDeprecationWithOptions('The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.', URL_MAXPARALLELFILEOPS, true, warn, strictDeprecations);
|
|
24998
25017
|
}
|
|
24999
25018
|
const maxParallelFileOps = config.maxParallelFileOps ?? maxParallelFileReads;
|
|
25000
25019
|
if (typeof maxParallelFileOps === 'number') {
|
|
@@ -25021,7 +25040,7 @@ const getModuleContext = (config, context) => {
|
|
|
25021
25040
|
const getPreserveModules$1 = (config, warn, strictDeprecations) => {
|
|
25022
25041
|
const configPreserveModules = config.preserveModules;
|
|
25023
25042
|
if (configPreserveModules) {
|
|
25024
|
-
warnDeprecationWithOptions('The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', true, warn, strictDeprecations);
|
|
25043
|
+
warnDeprecationWithOptions('The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', URL_OUTPUT_PRESERVEMODULES, true, warn, strictDeprecations);
|
|
25025
25044
|
}
|
|
25026
25045
|
return configPreserveModules;
|
|
25027
25046
|
};
|
|
@@ -25058,7 +25077,7 @@ const getHasModuleSideEffects = (moduleSideEffectsOption) => {
|
|
|
25058
25077
|
return id => ids.has(id);
|
|
25059
25078
|
}
|
|
25060
25079
|
if (moduleSideEffectsOption) {
|
|
25061
|
-
error(errorInvalidOption('treeshake.moduleSideEffects',
|
|
25080
|
+
error(errorInvalidOption('treeshake.moduleSideEffects', URL_TREESHAKE_MODULESIDEEFFECTS, 'please use one of false, "no-external", a function or an array'));
|
|
25062
25081
|
}
|
|
25063
25082
|
return () => true;
|
|
25064
25083
|
};
|
|
@@ -25202,7 +25221,7 @@ const getPreserveModules = (config, inlineDynamicImports, inputOptions) => {
|
|
|
25202
25221
|
const getPreferConst = (config, inputOptions) => {
|
|
25203
25222
|
const configPreferConst = config.preferConst;
|
|
25204
25223
|
if (configPreferConst != null) {
|
|
25205
|
-
warnDeprecation(`The "output.preferConst" option is deprecated. Use the "output.generatedCode.constBindings" option instead.`, true, inputOptions);
|
|
25224
|
+
warnDeprecation(`The "output.preferConst" option is deprecated. Use the "output.generatedCode.constBindings" option instead.`, URL_OUTPUT_GENERATEDCODE_CONSTBINDINGS, true, inputOptions);
|
|
25206
25225
|
}
|
|
25207
25226
|
return !!configPreferConst;
|
|
25208
25227
|
};
|
|
@@ -25222,10 +25241,10 @@ const getAmd = (config) => {
|
|
|
25222
25241
|
...config.amd
|
|
25223
25242
|
};
|
|
25224
25243
|
if ((mergedOption.autoId || mergedOption.basePath) && mergedOption.id) {
|
|
25225
|
-
return error(errorInvalidOption('output.amd.id',
|
|
25244
|
+
return error(errorInvalidOption('output.amd.id', URL_OUTPUT_AMD_ID, 'this option cannot be used together with "output.amd.autoId"/"output.amd.basePath"'));
|
|
25226
25245
|
}
|
|
25227
25246
|
if (mergedOption.basePath && !mergedOption.autoId) {
|
|
25228
|
-
return error(errorInvalidOption('output.amd.basePath',
|
|
25247
|
+
return error(errorInvalidOption('output.amd.basePath', URL_OUTPUT_AMD_BASEPATH, 'this option only works with "output.amd.autoId"'));
|
|
25229
25248
|
}
|
|
25230
25249
|
return mergedOption.autoId
|
|
25231
25250
|
? {
|
|
@@ -25259,7 +25278,7 @@ const getDir = (config, file) => {
|
|
|
25259
25278
|
const getDynamicImportFunction = (config, inputOptions, format) => {
|
|
25260
25279
|
const configDynamicImportFunction = config.dynamicImportFunction;
|
|
25261
25280
|
if (configDynamicImportFunction) {
|
|
25262
|
-
warnDeprecation(`The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.`, true, inputOptions);
|
|
25281
|
+
warnDeprecation(`The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.`, URL_RENDERDYNAMICIMPORT, true, inputOptions);
|
|
25263
25282
|
if (format !== 'es') {
|
|
25264
25283
|
inputOptions.onwarn(errorInvalidOption('output.dynamicImportFunction', URL_OUTPUT_DYNAMICIMPORTFUNCTION, 'this option is ignored for formats other than "es"'));
|
|
25265
25284
|
}
|
|
@@ -25344,7 +25363,7 @@ const getMinifyInternalExports = (config, format, compact) => config.minifyInter
|
|
|
25344
25363
|
const getNamespaceToStringTag = (config, generatedCode, inputOptions) => {
|
|
25345
25364
|
const configNamespaceToStringTag = config.namespaceToStringTag;
|
|
25346
25365
|
if (configNamespaceToStringTag != null) {
|
|
25347
|
-
warnDeprecation(`The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.`, true, inputOptions);
|
|
25366
|
+
warnDeprecation(`The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.`, URL_OUTPUT_GENERATEDCODE_SYMBOLS, true, inputOptions);
|
|
25348
25367
|
return configNamespaceToStringTag;
|
|
25349
25368
|
}
|
|
25350
25369
|
return generatedCode.symbols || false;
|
package/dist/shared/watch-cli.js
CHANGED
package/dist/shared/watch.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rollup",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.12.1",
|
|
4
4
|
"description": "Next-generation ES module bundler",
|
|
5
5
|
"main": "dist/rollup.js",
|
|
6
6
|
"module": "dist/es/rollup.js",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"prepublishOnly": "node scripts/check-release.js",
|
|
31
31
|
"release": "node scripts/release.js",
|
|
32
32
|
"test": "npm run build && npm run test:all",
|
|
33
|
+
"test:update-snapshots": "node scripts/update-snapshots.js",
|
|
33
34
|
"test:cjs": "npm run build:cjs && npm run test:only",
|
|
34
35
|
"test:quick": "mocha -b test/test.js",
|
|
35
36
|
"test:all": "concurrently --kill-others-on-fail -c green,blue,magenta,cyan,red 'npm:test:only' 'npm:test:browser' 'npm:test:typescript' 'npm:test:leak' 'npm:test:package' 'npm:test:options'",
|
|
@@ -61,12 +62,12 @@
|
|
|
61
62
|
"fsevents": "~2.3.2"
|
|
62
63
|
},
|
|
63
64
|
"devDependencies": {
|
|
64
|
-
"@codemirror/commands": "^6.
|
|
65
|
+
"@codemirror/commands": "^6.2.0",
|
|
65
66
|
"@codemirror/lang-javascript": "^6.1.2",
|
|
66
|
-
"@codemirror/language": "^6.
|
|
67
|
+
"@codemirror/language": "^6.4.0",
|
|
67
68
|
"@codemirror/search": "^6.2.3",
|
|
68
69
|
"@codemirror/state": "^6.2.0",
|
|
69
|
-
"@codemirror/view": "^6.7.
|
|
70
|
+
"@codemirror/view": "^6.7.3",
|
|
70
71
|
"@jridgewell/sourcemap-codec": "^1.4.14",
|
|
71
72
|
"@rollup/plugin-alias": "^4.0.2",
|
|
72
73
|
"@rollup/plugin-buble": "^1.0.1",
|
|
@@ -81,8 +82,8 @@
|
|
|
81
82
|
"@types/node": "^14.18.36",
|
|
82
83
|
"@types/signal-exit": "^3.0.1",
|
|
83
84
|
"@types/yargs-parser": "^21.0.0",
|
|
84
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
85
|
-
"@typescript-eslint/parser": "^5.
|
|
85
|
+
"@typescript-eslint/eslint-plugin": "^5.50.0",
|
|
86
|
+
"@typescript-eslint/parser": "^5.50.0",
|
|
86
87
|
"@vue/eslint-config-prettier": "^7.0.0",
|
|
87
88
|
"@vue/eslint-config-typescript": "^11.0.2",
|
|
88
89
|
"acorn": "^8.8.1",
|
|
@@ -98,12 +99,12 @@
|
|
|
98
99
|
"date-time": "^4.0.0",
|
|
99
100
|
"es5-shim": "^4.6.7",
|
|
100
101
|
"es6-shim": "^0.35.7",
|
|
101
|
-
"eslint": "^8.
|
|
102
|
+
"eslint": "^8.33.0",
|
|
102
103
|
"eslint-config-prettier": "^8.6.0",
|
|
103
|
-
"eslint-plugin-import": "^2.
|
|
104
|
+
"eslint-plugin-import": "^2.27.5",
|
|
104
105
|
"eslint-plugin-prettier": "^4.2.1",
|
|
105
106
|
"eslint-plugin-unicorn": "^45.0.2",
|
|
106
|
-
"eslint-plugin-vue": "^9.
|
|
107
|
+
"eslint-plugin-vue": "^9.9.0",
|
|
107
108
|
"fixturify": "^3.0.0",
|
|
108
109
|
"flru": "^1.0.2",
|
|
109
110
|
"fs-extra": "^11.1.0",
|
|
@@ -115,11 +116,10 @@
|
|
|
115
116
|
"lint-staged": "^13.1.0",
|
|
116
117
|
"locate-character": "^2.0.5",
|
|
117
118
|
"magic-string": "^0.27.0",
|
|
118
|
-
"mermaid": "~9.1.7",
|
|
119
119
|
"mocha": "^10.2.0",
|
|
120
120
|
"nyc": "^15.1.0",
|
|
121
|
-
"pinia": "^2.0.
|
|
122
|
-
"prettier": "^2.8.
|
|
121
|
+
"pinia": "^2.0.29",
|
|
122
|
+
"prettier": "^2.8.3",
|
|
123
123
|
"pretty-bytes": "^6.0.0",
|
|
124
124
|
"pretty-ms": "^8.0.0",
|
|
125
125
|
"requirejs": "^2.3.6",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"terser": "^5.16.1",
|
|
137
137
|
"tslib": "^2.4.1",
|
|
138
138
|
"typescript": "^4.9.4",
|
|
139
|
-
"vitepress": "^1.0.0-alpha.
|
|
139
|
+
"vitepress": "^1.0.0-alpha.44",
|
|
140
140
|
"vitepress-plugin-mermaid": "^2.0.8",
|
|
141
141
|
"vue": "^3.2.45",
|
|
142
142
|
"weak-napi": "^2.0.2",
|