rollup 4.68.4 → 4.68.6

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.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.4
4
- Mon, 16 Nov 2026 08:59:19 GMT - commit 9b2de5068e925a3b07bea67c972de21a347af9d9
3
+ Rollup.js v4.68.6
4
+ Wed, 18 Nov 2026 08:15:34 GMT - commit 2aa77c89eef0113e61b8de29d54c086c1f21a72b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.4
4
- Mon, 16 Nov 2026 08:59:19 GMT - commit 9b2de5068e925a3b07bea67c972de21a347af9d9
3
+ Rollup.js v4.68.6
4
+ Wed, 18 Nov 2026 08:15:34 GMT - commit 2aa77c89eef0113e61b8de29d54c086c1f21a72b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -7473,8 +7473,6 @@ function requireNodefsHandler () {
7473
7473
  STAR
7474
7474
  } = /*@__PURE__*/ requireConstants();
7475
7475
 
7476
- const THROTTLE_MODE_WATCH = 'watch';
7477
-
7478
7476
  const open = promisify(fs.open);
7479
7477
  const stat = promisify(fs.stat);
7480
7478
  const lstat = promisify(fs.lstat);
@@ -7798,7 +7796,6 @@ function requireNodefsHandler () {
7798
7796
  if (parent.has(basename)) return;
7799
7797
 
7800
7798
  const listener = async (path, newStats) => {
7801
- if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return;
7802
7799
  if (!newStats || newStats.mtimeMs === 0) {
7803
7800
  try {
7804
7801
  const newStats = await stat(file);
@@ -9204,6 +9201,12 @@ function requireChokidar () {
9204
9201
  else if (val2 !== undefined) args.push(val1, val2);
9205
9202
  else if (val1 !== undefined) args.push(val1);
9206
9203
 
9204
+ if (event === EV_UNLINK) {
9205
+ const changeThrottler = this._throttled.has(EV_CHANGE) && this._throttled.get(EV_CHANGE).get(path);
9206
+ if (changeThrottler) changeThrottler.clear(false);
9207
+ if (this._pendingChanges) this._pendingChanges.delete(path);
9208
+ }
9209
+
9207
9210
  const awf = opts.awaitWriteFinish;
9208
9211
  let pw;
9209
9212
  if (awf && (pw = this._pendingWrites.get(path))) {
@@ -9251,8 +9254,58 @@ function requireChokidar () {
9251
9254
  }
9252
9255
 
9253
9256
  if (event === EV_CHANGE) {
9254
- const isThrottled = !this._throttle(EV_CHANGE, path, 50);
9255
- if (isThrottled) return this;
9257
+ if (!this._pendingChanges) this._pendingChanges = new Map();
9258
+ const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path;
9259
+ // unwatch() marks the path as ignored synchronously and add() clears the
9260
+ // mark synchronously, so a file that is unwatched and re-added, which
9261
+ // Rollup does on every change on Linux, is still considered watched while
9262
+ // the asynchronous re-registration is in progress. Both store paths with
9263
+ // forward slashes, also on Windows.
9264
+ const isUnwatched = () =>
9265
+ this._ignoredPaths.has(normalizePathToUnix(sysPath.resolve(fullPath)));
9266
+ const isEmptyFile = (stats) => Boolean(stats && stats.isFile() && stats.size === 0);
9267
+ const throttler = this._throttle(EV_CHANGE, path, 50, (suppressedCount) => {
9268
+ const pending = this._pendingChanges.get(path);
9269
+ this._pendingChanges.delete(path);
9270
+ if (suppressedCount === 0 || !pending || !pending.replay || isUnwatched()) return;
9271
+ void this._emit(EV_CHANGE, fullPath, ...pending.args.slice(2));
9272
+ });
9273
+ if (!throttler) {
9274
+ const pending = this._pendingChanges.get(path);
9275
+ const previousStats = pending && pending.args[2];
9276
+ const stats = args[2];
9277
+ // Only changes with stats are replayed. fsevents reports changes without
9278
+ // stats, so its duplicate notifications cannot be told apart from new
9279
+ // writes and are discarded as before.
9280
+ if (
9281
+ previousStats && stats &&
9282
+ (previousStats.size !== stats.size ||
9283
+ previousStats.mtimeMs !== stats.mtimeMs ||
9284
+ previousStats.ino !== stats.ino)
9285
+ ) {
9286
+ pending.args = args;
9287
+ pending.replay = true;
9288
+ // The data of a held truncate-then-write landed: publish it now.
9289
+ if (pending.held && !isEmptyFile(stats)) pending.held.release();
9290
+ }
9291
+ return this;
9292
+ }
9293
+ const pending = { args, replay: false, held: undefined };
9294
+ this._pendingChanges.set(path, pending);
9295
+ if (isEmptyFile(args[2])) {
9296
+ // A change that sees an empty file is usually the truncation of a write
9297
+ // that is still in progress. Hold it briefly so the data is reported in
9298
+ // the same change.
9299
+ const release = () => {
9300
+ clearTimeout(pending.held.timer);
9301
+ pending.held = undefined;
9302
+ if (this._pendingChanges.get(path) !== pending || this.closed || isUnwatched()) return;
9303
+ pending.replay = false;
9304
+ this.emitWithAll(EV_CHANGE, pending.args);
9305
+ };
9306
+ pending.held = { timer: setTimeout(release, 10), release };
9307
+ return this;
9308
+ }
9256
9309
  }
9257
9310
 
9258
9311
  if (opts.alwaysStat && val1 === undefined &&
@@ -9294,7 +9347,7 @@ function requireChokidar () {
9294
9347
  * @param {Number} timeout duration of time to suppress duplicate actions
9295
9348
  * @returns {Object|false} tracking object or false if action should be suppressed
9296
9349
  */
9297
- _throttle(actionType, path, timeout) {
9350
+ _throttle(actionType, path, timeout, onRelease) {
9298
9351
  if (!this._throttled.has(actionType)) {
9299
9352
  this._throttled.set(actionType, new Map());
9300
9353
  }
@@ -9310,12 +9363,13 @@ function requireChokidar () {
9310
9363
  }
9311
9364
 
9312
9365
  let timeoutObject;
9313
- const clear = () => {
9366
+ const clear = (invokeRelease = true) => {
9314
9367
  const item = action.get(path);
9315
9368
  const count = item ? item.count : 0;
9316
9369
  action.delete(path);
9317
9370
  clearTimeout(timeoutObject);
9318
9371
  if (item) clearTimeout(item.timeoutObject);
9372
+ if (invokeRelease && onRelease) onRelease(count);
9319
9373
  return count;
9320
9374
  };
9321
9375
  timeoutObject = setTimeout(clear, timeout);
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.4
4
- Mon, 16 Nov 2026 08:59:19 GMT - commit 9b2de5068e925a3b07bea67c972de21a347af9d9
3
+ Rollup.js v4.68.6
4
+ Wed, 18 Nov 2026 08:15:34 GMT - commit 2aa77c89eef0113e61b8de29d54c086c1f21a72b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.4
4
- Mon, 16 Nov 2026 08:59:19 GMT - commit 9b2de5068e925a3b07bea67c972de21a347af9d9
3
+ Rollup.js v4.68.6
4
+ Wed, 18 Nov 2026 08:15:34 GMT - commit 2aa77c89eef0113e61b8de29d54c086c1f21a72b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/parseAst.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.4
4
- Mon, 16 Nov 2026 08:59:19 GMT - commit 9b2de5068e925a3b07bea67c972de21a347af9d9
3
+ Rollup.js v4.68.6
4
+ Wed, 18 Nov 2026 08:15:34 GMT - commit 2aa77c89eef0113e61b8de29d54c086c1f21a72b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.4
4
- Mon, 16 Nov 2026 08:59:19 GMT - commit 9b2de5068e925a3b07bea67c972de21a347af9d9
3
+ Rollup.js v4.68.6
4
+ Wed, 18 Nov 2026 08:15:34 GMT - commit 2aa77c89eef0113e61b8de29d54c086c1f21a72b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.4
4
- Mon, 16 Nov 2026 08:59:19 GMT - commit 9b2de5068e925a3b07bea67c972de21a347af9d9
3
+ Rollup.js v4.68.6
4
+ Wed, 18 Nov 2026 08:15:34 GMT - commit 2aa77c89eef0113e61b8de29d54c086c1f21a72b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.4
4
- Mon, 16 Nov 2026 08:59:19 GMT - commit 9b2de5068e925a3b07bea67c972de21a347af9d9
3
+ Rollup.js v4.68.6
4
+ Wed, 18 Nov 2026 08:15:34 GMT - commit 2aa77c89eef0113e61b8de29d54c086c1f21a72b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -7469,8 +7469,6 @@ function requireNodefsHandler () {
7469
7469
  STAR
7470
7470
  } = /*@__PURE__*/ requireConstants();
7471
7471
 
7472
- const THROTTLE_MODE_WATCH = 'watch';
7473
-
7474
7472
  const open = promisify(fs.open);
7475
7473
  const stat = promisify(fs.stat);
7476
7474
  const lstat = promisify(fs.lstat);
@@ -7794,7 +7792,6 @@ function requireNodefsHandler () {
7794
7792
  if (parent.has(basename)) return;
7795
7793
 
7796
7794
  const listener = async (path, newStats) => {
7797
- if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return;
7798
7795
  if (!newStats || newStats.mtimeMs === 0) {
7799
7796
  try {
7800
7797
  const newStats = await stat(file);
@@ -9200,6 +9197,12 @@ function requireChokidar () {
9200
9197
  else if (val2 !== undefined) args.push(val1, val2);
9201
9198
  else if (val1 !== undefined) args.push(val1);
9202
9199
 
9200
+ if (event === EV_UNLINK) {
9201
+ const changeThrottler = this._throttled.has(EV_CHANGE) && this._throttled.get(EV_CHANGE).get(path);
9202
+ if (changeThrottler) changeThrottler.clear(false);
9203
+ if (this._pendingChanges) this._pendingChanges.delete(path);
9204
+ }
9205
+
9203
9206
  const awf = opts.awaitWriteFinish;
9204
9207
  let pw;
9205
9208
  if (awf && (pw = this._pendingWrites.get(path))) {
@@ -9247,8 +9250,58 @@ function requireChokidar () {
9247
9250
  }
9248
9251
 
9249
9252
  if (event === EV_CHANGE) {
9250
- const isThrottled = !this._throttle(EV_CHANGE, path, 50);
9251
- if (isThrottled) return this;
9253
+ if (!this._pendingChanges) this._pendingChanges = new Map();
9254
+ const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path;
9255
+ // unwatch() marks the path as ignored synchronously and add() clears the
9256
+ // mark synchronously, so a file that is unwatched and re-added, which
9257
+ // Rollup does on every change on Linux, is still considered watched while
9258
+ // the asynchronous re-registration is in progress. Both store paths with
9259
+ // forward slashes, also on Windows.
9260
+ const isUnwatched = () =>
9261
+ this._ignoredPaths.has(normalizePathToUnix(sysPath.resolve(fullPath)));
9262
+ const isEmptyFile = (stats) => Boolean(stats && stats.isFile() && stats.size === 0);
9263
+ const throttler = this._throttle(EV_CHANGE, path, 50, (suppressedCount) => {
9264
+ const pending = this._pendingChanges.get(path);
9265
+ this._pendingChanges.delete(path);
9266
+ if (suppressedCount === 0 || !pending || !pending.replay || isUnwatched()) return;
9267
+ void this._emit(EV_CHANGE, fullPath, ...pending.args.slice(2));
9268
+ });
9269
+ if (!throttler) {
9270
+ const pending = this._pendingChanges.get(path);
9271
+ const previousStats = pending && pending.args[2];
9272
+ const stats = args[2];
9273
+ // Only changes with stats are replayed. fsevents reports changes without
9274
+ // stats, so its duplicate notifications cannot be told apart from new
9275
+ // writes and are discarded as before.
9276
+ if (
9277
+ previousStats && stats &&
9278
+ (previousStats.size !== stats.size ||
9279
+ previousStats.mtimeMs !== stats.mtimeMs ||
9280
+ previousStats.ino !== stats.ino)
9281
+ ) {
9282
+ pending.args = args;
9283
+ pending.replay = true;
9284
+ // The data of a held truncate-then-write landed: publish it now.
9285
+ if (pending.held && !isEmptyFile(stats)) pending.held.release();
9286
+ }
9287
+ return this;
9288
+ }
9289
+ const pending = { args, replay: false, held: undefined };
9290
+ this._pendingChanges.set(path, pending);
9291
+ if (isEmptyFile(args[2])) {
9292
+ // A change that sees an empty file is usually the truncation of a write
9293
+ // that is still in progress. Hold it briefly so the data is reported in
9294
+ // the same change.
9295
+ const release = () => {
9296
+ clearTimeout(pending.held.timer);
9297
+ pending.held = undefined;
9298
+ if (this._pendingChanges.get(path) !== pending || this.closed || isUnwatched()) return;
9299
+ pending.replay = false;
9300
+ this.emitWithAll(EV_CHANGE, pending.args);
9301
+ };
9302
+ pending.held = { timer: setTimeout(release, 10), release };
9303
+ return this;
9304
+ }
9252
9305
  }
9253
9306
 
9254
9307
  if (opts.alwaysStat && val1 === undefined &&
@@ -9290,7 +9343,7 @@ function requireChokidar () {
9290
9343
  * @param {Number} timeout duration of time to suppress duplicate actions
9291
9344
  * @returns {Object|false} tracking object or false if action should be suppressed
9292
9345
  */
9293
- _throttle(actionType, path, timeout) {
9346
+ _throttle(actionType, path, timeout, onRelease) {
9294
9347
  if (!this._throttled.has(actionType)) {
9295
9348
  this._throttled.set(actionType, new Map());
9296
9349
  }
@@ -9306,12 +9359,13 @@ function requireChokidar () {
9306
9359
  }
9307
9360
 
9308
9361
  let timeoutObject;
9309
- const clear = () => {
9362
+ const clear = (invokeRelease = true) => {
9310
9363
  const item = action.get(path);
9311
9364
  const count = item ? item.count : 0;
9312
9365
  action.delete(path);
9313
9366
  clearTimeout(timeoutObject);
9314
9367
  if (item) clearTimeout(item.timeoutObject);
9368
+ if (invokeRelease && onRelease) onRelease(count);
9315
9369
  return count;
9316
9370
  };
9317
9371
  timeoutObject = setTimeout(clear, timeout);
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.4
4
- Mon, 16 Nov 2026 08:59:19 GMT - commit 9b2de5068e925a3b07bea67c972de21a347af9d9
3
+ Rollup.js v4.68.6
4
+ Wed, 18 Nov 2026 08:15:34 GMT - commit 2aa77c89eef0113e61b8de29d54c086c1f21a72b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.4
4
- Mon, 16 Nov 2026 08:59:19 GMT - commit 9b2de5068e925a3b07bea67c972de21a347af9d9
3
+ Rollup.js v4.68.6
4
+ Wed, 18 Nov 2026 08:15:34 GMT - commit 2aa77c89eef0113e61b8de29d54c086c1f21a72b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.4
4
- Mon, 16 Nov 2026 08:59:19 GMT - commit 9b2de5068e925a3b07bea67c972de21a347af9d9
3
+ Rollup.js v4.68.6
4
+ Wed, 18 Nov 2026 08:15:34 GMT - commit 2aa77c89eef0113e61b8de29d54c086c1f21a72b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7