rollup 2.61.0 → 2.64.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/CHANGELOG.md +88 -0
- package/dist/bin/rollup +11 -23
- package/dist/es/rollup.browser.js +3 -3
- package/dist/es/rollup.js +4 -2
- package/dist/es/shared/rollup.js +382 -268
- package/dist/es/shared/watch.js +22 -18
- package/dist/loadConfigFile.js +3 -2
- package/dist/rollup.browser.js +3 -3
- package/dist/rollup.browser.js.map +1 -1
- package/dist/rollup.d.ts +19 -3
- package/dist/rollup.js +4 -2
- package/dist/shared/index.js +15 -13
- package/dist/shared/loadConfigFile.js +10 -11
- package/dist/shared/mergeOptions.js +12 -5
- package/dist/shared/rollup.js +427 -310
- package/dist/shared/watch-cli.js +21 -29
- package/dist/shared/watch.js +8 -18
- package/package.json +9 -9
package/dist/shared/watch-cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.
|
|
4
|
-
|
|
3
|
+
Rollup.js v2.64.0
|
|
4
|
+
Fri, 14 Jan 2022 14:02:32 GMT - commit 82a3e2634a9d51b5040752e4fb2fd264651d504e
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
@@ -23,9 +23,10 @@ require('stream');
|
|
|
23
23
|
require('os');
|
|
24
24
|
require('./mergeOptions.js');
|
|
25
25
|
require('module');
|
|
26
|
+
require('process');
|
|
27
|
+
require('perf_hooks');
|
|
26
28
|
require('crypto');
|
|
27
29
|
require('url');
|
|
28
|
-
require('process');
|
|
29
30
|
require('tty');
|
|
30
31
|
|
|
31
32
|
function timeZone(date = new Date()) {
|
|
@@ -353,10 +354,9 @@ async function watch(command) {
|
|
|
353
354
|
process.env.ROLLUP_WATCH = 'true';
|
|
354
355
|
const isTTY = process.stderr.isTTY;
|
|
355
356
|
const silent = command.silent;
|
|
356
|
-
let configs;
|
|
357
|
-
let warnings;
|
|
358
357
|
let watcher;
|
|
359
358
|
let configWatcher;
|
|
359
|
+
let resetScreen;
|
|
360
360
|
const configFile = command.config ? cli.getConfigPath(command.config) : null;
|
|
361
361
|
onExit(close);
|
|
362
362
|
process.on('uncaughtException', close);
|
|
@@ -365,10 +365,9 @@ async function watch(command) {
|
|
|
365
365
|
process.stdin.resume();
|
|
366
366
|
}
|
|
367
367
|
async function loadConfigFromFileAndTrack(configFile) {
|
|
368
|
-
let reloadingConfig = false;
|
|
369
|
-
let aborted = false;
|
|
370
368
|
let configFileData = null;
|
|
371
|
-
|
|
369
|
+
let configFileRevision = 0;
|
|
370
|
+
configWatcher = index.chokidar.watch(configFile).on('change', reloadConfigFile);
|
|
372
371
|
await reloadConfigFile();
|
|
373
372
|
async function reloadConfigFile() {
|
|
374
373
|
try {
|
|
@@ -376,31 +375,22 @@ async function watch(command) {
|
|
|
376
375
|
if (newConfigFileData === configFileData) {
|
|
377
376
|
return;
|
|
378
377
|
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
378
|
+
configFileRevision++;
|
|
379
|
+
const currentConfigFileRevision = configFileRevision;
|
|
383
380
|
if (configFileData) {
|
|
384
381
|
loadConfigFile_js.stderr(`\nReloading updated config...`);
|
|
385
382
|
}
|
|
386
383
|
configFileData = newConfigFileData;
|
|
387
|
-
|
|
388
|
-
(
|
|
389
|
-
|
|
390
|
-
if (aborted) {
|
|
391
|
-
aborted = false;
|
|
392
|
-
reloadConfigFile();
|
|
384
|
+
const { options, warnings } = await loadConfigFile_js.loadAndParseConfigFile(configFile, command);
|
|
385
|
+
if (currentConfigFileRevision !== configFileRevision) {
|
|
386
|
+
return;
|
|
393
387
|
}
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
watcher.close();
|
|
397
|
-
}
|
|
398
|
-
start(configs);
|
|
388
|
+
if (watcher) {
|
|
389
|
+
watcher.close();
|
|
399
390
|
}
|
|
391
|
+
start(options, warnings);
|
|
400
392
|
}
|
|
401
393
|
catch (err) {
|
|
402
|
-
configs = [];
|
|
403
|
-
reloadingConfig = false;
|
|
404
394
|
loadConfigFile_js.handleError(err, true);
|
|
405
395
|
}
|
|
406
396
|
}
|
|
@@ -409,11 +399,10 @@ async function watch(command) {
|
|
|
409
399
|
await loadConfigFromFileAndTrack(configFile);
|
|
410
400
|
}
|
|
411
401
|
else {
|
|
412
|
-
|
|
413
|
-
start(
|
|
402
|
+
const { options, warnings } = await cli.loadConfigFromCommand(command);
|
|
403
|
+
start(options, warnings);
|
|
414
404
|
}
|
|
415
|
-
|
|
416
|
-
function start(configs) {
|
|
405
|
+
function start(configs, warnings) {
|
|
417
406
|
try {
|
|
418
407
|
watcher = rollup.watch(configs);
|
|
419
408
|
}
|
|
@@ -428,6 +417,9 @@ async function watch(command) {
|
|
|
428
417
|
break;
|
|
429
418
|
case 'START':
|
|
430
419
|
if (!silent) {
|
|
420
|
+
if (!resetScreen) {
|
|
421
|
+
resetScreen = getResetScreen(configs, isTTY);
|
|
422
|
+
}
|
|
431
423
|
resetScreen(loadConfigFile_js.underline(`rollup v${rollup.version}`));
|
|
432
424
|
}
|
|
433
425
|
break;
|
package/dist/shared/watch.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
@license
|
|
3
|
-
Rollup.js v2.
|
|
4
|
-
|
|
3
|
+
Rollup.js v2.64.0
|
|
4
|
+
Fri, 14 Jan 2022 14:02:32 GMT - commit 82a3e2634a9d51b5040752e4fb2fd264651d504e
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
@@ -10,30 +10,19 @@
|
|
|
10
10
|
*/
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
const
|
|
13
|
+
const require$$0 = require('path');
|
|
14
14
|
const rollup = require('./rollup.js');
|
|
15
15
|
const mergeOptions = require('./mergeOptions.js');
|
|
16
16
|
const require$$2 = require('os');
|
|
17
17
|
const index = require('./index.js');
|
|
18
|
+
require('process');
|
|
19
|
+
require('perf_hooks');
|
|
18
20
|
require('crypto');
|
|
19
21
|
require('fs');
|
|
20
22
|
require('events');
|
|
21
23
|
require('util');
|
|
22
24
|
require('stream');
|
|
23
25
|
|
|
24
|
-
function _interopNamespaceDefault(e) {
|
|
25
|
-
const n = Object.create(null);
|
|
26
|
-
if (e) {
|
|
27
|
-
for (const k in e) {
|
|
28
|
-
n[k] = e[k];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
n.default = e;
|
|
32
|
-
return n;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
|
|
36
|
-
|
|
37
26
|
class FileWatcher {
|
|
38
27
|
constructor(task, chokidarOptions) {
|
|
39
28
|
this.transformWatchers = new Map();
|
|
@@ -56,8 +45,9 @@ class FileWatcher {
|
|
|
56
45
|
}
|
|
57
46
|
}
|
|
58
47
|
watch(id, isTransformDependency) {
|
|
48
|
+
var _a;
|
|
59
49
|
if (isTransformDependency) {
|
|
60
|
-
const watcher = this.transformWatchers.get(id)
|
|
50
|
+
const watcher = (_a = this.transformWatchers.get(id)) !== null && _a !== void 0 ? _a : this.createWatcher(id);
|
|
61
51
|
watcher.add(id);
|
|
62
52
|
this.transformWatchers.set(id, watcher);
|
|
63
53
|
}
|
|
@@ -192,7 +182,7 @@ class Task {
|
|
|
192
182
|
this.outputs = this.options.output;
|
|
193
183
|
this.outputFiles = this.outputs.map(output => {
|
|
194
184
|
if (output.file || output.dir)
|
|
195
|
-
return
|
|
185
|
+
return require$$0.resolve(output.file || output.dir);
|
|
196
186
|
return undefined;
|
|
197
187
|
});
|
|
198
188
|
const watchOptions = this.options.watch || {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rollup",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.64.0",
|
|
4
4
|
"description": "Next-generation ES module bundler",
|
|
5
5
|
"main": "dist/rollup.js",
|
|
6
6
|
"module": "dist/es/rollup.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"_postinstall": "husky install",
|
|
26
26
|
"postpublish": "pinst --enable && git push && git push --tags",
|
|
27
27
|
"prepare": "husky install && npm run build",
|
|
28
|
-
"prepublishOnly": "pinst --disable
|
|
28
|
+
"prepublishOnly": "pinst --disable",
|
|
29
29
|
"security": "npm audit",
|
|
30
30
|
"test": "npm run build && npm run test:all",
|
|
31
31
|
"test:cjs": "npm run build:cjs && npm run test:only",
|
|
@@ -62,23 +62,23 @@
|
|
|
62
62
|
"@rollup/plugin-buble": "^0.21.3",
|
|
63
63
|
"@rollup/plugin-commonjs": "^21.0.1",
|
|
64
64
|
"@rollup/plugin-json": "^4.1.0",
|
|
65
|
-
"@rollup/plugin-node-resolve": "^13.
|
|
65
|
+
"@rollup/plugin-node-resolve": "^13.1.1",
|
|
66
66
|
"@rollup/plugin-replace": "^3.0.0",
|
|
67
67
|
"@rollup/plugin-typescript": "^8.2.5",
|
|
68
|
-
"@rollup/pluginutils": "^4.1.
|
|
68
|
+
"@rollup/pluginutils": "^4.1.2",
|
|
69
69
|
"@types/node": "^10.17.60",
|
|
70
70
|
"@types/require-relative": "^0.8.0",
|
|
71
71
|
"@types/signal-exit": "^3.0.1",
|
|
72
72
|
"@types/yargs-parser": "^20.2.1",
|
|
73
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
74
|
-
"@typescript-eslint/parser": "^5.
|
|
73
|
+
"@typescript-eslint/eslint-plugin": "^5.7.0",
|
|
74
|
+
"@typescript-eslint/parser": "^5.7.0",
|
|
75
75
|
"acorn": "^8.6.0",
|
|
76
76
|
"acorn-jsx": "^5.3.2",
|
|
77
77
|
"acorn-walk": "^8.2.0",
|
|
78
78
|
"buble": "^0.20.0",
|
|
79
79
|
"chokidar": "^3.5.2",
|
|
80
80
|
"colorette": "^2.0.16",
|
|
81
|
-
"core-js": "^3.
|
|
81
|
+
"core-js": "^3.20.0",
|
|
82
82
|
"date-time": "^4.0.0",
|
|
83
83
|
"es5-shim": "^4.6.2",
|
|
84
84
|
"es6-shim": "^0.35.6",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"pretty-ms": "^7.0.1",
|
|
103
103
|
"require-relative": "^0.8.7",
|
|
104
104
|
"requirejs": "^2.3.6",
|
|
105
|
-
"rollup": "^2.
|
|
105
|
+
"rollup": "^2.61.1",
|
|
106
106
|
"rollup-plugin-license": "^2.5.0",
|
|
107
107
|
"rollup-plugin-string": "^3.0.0",
|
|
108
108
|
"rollup-plugin-terser": "^7.0.2",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"systemjs": "^6.11.0",
|
|
117
117
|
"terser": "^5.10.0",
|
|
118
118
|
"tslib": "^2.3.1",
|
|
119
|
-
"typescript": "^4.5.
|
|
119
|
+
"typescript": "^4.5.4",
|
|
120
120
|
"weak-napi": "^2.0.2",
|
|
121
121
|
"yargs-parser": "^20.2.9"
|
|
122
122
|
},
|