rollup 3.11.0 → 3.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/rollup +2 -2
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/rollup.js +40 -35
- 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 +40 -35
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/package.json +2 -1
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.0
|
|
4
|
+
Sat, 28 Jan 2023 05:55:49 GMT - commit 01ddea09dfdf1c396c1c24ba3d97743698fe1508
|
|
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.0";
|
|
20
20
|
|
|
21
21
|
const comma = ','.charCodeAt(0);
|
|
22
22
|
const semicolon = ';'.charCodeAt(0);
|
|
@@ -2056,23 +2056,32 @@ const URL_THIS_IS_UNDEFINED = 'troubleshooting/#error-this-is-undefined';
|
|
|
2056
2056
|
const URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY = 'troubleshooting/#warning-treating-module-as-external-dependency';
|
|
2057
2057
|
const URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT = 'troubleshooting/#warning-sourcemap-is-likely-to-be-incorrect';
|
|
2058
2058
|
// configuration-options
|
|
2059
|
-
const
|
|
2059
|
+
const URL_MAXPARALLELFILEOPS = 'configuration-options/#maxparallelfileops';
|
|
2060
|
+
const URL_OUTPUT_AMD_ID = 'configuration-options/#output-amd-id';
|
|
2061
|
+
const URL_OUTPUT_AMD_BASEPATH = 'configuration-options/#output-amd-basepath';
|
|
2060
2062
|
const URL_OUTPUT_DIR = 'configuration-options/#output-dir';
|
|
2061
2063
|
const URL_OUTPUT_DYNAMICIMPORTFUNCTION = 'configuration-options/#output-dynamicimportfunction';
|
|
2062
2064
|
const URL_OUTPUT_EXPORTS = 'configuration-options/#output-exports';
|
|
2063
2065
|
const URL_OUTPUT_EXTEND = 'configuration-options/#output-extend';
|
|
2064
2066
|
const URL_OUTPUT_FORMAT = 'configuration-options/#output-format';
|
|
2065
2067
|
const URL_OUTPUT_GENERATEDCODE = 'configuration-options/#output-generatedcode';
|
|
2068
|
+
const URL_OUTPUT_GENERATEDCODE_CONSTBINDINGS = 'configuration-options/#output-generatedcode-constbindings';
|
|
2069
|
+
const URL_OUTPUT_GENERATEDCODE_SYMBOLS = 'configuration-options/#output-generatedcode-symbols';
|
|
2066
2070
|
const URL_OUTPUT_GLOBALS = 'configuration-options/#output-globals';
|
|
2067
2071
|
const URL_OUTPUT_INLINEDYNAMICIMPORTS = 'configuration-options/#output-inlinedynamicimports';
|
|
2068
2072
|
const URL_OUTPUT_INTEROP = 'configuration-options/#output-interop';
|
|
2069
2073
|
const URL_OUTPUT_MANUALCHUNKS = 'configuration-options/#output-manualchunks';
|
|
2070
2074
|
const URL_OUTPUT_NAME = 'configuration-options/#output-name';
|
|
2075
|
+
const URL_OUTPUT_PRESERVEMODULES = 'configuration-options/#output-preservemodules';
|
|
2071
2076
|
const URL_OUTPUT_SOURCEMAPBASEURL = 'configuration-options/#output-sourcemapbaseurl';
|
|
2072
2077
|
const URL_OUTPUT_SOURCEMAPFILE = 'configuration-options/#output-sourcemapfile';
|
|
2073
2078
|
const URL_PRESERVEENTRYSIGNATURES = 'configuration-options/#preserveentrysignatures';
|
|
2074
2079
|
const URL_TREESHAKE = 'configuration-options/#treeshake';
|
|
2080
|
+
const URL_TREESHAKE_MODULESIDEEFFECTS = 'configuration-options/#treeshake-modulesideeffects';
|
|
2075
2081
|
const URL_WATCH = 'configuration-options/#watch';
|
|
2082
|
+
const URL_RENDERDYNAMICIMPORT = 'plugin-development/#renderdynamicimport';
|
|
2083
|
+
const URL_THIS_GETMODULEIDS = 'plugin-development/#this-getmoduleids';
|
|
2084
|
+
const URL_THIS_GETMODULEINFO = 'plugin-development/#this-getmoduleinfo';
|
|
2076
2085
|
|
|
2077
2086
|
function error(base) {
|
|
2078
2087
|
if (!(base instanceof Error)) {
|
|
@@ -2206,10 +2215,12 @@ function errorCyclicCrossChunkReexport(exportName, exporter, reexporter, importe
|
|
|
2206
2215
|
reexporter
|
|
2207
2216
|
};
|
|
2208
2217
|
}
|
|
2209
|
-
function errorDeprecation(deprecation) {
|
|
2218
|
+
function errorDeprecation(deprecation, urlSnippet, plugin) {
|
|
2210
2219
|
return {
|
|
2211
2220
|
code: DEPRECATED_FEATURE,
|
|
2212
|
-
|
|
2221
|
+
message: deprecation,
|
|
2222
|
+
url: getRollupUrl(urlSnippet),
|
|
2223
|
+
...(plugin ? { plugin } : {})
|
|
2213
2224
|
};
|
|
2214
2225
|
}
|
|
2215
2226
|
function errorDuplicatePluginName(plugin) {
|
|
@@ -2611,12 +2622,12 @@ function errorFailedValidation(message) {
|
|
|
2611
2622
|
message
|
|
2612
2623
|
};
|
|
2613
2624
|
}
|
|
2614
|
-
function warnDeprecation(deprecation, activeDeprecation, options) {
|
|
2615
|
-
warnDeprecationWithOptions(deprecation, activeDeprecation, options.onwarn, options.strictDeprecations);
|
|
2625
|
+
function warnDeprecation(deprecation, urlSnippet, activeDeprecation, options, plugin) {
|
|
2626
|
+
warnDeprecationWithOptions(deprecation, urlSnippet, activeDeprecation, options.onwarn, options.strictDeprecations, plugin);
|
|
2616
2627
|
}
|
|
2617
|
-
function warnDeprecationWithOptions(deprecation, activeDeprecation, warn, strictDeprecations) {
|
|
2628
|
+
function warnDeprecationWithOptions(deprecation, urlSnippet, activeDeprecation, warn, strictDeprecations, plugin) {
|
|
2618
2629
|
if (activeDeprecation || strictDeprecations) {
|
|
2619
|
-
const warning = errorDeprecation(deprecation);
|
|
2630
|
+
const warning = errorDeprecation(deprecation, urlSnippet, plugin);
|
|
2620
2631
|
if (strictDeprecations) {
|
|
2621
2632
|
return error(warning);
|
|
2622
2633
|
}
|
|
@@ -2724,7 +2735,7 @@ class ExternalModule {
|
|
|
2724
2735
|
exports: null,
|
|
2725
2736
|
hasDefaultExport: null,
|
|
2726
2737
|
get hasModuleSideEffects() {
|
|
2727
|
-
warnDeprecation('Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', true, options);
|
|
2738
|
+
warnDeprecation('Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', URL_THIS_GETMODULEINFO, true, options);
|
|
2728
2739
|
return info.moduleSideEffects;
|
|
2729
2740
|
},
|
|
2730
2741
|
id,
|
|
@@ -13050,7 +13061,7 @@ class Module {
|
|
|
13050
13061
|
return module.exports.has('default') || reexportDescriptions.has('default');
|
|
13051
13062
|
},
|
|
13052
13063
|
get hasModuleSideEffects() {
|
|
13053
|
-
warnDeprecation('Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', true, options);
|
|
13064
|
+
warnDeprecation('Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', URL_THIS_GETMODULEINFO, true, options);
|
|
13054
13065
|
return this.moduleSideEffects;
|
|
13055
13066
|
},
|
|
13056
13067
|
id,
|
|
@@ -13815,7 +13826,7 @@ function getCompleteAmdId(options, chunkId) {
|
|
|
13815
13826
|
}
|
|
13816
13827
|
|
|
13817
13828
|
function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, mechanism = 'return ') {
|
|
13818
|
-
const { _,
|
|
13829
|
+
const { _, getDirectReturnFunction, getFunctionIntro, getPropertyAccess, n, s } = snippets;
|
|
13819
13830
|
if (!namedExportsMode) {
|
|
13820
13831
|
return `${n}${n}${mechanism}${getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings, getPropertyAccess)};`;
|
|
13821
13832
|
}
|
|
@@ -13861,13 +13872,10 @@ function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snip
|
|
|
13861
13872
|
if (exportBlock)
|
|
13862
13873
|
exportBlock += n;
|
|
13863
13874
|
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}`;
|
|
13875
|
+
exportBlock += `Object.keys(${name}).forEach(${getFunctionIntro(['k'], {
|
|
13876
|
+
isAsync: false,
|
|
13877
|
+
name: null
|
|
13878
|
+
})}${copyPropertyIfNecessary});`;
|
|
13871
13879
|
}
|
|
13872
13880
|
}
|
|
13873
13881
|
}
|
|
@@ -16904,7 +16912,7 @@ function validateOptionsForMultiChunkOutput(outputOptions, onWarn) {
|
|
|
16904
16912
|
if (outputOptions.sourcemapFile)
|
|
16905
16913
|
return error(errorInvalidOption('output.sourcemapFile', URL_OUTPUT_SOURCEMAPFILE, '"output.sourcemapFile" is only supported for single-file builds'));
|
|
16906
16914
|
if (!outputOptions.amd.autoId && outputOptions.amd.id)
|
|
16907
|
-
onWarn(errorInvalidOption('output.amd.id',
|
|
16915
|
+
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
16916
|
}
|
|
16909
16917
|
function getIncludedModules(modulesById) {
|
|
16910
16918
|
const includedModules = [];
|
|
@@ -23577,10 +23585,7 @@ function getPluginContext(plugin, pluginCache, graph, options, fileEmitter, exis
|
|
|
23577
23585
|
get moduleIds() {
|
|
23578
23586
|
function* wrappedModuleIds() {
|
|
23579
23587
|
// 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);
|
|
23588
|
+
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
23589
|
yield* moduleIds;
|
|
23585
23590
|
}
|
|
23586
23591
|
const moduleIds = graph.modulesById.keys();
|
|
@@ -24554,7 +24559,7 @@ const getIdMatcher = (option) => {
|
|
|
24554
24559
|
const getInlineDynamicImports$1 = (config, warn, strictDeprecations) => {
|
|
24555
24560
|
const configInlineDynamicImports = config.inlineDynamicImports;
|
|
24556
24561
|
if (configInlineDynamicImports) {
|
|
24557
|
-
warnDeprecationWithOptions('The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', true, warn, strictDeprecations);
|
|
24562
|
+
warnDeprecationWithOptions('The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', URL_OUTPUT_INLINEDYNAMICIMPORTS, true, warn, strictDeprecations);
|
|
24558
24563
|
}
|
|
24559
24564
|
return configInlineDynamicImports;
|
|
24560
24565
|
};
|
|
@@ -24565,14 +24570,14 @@ const getInput = (config) => {
|
|
|
24565
24570
|
const getManualChunks$1 = (config, warn, strictDeprecations) => {
|
|
24566
24571
|
const configManualChunks = config.manualChunks;
|
|
24567
24572
|
if (configManualChunks) {
|
|
24568
|
-
warnDeprecationWithOptions('The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.', true, warn, strictDeprecations);
|
|
24573
|
+
warnDeprecationWithOptions('The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.', URL_OUTPUT_MANUALCHUNKS, true, warn, strictDeprecations);
|
|
24569
24574
|
}
|
|
24570
24575
|
return configManualChunks;
|
|
24571
24576
|
};
|
|
24572
24577
|
const getmaxParallelFileOps = (config, warn, strictDeprecations) => {
|
|
24573
24578
|
const maxParallelFileReads = config.maxParallelFileReads;
|
|
24574
24579
|
if (typeof maxParallelFileReads === 'number') {
|
|
24575
|
-
warnDeprecationWithOptions('The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.', true, warn, strictDeprecations);
|
|
24580
|
+
warnDeprecationWithOptions('The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.', URL_MAXPARALLELFILEOPS, true, warn, strictDeprecations);
|
|
24576
24581
|
}
|
|
24577
24582
|
const maxParallelFileOps = config.maxParallelFileOps ?? maxParallelFileReads;
|
|
24578
24583
|
if (typeof maxParallelFileOps === 'number') {
|
|
@@ -24599,7 +24604,7 @@ const getModuleContext = (config, context) => {
|
|
|
24599
24604
|
const getPreserveModules$1 = (config, warn, strictDeprecations) => {
|
|
24600
24605
|
const configPreserveModules = config.preserveModules;
|
|
24601
24606
|
if (configPreserveModules) {
|
|
24602
|
-
warnDeprecationWithOptions('The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', true, warn, strictDeprecations);
|
|
24607
|
+
warnDeprecationWithOptions('The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', URL_OUTPUT_PRESERVEMODULES, true, warn, strictDeprecations);
|
|
24603
24608
|
}
|
|
24604
24609
|
return configPreserveModules;
|
|
24605
24610
|
};
|
|
@@ -24636,7 +24641,7 @@ const getHasModuleSideEffects = (moduleSideEffectsOption) => {
|
|
|
24636
24641
|
return id => ids.has(id);
|
|
24637
24642
|
}
|
|
24638
24643
|
if (moduleSideEffectsOption) {
|
|
24639
|
-
error(errorInvalidOption('treeshake.moduleSideEffects',
|
|
24644
|
+
error(errorInvalidOption('treeshake.moduleSideEffects', URL_TREESHAKE_MODULESIDEEFFECTS, 'please use one of false, "no-external", a function or an array'));
|
|
24640
24645
|
}
|
|
24641
24646
|
return () => true;
|
|
24642
24647
|
};
|
|
@@ -24780,7 +24785,7 @@ const getPreserveModules = (config, inlineDynamicImports, inputOptions) => {
|
|
|
24780
24785
|
const getPreferConst = (config, inputOptions) => {
|
|
24781
24786
|
const configPreferConst = config.preferConst;
|
|
24782
24787
|
if (configPreferConst != null) {
|
|
24783
|
-
warnDeprecation(`The "output.preferConst" option is deprecated. Use the "output.generatedCode.constBindings" option instead.`, true, inputOptions);
|
|
24788
|
+
warnDeprecation(`The "output.preferConst" option is deprecated. Use the "output.generatedCode.constBindings" option instead.`, URL_OUTPUT_GENERATEDCODE_CONSTBINDINGS, true, inputOptions);
|
|
24784
24789
|
}
|
|
24785
24790
|
return !!configPreferConst;
|
|
24786
24791
|
};
|
|
@@ -24800,10 +24805,10 @@ const getAmd = (config) => {
|
|
|
24800
24805
|
...config.amd
|
|
24801
24806
|
};
|
|
24802
24807
|
if ((mergedOption.autoId || mergedOption.basePath) && mergedOption.id) {
|
|
24803
|
-
return error(errorInvalidOption('output.amd.id',
|
|
24808
|
+
return error(errorInvalidOption('output.amd.id', URL_OUTPUT_AMD_ID, 'this option cannot be used together with "output.amd.autoId"/"output.amd.basePath"'));
|
|
24804
24809
|
}
|
|
24805
24810
|
if (mergedOption.basePath && !mergedOption.autoId) {
|
|
24806
|
-
return error(errorInvalidOption('output.amd.basePath',
|
|
24811
|
+
return error(errorInvalidOption('output.amd.basePath', URL_OUTPUT_AMD_BASEPATH, 'this option only works with "output.amd.autoId"'));
|
|
24807
24812
|
}
|
|
24808
24813
|
return mergedOption.autoId
|
|
24809
24814
|
? {
|
|
@@ -24837,7 +24842,7 @@ const getDir = (config, file) => {
|
|
|
24837
24842
|
const getDynamicImportFunction = (config, inputOptions, format) => {
|
|
24838
24843
|
const configDynamicImportFunction = config.dynamicImportFunction;
|
|
24839
24844
|
if (configDynamicImportFunction) {
|
|
24840
|
-
warnDeprecation(`The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.`, true, inputOptions);
|
|
24845
|
+
warnDeprecation(`The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.`, URL_RENDERDYNAMICIMPORT, true, inputOptions);
|
|
24841
24846
|
if (format !== 'es') {
|
|
24842
24847
|
inputOptions.onwarn(errorInvalidOption('output.dynamicImportFunction', URL_OUTPUT_DYNAMICIMPORTFUNCTION, 'this option is ignored for formats other than "es"'));
|
|
24843
24848
|
}
|
|
@@ -24922,7 +24927,7 @@ const getMinifyInternalExports = (config, format, compact) => config.minifyInter
|
|
|
24922
24927
|
const getNamespaceToStringTag = (config, generatedCode, inputOptions) => {
|
|
24923
24928
|
const configNamespaceToStringTag = config.namespaceToStringTag;
|
|
24924
24929
|
if (configNamespaceToStringTag != null) {
|
|
24925
|
-
warnDeprecation(`The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.`, true, inputOptions);
|
|
24930
|
+
warnDeprecation(`The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.`, URL_OUTPUT_GENERATEDCODE_SYMBOLS, true, inputOptions);
|
|
24926
24931
|
return configNamespaceToStringTag;
|
|
24927
24932
|
}
|
|
24928
24933
|
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.0
|
|
4
|
+
Sat, 28 Jan 2023 05:55:49 GMT - commit 01ddea09dfdf1c396c1c24ba3d97743698fe1508
|
|
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.0";
|
|
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 {
|
|
@@ -378,10 +387,12 @@ function errorCyclicCrossChunkReexport(exportName, exporter, reexporter, importe
|
|
|
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
|
}
|
|
@@ -3240,7 +3251,7 @@ class ExternalModule {
|
|
|
3240
3251
|
exports: null,
|
|
3241
3252
|
hasDefaultExport: null,
|
|
3242
3253
|
get hasModuleSideEffects() {
|
|
3243
|
-
warnDeprecation('Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', true, options);
|
|
3254
|
+
warnDeprecation('Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', URL_THIS_GETMODULEINFO, true, options);
|
|
3244
3255
|
return info.moduleSideEffects;
|
|
3245
3256
|
},
|
|
3246
3257
|
id,
|
|
@@ -13568,7 +13579,7 @@ class Module {
|
|
|
13568
13579
|
return module.exports.has('default') || reexportDescriptions.has('default');
|
|
13569
13580
|
},
|
|
13570
13581
|
get hasModuleSideEffects() {
|
|
13571
|
-
warnDeprecation('Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', true, options);
|
|
13582
|
+
warnDeprecation('Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', URL_THIS_GETMODULEINFO, true, options);
|
|
13572
13583
|
return this.moduleSideEffects;
|
|
13573
13584
|
},
|
|
13574
13585
|
id,
|
|
@@ -14333,7 +14344,7 @@ function getCompleteAmdId(options, chunkId) {
|
|
|
14333
14344
|
}
|
|
14334
14345
|
|
|
14335
14346
|
function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snippets, t, externalLiveBindings, mechanism = 'return ') {
|
|
14336
|
-
const { _,
|
|
14347
|
+
const { _, getDirectReturnFunction, getFunctionIntro, getPropertyAccess, n, s } = snippets;
|
|
14337
14348
|
if (!namedExportsMode) {
|
|
14338
14349
|
return `${n}${n}${mechanism}${getSingleDefaultExport(exports, dependencies, interop, externalLiveBindings, getPropertyAccess)};`;
|
|
14339
14350
|
}
|
|
@@ -14379,13 +14390,10 @@ function getExportBlock$1(exports, dependencies, namedExportsMode, interop, snip
|
|
|
14379
14390
|
if (exportBlock)
|
|
14380
14391
|
exportBlock += n;
|
|
14381
14392
|
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}`;
|
|
14393
|
+
exportBlock += `Object.keys(${name}).forEach(${getFunctionIntro(['k'], {
|
|
14394
|
+
isAsync: false,
|
|
14395
|
+
name: null
|
|
14396
|
+
})}${copyPropertyIfNecessary});`;
|
|
14389
14397
|
}
|
|
14390
14398
|
}
|
|
14391
14399
|
}
|
|
@@ -17422,7 +17430,7 @@ function validateOptionsForMultiChunkOutput(outputOptions, onWarn) {
|
|
|
17422
17430
|
if (outputOptions.sourcemapFile)
|
|
17423
17431
|
return error(errorInvalidOption('output.sourcemapFile', URL_OUTPUT_SOURCEMAPFILE, '"output.sourcemapFile" is only supported for single-file builds'));
|
|
17424
17432
|
if (!outputOptions.amd.autoId && outputOptions.amd.id)
|
|
17425
|
-
onWarn(errorInvalidOption('output.amd.id',
|
|
17433
|
+
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
17434
|
}
|
|
17427
17435
|
function getIncludedModules(modulesById) {
|
|
17428
17436
|
const includedModules = [];
|
|
@@ -24095,10 +24103,7 @@ function getPluginContext(plugin, pluginCache, graph, options, fileEmitter, exis
|
|
|
24095
24103
|
get moduleIds() {
|
|
24096
24104
|
function* wrappedModuleIds() {
|
|
24097
24105
|
// 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);
|
|
24106
|
+
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
24107
|
yield* moduleIds;
|
|
24103
24108
|
}
|
|
24104
24109
|
const moduleIds = graph.modulesById.keys();
|
|
@@ -24976,7 +24981,7 @@ const getIdMatcher = (option) => {
|
|
|
24976
24981
|
const getInlineDynamicImports$1 = (config, warn, strictDeprecations) => {
|
|
24977
24982
|
const configInlineDynamicImports = config.inlineDynamicImports;
|
|
24978
24983
|
if (configInlineDynamicImports) {
|
|
24979
|
-
warnDeprecationWithOptions('The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', true, warn, strictDeprecations);
|
|
24984
|
+
warnDeprecationWithOptions('The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', URL_OUTPUT_INLINEDYNAMICIMPORTS, true, warn, strictDeprecations);
|
|
24980
24985
|
}
|
|
24981
24986
|
return configInlineDynamicImports;
|
|
24982
24987
|
};
|
|
@@ -24987,14 +24992,14 @@ const getInput = (config) => {
|
|
|
24987
24992
|
const getManualChunks$1 = (config, warn, strictDeprecations) => {
|
|
24988
24993
|
const configManualChunks = config.manualChunks;
|
|
24989
24994
|
if (configManualChunks) {
|
|
24990
|
-
warnDeprecationWithOptions('The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.', true, warn, strictDeprecations);
|
|
24995
|
+
warnDeprecationWithOptions('The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.', URL_OUTPUT_MANUALCHUNKS, true, warn, strictDeprecations);
|
|
24991
24996
|
}
|
|
24992
24997
|
return configManualChunks;
|
|
24993
24998
|
};
|
|
24994
24999
|
const getmaxParallelFileOps = (config, warn, strictDeprecations) => {
|
|
24995
25000
|
const maxParallelFileReads = config.maxParallelFileReads;
|
|
24996
25001
|
if (typeof maxParallelFileReads === 'number') {
|
|
24997
|
-
warnDeprecationWithOptions('The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.', true, warn, strictDeprecations);
|
|
25002
|
+
warnDeprecationWithOptions('The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.', URL_MAXPARALLELFILEOPS, true, warn, strictDeprecations);
|
|
24998
25003
|
}
|
|
24999
25004
|
const maxParallelFileOps = config.maxParallelFileOps ?? maxParallelFileReads;
|
|
25000
25005
|
if (typeof maxParallelFileOps === 'number') {
|
|
@@ -25021,7 +25026,7 @@ const getModuleContext = (config, context) => {
|
|
|
25021
25026
|
const getPreserveModules$1 = (config, warn, strictDeprecations) => {
|
|
25022
25027
|
const configPreserveModules = config.preserveModules;
|
|
25023
25028
|
if (configPreserveModules) {
|
|
25024
|
-
warnDeprecationWithOptions('The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', true, warn, strictDeprecations);
|
|
25029
|
+
warnDeprecationWithOptions('The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', URL_OUTPUT_PRESERVEMODULES, true, warn, strictDeprecations);
|
|
25025
25030
|
}
|
|
25026
25031
|
return configPreserveModules;
|
|
25027
25032
|
};
|
|
@@ -25058,7 +25063,7 @@ const getHasModuleSideEffects = (moduleSideEffectsOption) => {
|
|
|
25058
25063
|
return id => ids.has(id);
|
|
25059
25064
|
}
|
|
25060
25065
|
if (moduleSideEffectsOption) {
|
|
25061
|
-
error(errorInvalidOption('treeshake.moduleSideEffects',
|
|
25066
|
+
error(errorInvalidOption('treeshake.moduleSideEffects', URL_TREESHAKE_MODULESIDEEFFECTS, 'please use one of false, "no-external", a function or an array'));
|
|
25062
25067
|
}
|
|
25063
25068
|
return () => true;
|
|
25064
25069
|
};
|
|
@@ -25202,7 +25207,7 @@ const getPreserveModules = (config, inlineDynamicImports, inputOptions) => {
|
|
|
25202
25207
|
const getPreferConst = (config, inputOptions) => {
|
|
25203
25208
|
const configPreferConst = config.preferConst;
|
|
25204
25209
|
if (configPreferConst != null) {
|
|
25205
|
-
warnDeprecation(`The "output.preferConst" option is deprecated. Use the "output.generatedCode.constBindings" option instead.`, true, inputOptions);
|
|
25210
|
+
warnDeprecation(`The "output.preferConst" option is deprecated. Use the "output.generatedCode.constBindings" option instead.`, URL_OUTPUT_GENERATEDCODE_CONSTBINDINGS, true, inputOptions);
|
|
25206
25211
|
}
|
|
25207
25212
|
return !!configPreferConst;
|
|
25208
25213
|
};
|
|
@@ -25222,10 +25227,10 @@ const getAmd = (config) => {
|
|
|
25222
25227
|
...config.amd
|
|
25223
25228
|
};
|
|
25224
25229
|
if ((mergedOption.autoId || mergedOption.basePath) && mergedOption.id) {
|
|
25225
|
-
return error(errorInvalidOption('output.amd.id',
|
|
25230
|
+
return error(errorInvalidOption('output.amd.id', URL_OUTPUT_AMD_ID, 'this option cannot be used together with "output.amd.autoId"/"output.amd.basePath"'));
|
|
25226
25231
|
}
|
|
25227
25232
|
if (mergedOption.basePath && !mergedOption.autoId) {
|
|
25228
|
-
return error(errorInvalidOption('output.amd.basePath',
|
|
25233
|
+
return error(errorInvalidOption('output.amd.basePath', URL_OUTPUT_AMD_BASEPATH, 'this option only works with "output.amd.autoId"'));
|
|
25229
25234
|
}
|
|
25230
25235
|
return mergedOption.autoId
|
|
25231
25236
|
? {
|
|
@@ -25259,7 +25264,7 @@ const getDir = (config, file) => {
|
|
|
25259
25264
|
const getDynamicImportFunction = (config, inputOptions, format) => {
|
|
25260
25265
|
const configDynamicImportFunction = config.dynamicImportFunction;
|
|
25261
25266
|
if (configDynamicImportFunction) {
|
|
25262
|
-
warnDeprecation(`The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.`, true, inputOptions);
|
|
25267
|
+
warnDeprecation(`The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.`, URL_RENDERDYNAMICIMPORT, true, inputOptions);
|
|
25263
25268
|
if (format !== 'es') {
|
|
25264
25269
|
inputOptions.onwarn(errorInvalidOption('output.dynamicImportFunction', URL_OUTPUT_DYNAMICIMPORTFUNCTION, 'this option is ignored for formats other than "es"'));
|
|
25265
25270
|
}
|
|
@@ -25344,7 +25349,7 @@ const getMinifyInternalExports = (config, format, compact) => config.minifyInter
|
|
|
25344
25349
|
const getNamespaceToStringTag = (config, generatedCode, inputOptions) => {
|
|
25345
25350
|
const configNamespaceToStringTag = config.namespaceToStringTag;
|
|
25346
25351
|
if (configNamespaceToStringTag != null) {
|
|
25347
|
-
warnDeprecation(`The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.`, true, inputOptions);
|
|
25352
|
+
warnDeprecation(`The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.`, URL_OUTPUT_GENERATEDCODE_SYMBOLS, true, inputOptions);
|
|
25348
25353
|
return configNamespaceToStringTag;
|
|
25349
25354
|
}
|
|
25350
25355
|
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.0",
|
|
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'",
|