rollup 2.76.0 → 2.77.2
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/CHANGELOG.md +45 -0
- package/README.md +1 -3
- package/dist/bin/rollup +2 -2
- package/dist/es/rollup.browser.js +3 -3
- package/dist/es/rollup.js +2 -2
- package/dist/es/shared/rollup.js +52 -57
- package/dist/es/shared/watch.js +3 -2
- package/dist/loadConfigFile.js +2 -2
- package/dist/rollup.browser.js +3 -3
- package/dist/rollup.browser.js.map +1 -1
- package/dist/rollup.d.ts +4 -0
- package/dist/rollup.js +2 -2
- package/dist/shared/index.js +2 -2
- package/dist/shared/loadConfigFile.js +2 -2
- package/dist/shared/mergeOptions.js +3 -2
- package/dist/shared/rollup.js +51 -56
- package/dist/shared/watch-cli.js +2 -2
- package/dist/shared/watch.js +2 -2
- package/package.json +8 -8
package/dist/rollup.d.ts
CHANGED
|
@@ -553,6 +553,8 @@ export interface InputOptions {
|
|
|
553
553
|
makeAbsoluteExternalsRelative?: boolean | 'ifRelativeSource';
|
|
554
554
|
/** @deprecated Use the "manualChunks" output option instead. */
|
|
555
555
|
manualChunks?: ManualChunksOption;
|
|
556
|
+
maxParallelFileOps?: number;
|
|
557
|
+
/** @deprecated Use the "maxParallelFileOps" option instead. */
|
|
556
558
|
maxParallelFileReads?: number;
|
|
557
559
|
moduleContext?: ((id: string) => string | null | void) | { [id: string]: string };
|
|
558
560
|
onwarn?: WarningHandlerWithDefault;
|
|
@@ -581,6 +583,8 @@ export interface NormalizedInputOptions {
|
|
|
581
583
|
makeAbsoluteExternalsRelative: boolean | 'ifRelativeSource';
|
|
582
584
|
/** @deprecated Use the "manualChunks" output option instead. */
|
|
583
585
|
manualChunks: ManualChunksOption | undefined;
|
|
586
|
+
maxParallelFileOps: number;
|
|
587
|
+
/** @deprecated Use the "maxParallelFileOps" option instead. */
|
|
584
588
|
maxParallelFileReads: number;
|
|
585
589
|
moduleContext: (id: string) => string;
|
|
586
590
|
onwarn: WarningHandler;
|
package/dist/rollup.js
CHANGED
package/dist/shared/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.
|
|
4
|
-
|
|
3
|
+
Rollup.js v2.77.2
|
|
4
|
+
Wed, 27 Jul 2022 05:18:41 GMT - commit 22b2f68aa8638ffaac4de69011e10480f5d50546
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -73,6 +73,7 @@ function mergeInputOptions(config, overrides, defaultOnWarnHandler) {
|
|
|
73
73
|
input: getOption('input') || [],
|
|
74
74
|
makeAbsoluteExternalsRelative: getOption('makeAbsoluteExternalsRelative'),
|
|
75
75
|
manualChunks: getOption('manualChunks'),
|
|
76
|
+
maxParallelFileOps: getOption('maxParallelFileOps'),
|
|
76
77
|
maxParallelFileReads: getOption('maxParallelFileReads'),
|
|
77
78
|
moduleContext: getOption('moduleContext'),
|
|
78
79
|
onwarn: getOnWarn(config, defaultOnWarnHandler),
|
package/dist/shared/rollup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.
|
|
4
|
-
|
|
3
|
+
Rollup.js v2.77.2
|
|
4
|
+
Wed, 27 Jul 2022 05:18:41 GMT - commit 22b2f68aa8638ffaac4de69011e10480f5d50546
|
|
5
5
|
|
|
6
6
|
https://github.com/rollup/rollup
|
|
7
7
|
|
|
@@ -27,7 +27,7 @@ function _interopNamespaceDefault(e) {
|
|
|
27
27
|
return n;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
var version$1 = "2.
|
|
30
|
+
var version$1 = "2.77.2";
|
|
31
31
|
|
|
32
32
|
function ensureArray$1(items) {
|
|
33
33
|
if (Array.isArray(items)) {
|
|
@@ -9105,10 +9105,6 @@ class CallExpression extends CallExpressionBase {
|
|
|
9105
9105
|
this.callee.include(context, false);
|
|
9106
9106
|
}
|
|
9107
9107
|
this.callee.includeCallArguments(context, this.arguments);
|
|
9108
|
-
const returnExpression = this.getReturnExpression();
|
|
9109
|
-
if (!returnExpression.included) {
|
|
9110
|
-
returnExpression.include(context, false);
|
|
9111
|
-
}
|
|
9112
9108
|
}
|
|
9113
9109
|
render(code, options, { renderedSurroundingElement } = BLANK) {
|
|
9114
9110
|
this.callee.render(code, options, {
|
|
@@ -9478,15 +9474,6 @@ class MultiExpression extends ExpressionEntity {
|
|
|
9478
9474
|
}
|
|
9479
9475
|
return false;
|
|
9480
9476
|
}
|
|
9481
|
-
include(context, includeChildrenRecursively) {
|
|
9482
|
-
// This is only relevant to include values that do not have an AST representation,
|
|
9483
|
-
// such as UnknownArrayExpression. Thus we only need to include them once.
|
|
9484
|
-
for (const expression of this.expressions) {
|
|
9485
|
-
if (!expression.included) {
|
|
9486
|
-
expression.include(context, includeChildrenRecursively);
|
|
9487
|
-
}
|
|
9488
|
-
}
|
|
9489
|
-
}
|
|
9490
9477
|
}
|
|
9491
9478
|
|
|
9492
9479
|
class ConditionalExpression extends NodeBase {
|
|
@@ -10403,6 +10390,7 @@ class ImportExpression extends NodeBase {
|
|
|
10403
10390
|
}
|
|
10404
10391
|
setExternalResolution(exportMode, resolution, options, snippets, pluginDriver, accessedGlobalsByScope) {
|
|
10405
10392
|
const { format } = options;
|
|
10393
|
+
this.inlineNamespace = null;
|
|
10406
10394
|
this.resolution = resolution;
|
|
10407
10395
|
const accessedGlobals = [...(accessedImportGlobals[format] || [])];
|
|
10408
10396
|
let helper;
|
|
@@ -13717,7 +13705,7 @@ function trimEmptyImports(dependencies) {
|
|
|
13717
13705
|
}
|
|
13718
13706
|
|
|
13719
13707
|
function iife(magicString, { accessedGlobals, dependencies, exports, hasExports, indent: t, intro, namedExportsMode, outro, snippets, warn }, { compact, esModule, extend, freeze, externalLiveBindings, globals, interop, name, namespaceToStringTag, strict }) {
|
|
13720
|
-
const { _,
|
|
13708
|
+
const { _, getNonArrowFunctionIntro, getPropertyAccess, n } = snippets;
|
|
13721
13709
|
const isNamespaced = name && name.includes('.');
|
|
13722
13710
|
const useVariableAssignment = !extend && !isNamespaced;
|
|
13723
13711
|
if (name && useVariableAssignment && !isLegal(name)) {
|
|
@@ -13756,7 +13744,7 @@ function iife(magicString, { accessedGlobals, dependencies, exports, hasExports,
|
|
|
13756
13744
|
if (hasExports) {
|
|
13757
13745
|
if (name && !(extend && namedExportsMode)) {
|
|
13758
13746
|
wrapperIntro =
|
|
13759
|
-
(useVariableAssignment ?
|
|
13747
|
+
(useVariableAssignment ? `var ${name}` : `this${keypath(name, getPropertyAccess)}`) +
|
|
13760
13748
|
`${_}=${_}${wrapperIntro}`;
|
|
13761
13749
|
}
|
|
13762
13750
|
if (isNamespaced) {
|
|
@@ -21832,37 +21820,6 @@ Parser.acorn = {
|
|
|
21832
21820
|
nonASCIIwhitespace: nonASCIIwhitespace
|
|
21833
21821
|
};
|
|
21834
21822
|
|
|
21835
|
-
class Queue {
|
|
21836
|
-
constructor(maxParallel) {
|
|
21837
|
-
this.maxParallel = maxParallel;
|
|
21838
|
-
this.queue = [];
|
|
21839
|
-
this.workerCount = 0;
|
|
21840
|
-
}
|
|
21841
|
-
run(task) {
|
|
21842
|
-
return new Promise((resolve, reject) => {
|
|
21843
|
-
this.queue.push({ reject, resolve, task });
|
|
21844
|
-
this.work();
|
|
21845
|
-
});
|
|
21846
|
-
}
|
|
21847
|
-
async work() {
|
|
21848
|
-
if (this.workerCount >= this.maxParallel)
|
|
21849
|
-
return;
|
|
21850
|
-
this.workerCount++;
|
|
21851
|
-
let entry;
|
|
21852
|
-
while ((entry = this.queue.shift())) {
|
|
21853
|
-
const { reject, resolve, task } = entry;
|
|
21854
|
-
try {
|
|
21855
|
-
const result = await task();
|
|
21856
|
-
resolve(result);
|
|
21857
|
-
}
|
|
21858
|
-
catch (err) {
|
|
21859
|
-
reject(err);
|
|
21860
|
-
}
|
|
21861
|
-
}
|
|
21862
|
-
this.workerCount--;
|
|
21863
|
-
}
|
|
21864
|
-
}
|
|
21865
|
-
|
|
21866
21823
|
function resolveIdViaPlugins(source, importer, pluginDriver, moduleLoaderResolveId, skip, customOptions, isEntry) {
|
|
21867
21824
|
let skipped = null;
|
|
21868
21825
|
let replaceContext = null;
|
|
@@ -22189,7 +22146,6 @@ class ModuleLoader {
|
|
|
22189
22146
|
this.hasModuleSideEffects = options.treeshake
|
|
22190
22147
|
? options.treeshake.moduleSideEffects
|
|
22191
22148
|
: () => true;
|
|
22192
|
-
this.readQueue = new Queue(options.maxParallelFileReads);
|
|
22193
22149
|
}
|
|
22194
22150
|
async addAdditionalModules(unresolvedModules) {
|
|
22195
22151
|
const result = this.extendLoadModulesPromise(Promise.all(unresolvedModules.map(id => this.loadEntryModule(id, false, undefined, null))));
|
|
@@ -22268,7 +22224,7 @@ class ModuleLoader {
|
|
|
22268
22224
|
timeStart('load modules', 3);
|
|
22269
22225
|
let source;
|
|
22270
22226
|
try {
|
|
22271
|
-
source = await this.
|
|
22227
|
+
source = await this.graph.fileOperationQueue.run(async () => { var _a; return (_a = (await this.pluginDriver.hookFirst('load', [id]))) !== null && _a !== void 0 ? _a : (await require$$0$1.promises.readFile(id, 'utf8')); });
|
|
22272
22228
|
}
|
|
22273
22229
|
catch (err) {
|
|
22274
22230
|
timeEnd('load modules', 3);
|
|
@@ -22925,6 +22881,37 @@ class PluginDriver {
|
|
|
22925
22881
|
}
|
|
22926
22882
|
}
|
|
22927
22883
|
|
|
22884
|
+
class Queue {
|
|
22885
|
+
constructor(maxParallel) {
|
|
22886
|
+
this.maxParallel = maxParallel;
|
|
22887
|
+
this.queue = [];
|
|
22888
|
+
this.workerCount = 0;
|
|
22889
|
+
}
|
|
22890
|
+
run(task) {
|
|
22891
|
+
return new Promise((resolve, reject) => {
|
|
22892
|
+
this.queue.push({ reject, resolve, task });
|
|
22893
|
+
this.work();
|
|
22894
|
+
});
|
|
22895
|
+
}
|
|
22896
|
+
async work() {
|
|
22897
|
+
if (this.workerCount >= this.maxParallel)
|
|
22898
|
+
return;
|
|
22899
|
+
this.workerCount++;
|
|
22900
|
+
let entry;
|
|
22901
|
+
while ((entry = this.queue.shift())) {
|
|
22902
|
+
const { reject, resolve, task } = entry;
|
|
22903
|
+
try {
|
|
22904
|
+
const result = await task();
|
|
22905
|
+
resolve(result);
|
|
22906
|
+
}
|
|
22907
|
+
catch (err) {
|
|
22908
|
+
reject(err);
|
|
22909
|
+
}
|
|
22910
|
+
}
|
|
22911
|
+
this.workerCount--;
|
|
22912
|
+
}
|
|
22913
|
+
}
|
|
22914
|
+
|
|
22928
22915
|
function normalizeEntryModules(entryModules) {
|
|
22929
22916
|
if (Array.isArray(entryModules)) {
|
|
22930
22917
|
return entryModules.map(id => ({
|
|
@@ -22988,6 +22975,7 @@ class Graph {
|
|
|
22988
22975
|
this.pluginDriver = new PluginDriver(this, options, options.plugins, this.pluginCache);
|
|
22989
22976
|
this.acornParser = Parser.extend(...options.acornInjectPlugins);
|
|
22990
22977
|
this.moduleLoader = new ModuleLoader(this, this.modulesById, this.options, this.pluginDriver);
|
|
22978
|
+
this.fileOperationQueue = new Queue(options.maxParallelFileOps);
|
|
22991
22979
|
}
|
|
22992
22980
|
async build() {
|
|
22993
22981
|
timeStart('generate module graph', 2);
|
|
@@ -23184,6 +23172,7 @@ function normalizeInputOptions(config) {
|
|
|
23184
23172
|
const context = (_a = config.context) !== null && _a !== void 0 ? _a : 'undefined';
|
|
23185
23173
|
const onwarn = getOnwarn(config);
|
|
23186
23174
|
const strictDeprecations = config.strictDeprecations || false;
|
|
23175
|
+
const maxParallelFileOps = getmaxParallelFileOps(config, onwarn, strictDeprecations);
|
|
23187
23176
|
const options = {
|
|
23188
23177
|
acorn: getAcorn(config),
|
|
23189
23178
|
acornInjectPlugins: getAcornInjectPlugins(config),
|
|
@@ -23195,7 +23184,8 @@ function normalizeInputOptions(config) {
|
|
|
23195
23184
|
input: getInput(config),
|
|
23196
23185
|
makeAbsoluteExternalsRelative: (_c = config.makeAbsoluteExternalsRelative) !== null && _c !== void 0 ? _c : true,
|
|
23197
23186
|
manualChunks: getManualChunks$1(config, onwarn, strictDeprecations),
|
|
23198
|
-
|
|
23187
|
+
maxParallelFileOps,
|
|
23188
|
+
maxParallelFileReads: maxParallelFileOps,
|
|
23199
23189
|
moduleContext: getModuleContext(config, context),
|
|
23200
23190
|
onwarn,
|
|
23201
23191
|
perf: config.perf || false,
|
|
@@ -23276,12 +23266,17 @@ const getManualChunks$1 = (config, warn, strictDeprecations) => {
|
|
|
23276
23266
|
}
|
|
23277
23267
|
return configManualChunks;
|
|
23278
23268
|
};
|
|
23279
|
-
const
|
|
23269
|
+
const getmaxParallelFileOps = (config, warn, strictDeprecations) => {
|
|
23270
|
+
var _a;
|
|
23280
23271
|
const maxParallelFileReads = config.maxParallelFileReads;
|
|
23281
23272
|
if (typeof maxParallelFileReads === 'number') {
|
|
23282
|
-
|
|
23273
|
+
warnDeprecationWithOptions('The "maxParallelFileReads" option is deprecated. Use the "maxParallelFileOps" option instead.', false, warn, strictDeprecations);
|
|
23274
|
+
}
|
|
23275
|
+
const maxParallelFileOps = (_a = config.maxParallelFileOps) !== null && _a !== void 0 ? _a : maxParallelFileReads;
|
|
23276
|
+
if (typeof maxParallelFileOps === 'number') {
|
|
23277
|
+
if (maxParallelFileOps <= 0)
|
|
23283
23278
|
return Infinity;
|
|
23284
|
-
return
|
|
23279
|
+
return maxParallelFileOps;
|
|
23285
23280
|
}
|
|
23286
23281
|
return 20;
|
|
23287
23282
|
};
|
|
@@ -23757,7 +23752,7 @@ function handleGenerateWrite(isWrite, inputOptions, unsetInputOptions, rawOutput
|
|
|
23757
23752
|
message: 'You must specify "output.file" or "output.dir" for the build.'
|
|
23758
23753
|
});
|
|
23759
23754
|
}
|
|
23760
|
-
await Promise.all(Object.values(generated).map(chunk => writeOutputFile(chunk, outputOptions)));
|
|
23755
|
+
await Promise.all(Object.values(generated).map(chunk => graph.fileOperationQueue.run(() => writeOutputFile(chunk, outputOptions))));
|
|
23761
23756
|
await outputPluginDriver.hookParallel('writeBundle', [outputOptions, generated]);
|
|
23762
23757
|
}
|
|
23763
23758
|
return createOutput(generated);
|
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": "2.
|
|
3
|
+
"version": "2.77.2",
|
|
4
4
|
"description": "Next-generation ES module bundler",
|
|
5
5
|
"main": "dist/rollup.js",
|
|
6
6
|
"module": "dist/es/rollup.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"ci:test:only": "npm run build:cjs && npm run build:bootstrap && npm run test:only",
|
|
18
18
|
"ci:coverage": "npm run build:cjs && npm run build:bootstrap && nyc --reporter lcovonly mocha",
|
|
19
19
|
"lint": "eslint . --fix --cache && prettier --write \"**/*.md\"",
|
|
20
|
-
"lint:nofix": "eslint . && prettier --check \"**/*.md\"",
|
|
20
|
+
"lint:nofix": "eslint . --cache && prettier --check \"**/*.md\"",
|
|
21
21
|
"lint:markdown": "prettier --write \"**/*.md\"",
|
|
22
22
|
"perf": "npm run build:cjs && node --expose-gc scripts/perf.js",
|
|
23
23
|
"perf:debug": "node --inspect-brk scripts/perf-debug.js",
|
|
@@ -69,19 +69,19 @@
|
|
|
69
69
|
"@types/node": "^10.17.60",
|
|
70
70
|
"@types/signal-exit": "^3.0.1",
|
|
71
71
|
"@types/yargs-parser": "^20.2.2",
|
|
72
|
-
"@typescript-eslint/eslint-plugin": "^5.30.
|
|
73
|
-
"@typescript-eslint/parser": "^5.30.
|
|
72
|
+
"@typescript-eslint/eslint-plugin": "^5.30.7",
|
|
73
|
+
"@typescript-eslint/parser": "^5.30.7",
|
|
74
74
|
"acorn": "^8.7.1",
|
|
75
75
|
"acorn-jsx": "^5.3.2",
|
|
76
76
|
"acorn-walk": "^8.2.0",
|
|
77
77
|
"buble": "^0.20.0",
|
|
78
78
|
"chokidar": "^3.5.3",
|
|
79
79
|
"colorette": "^2.0.19",
|
|
80
|
-
"core-js": "^3.23.
|
|
80
|
+
"core-js": "^3.23.5",
|
|
81
81
|
"date-time": "^4.0.0",
|
|
82
82
|
"es5-shim": "^4.6.7",
|
|
83
83
|
"es6-shim": "^0.35.6",
|
|
84
|
-
"eslint": "^8.
|
|
84
|
+
"eslint": "^8.20.0",
|
|
85
85
|
"eslint-config-prettier": "^8.5.0",
|
|
86
86
|
"eslint-plugin-import": "^2.26.0",
|
|
87
87
|
"eslint-plugin-prettier": "^4.2.1",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"pretty-bytes": "^5.6.0",
|
|
101
101
|
"pretty-ms": "^7.0.1",
|
|
102
102
|
"requirejs": "^2.3.6",
|
|
103
|
-
"rollup": "^2.
|
|
103
|
+
"rollup": "^2.77.0",
|
|
104
104
|
"rollup-plugin-license": "^2.8.1",
|
|
105
105
|
"rollup-plugin-string": "^3.0.0",
|
|
106
106
|
"rollup-plugin-terser": "^7.0.2",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"source-map-support": "^0.5.21",
|
|
112
112
|
"sourcemap-codec": "^1.4.8",
|
|
113
113
|
"systemjs": "^6.12.1",
|
|
114
|
-
"terser": "^5.14.
|
|
114
|
+
"terser": "^5.14.2",
|
|
115
115
|
"tslib": "^2.4.0",
|
|
116
116
|
"typescript": "^4.7.4",
|
|
117
117
|
"weak-napi": "^2.0.2",
|