rollup 2.61.1 → 2.65.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 +96 -0
- package/LICENSE.md +0 -7
- package/dist/bin/rollup +14 -68
- package/dist/es/rollup.browser.js +3 -3
- package/dist/es/rollup.js +4 -2
- package/dist/es/shared/rollup.js +453 -294
- package/dist/es/shared/watch.js +31 -19
- 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 +21 -3
- package/dist/rollup.js +4 -2
- package/dist/shared/index.js +24 -14
- package/dist/shared/loadConfigFile.js +10 -11
- package/dist/shared/mergeOptions.js +12 -5
- package/dist/shared/rollup.js +502 -340
- package/dist/shared/watch-cli.js +21 -30
- package/dist/shared/watch.js +8 -18
- package/package.json +18 -20
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.65.0
|
|
4
|
+
Fri, 21 Jan 2022 07:42:35 GMT - commit bebc50ddb613d240a03988d51787fd71b1a3914f
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
https://github.com/rollup/rollup
|
|
@@ -22,10 +22,10 @@ require('util');
|
|
|
22
22
|
require('stream');
|
|
23
23
|
require('os');
|
|
24
24
|
require('./mergeOptions.js');
|
|
25
|
-
require('
|
|
25
|
+
require('process');
|
|
26
|
+
require('perf_hooks');
|
|
26
27
|
require('crypto');
|
|
27
28
|
require('url');
|
|
28
|
-
require('process');
|
|
29
29
|
require('tty');
|
|
30
30
|
|
|
31
31
|
function timeZone(date = new Date()) {
|
|
@@ -353,10 +353,9 @@ async function watch(command) {
|
|
|
353
353
|
process.env.ROLLUP_WATCH = 'true';
|
|
354
354
|
const isTTY = process.stderr.isTTY;
|
|
355
355
|
const silent = command.silent;
|
|
356
|
-
let configs;
|
|
357
|
-
let warnings;
|
|
358
356
|
let watcher;
|
|
359
357
|
let configWatcher;
|
|
358
|
+
let resetScreen;
|
|
360
359
|
const configFile = command.config ? cli.getConfigPath(command.config) : null;
|
|
361
360
|
onExit(close);
|
|
362
361
|
process.on('uncaughtException', close);
|
|
@@ -365,10 +364,9 @@ async function watch(command) {
|
|
|
365
364
|
process.stdin.resume();
|
|
366
365
|
}
|
|
367
366
|
async function loadConfigFromFileAndTrack(configFile) {
|
|
368
|
-
let reloadingConfig = false;
|
|
369
|
-
let aborted = false;
|
|
370
367
|
let configFileData = null;
|
|
371
|
-
|
|
368
|
+
let configFileRevision = 0;
|
|
369
|
+
configWatcher = index.chokidar.watch(configFile).on('change', reloadConfigFile);
|
|
372
370
|
await reloadConfigFile();
|
|
373
371
|
async function reloadConfigFile() {
|
|
374
372
|
try {
|
|
@@ -376,31 +374,22 @@ async function watch(command) {
|
|
|
376
374
|
if (newConfigFileData === configFileData) {
|
|
377
375
|
return;
|
|
378
376
|
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
377
|
+
configFileRevision++;
|
|
378
|
+
const currentConfigFileRevision = configFileRevision;
|
|
383
379
|
if (configFileData) {
|
|
384
380
|
loadConfigFile_js.stderr(`\nReloading updated config...`);
|
|
385
381
|
}
|
|
386
382
|
configFileData = newConfigFileData;
|
|
387
|
-
|
|
388
|
-
(
|
|
389
|
-
|
|
390
|
-
if (aborted) {
|
|
391
|
-
aborted = false;
|
|
392
|
-
reloadConfigFile();
|
|
383
|
+
const { options, warnings } = await loadConfigFile_js.loadAndParseConfigFile(configFile, command);
|
|
384
|
+
if (currentConfigFileRevision !== configFileRevision) {
|
|
385
|
+
return;
|
|
393
386
|
}
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
watcher.close();
|
|
397
|
-
}
|
|
398
|
-
start(configs);
|
|
387
|
+
if (watcher) {
|
|
388
|
+
watcher.close();
|
|
399
389
|
}
|
|
390
|
+
start(options, warnings);
|
|
400
391
|
}
|
|
401
392
|
catch (err) {
|
|
402
|
-
configs = [];
|
|
403
|
-
reloadingConfig = false;
|
|
404
393
|
loadConfigFile_js.handleError(err, true);
|
|
405
394
|
}
|
|
406
395
|
}
|
|
@@ -409,11 +398,10 @@ async function watch(command) {
|
|
|
409
398
|
await loadConfigFromFileAndTrack(configFile);
|
|
410
399
|
}
|
|
411
400
|
else {
|
|
412
|
-
|
|
413
|
-
start(
|
|
401
|
+
const { options, warnings } = await cli.loadConfigFromCommand(command);
|
|
402
|
+
start(options, warnings);
|
|
414
403
|
}
|
|
415
|
-
|
|
416
|
-
function start(configs) {
|
|
404
|
+
function start(configs, warnings) {
|
|
417
405
|
try {
|
|
418
406
|
watcher = rollup.watch(configs);
|
|
419
407
|
}
|
|
@@ -428,6 +416,9 @@ async function watch(command) {
|
|
|
428
416
|
break;
|
|
429
417
|
case 'START':
|
|
430
418
|
if (!silent) {
|
|
419
|
+
if (!resetScreen) {
|
|
420
|
+
resetScreen = getResetScreen(configs, isTTY);
|
|
421
|
+
}
|
|
431
422
|
resetScreen(loadConfigFile_js.underline(`rollup v${rollup.version}`));
|
|
432
423
|
}
|
|
433
424
|
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.65.0
|
|
4
|
+
Fri, 21 Jan 2022 07:42:35 GMT - commit bebc50ddb613d240a03988d51787fd71b1a3914f
|
|
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.65.0",
|
|
4
4
|
"description": "Next-generation ES module bundler",
|
|
5
5
|
"main": "dist/rollup.js",
|
|
6
6
|
"module": "dist/es/rollup.js",
|
|
@@ -58,33 +58,32 @@
|
|
|
58
58
|
"fsevents": "~2.3.2"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@rollup/plugin-alias": "^3.1.
|
|
61
|
+
"@rollup/plugin-alias": "^3.1.9",
|
|
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.
|
|
66
|
-
"@rollup/plugin-replace": "^3.0.
|
|
65
|
+
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
66
|
+
"@rollup/plugin-replace": "^3.0.1",
|
|
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
|
-
"@types/require-relative": "^0.8.0",
|
|
71
70
|
"@types/signal-exit": "^3.0.1",
|
|
72
71
|
"@types/yargs-parser": "^20.2.1",
|
|
73
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
74
|
-
"@typescript-eslint/parser": "^5.
|
|
75
|
-
"acorn": "^8.
|
|
72
|
+
"@typescript-eslint/eslint-plugin": "^5.10.0",
|
|
73
|
+
"@typescript-eslint/parser": "^5.10.0",
|
|
74
|
+
"acorn": "^8.7.0",
|
|
76
75
|
"acorn-jsx": "^5.3.2",
|
|
77
76
|
"acorn-walk": "^8.2.0",
|
|
78
77
|
"buble": "^0.20.0",
|
|
79
|
-
"chokidar": "^3.5.
|
|
78
|
+
"chokidar": "^3.5.3",
|
|
80
79
|
"colorette": "^2.0.16",
|
|
81
|
-
"core-js": "^3.
|
|
80
|
+
"core-js": "^3.20.3",
|
|
82
81
|
"date-time": "^4.0.0",
|
|
83
|
-
"es5-shim": "^4.6.
|
|
82
|
+
"es5-shim": "^4.6.4",
|
|
84
83
|
"es6-shim": "^0.35.6",
|
|
85
|
-
"eslint": "^8.
|
|
84
|
+
"eslint": "^8.7.0",
|
|
86
85
|
"eslint-config-prettier": "^8.3.0",
|
|
87
|
-
"eslint-plugin-import": "^2.25.
|
|
86
|
+
"eslint-plugin-import": "^2.25.4",
|
|
88
87
|
"eslint-plugin-prettier": "^4.0.0",
|
|
89
88
|
"execa": "^5.1.1",
|
|
90
89
|
"fixturify": "^2.1.1",
|
|
@@ -94,21 +93,20 @@
|
|
|
94
93
|
"lint-staged": "^10.5.4",
|
|
95
94
|
"locate-character": "^2.0.5",
|
|
96
95
|
"magic-string": "^0.25.7",
|
|
97
|
-
"mocha": "^9.1.
|
|
96
|
+
"mocha": "^9.1.4",
|
|
98
97
|
"nyc": "^15.1.0",
|
|
99
98
|
"pinst": "^2.1.6",
|
|
100
99
|
"prettier": "^2.5.1",
|
|
101
100
|
"pretty-bytes": "^5.6.0",
|
|
102
101
|
"pretty-ms": "^7.0.1",
|
|
103
|
-
"require-relative": "^0.8.7",
|
|
104
102
|
"requirejs": "^2.3.6",
|
|
105
|
-
"rollup": "^2.
|
|
106
|
-
"rollup-plugin-license": "^2.
|
|
103
|
+
"rollup": "^2.64.0",
|
|
104
|
+
"rollup-plugin-license": "^2.6.1",
|
|
107
105
|
"rollup-plugin-string": "^3.0.0",
|
|
108
106
|
"rollup-plugin-terser": "^7.0.2",
|
|
109
107
|
"rollup-plugin-thatworks": "^1.0.4",
|
|
110
108
|
"sander": "^0.6.0",
|
|
111
|
-
"shx": "^0.3.
|
|
109
|
+
"shx": "^0.3.4",
|
|
112
110
|
"signal-exit": "^3.0.6",
|
|
113
111
|
"source-map": "^0.7.3",
|
|
114
112
|
"source-map-support": "^0.5.21",
|
|
@@ -116,7 +114,7 @@
|
|
|
116
114
|
"systemjs": "^6.11.0",
|
|
117
115
|
"terser": "^5.10.0",
|
|
118
116
|
"tslib": "^2.3.1",
|
|
119
|
-
"typescript": "^4.5.
|
|
117
|
+
"typescript": "^4.5.5",
|
|
120
118
|
"weak-napi": "^2.0.2",
|
|
121
119
|
"yargs-parser": "^20.2.9"
|
|
122
120
|
},
|