Skip to content

Commit 467f961

Browse files
Merge pull request #164 from rollup/sync-2538304e
docs(en): merge rollup/master into rollup-docs-cn/master @ 2538304
2 parents 52e6602 + 62a104f commit 467f961

File tree

13 files changed

+527
-566
lines changed

13 files changed

+527
-566
lines changed

CHANGELOG.md

+20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# rollup changelog
22

3+
## 4.32.0
4+
5+
_2025-01-24_
6+
7+
### Features
8+
9+
- Add watch.onInvalidate option to trigger actions immediately when a file is changed (#5799)
10+
11+
### Bug Fixes
12+
13+
- Fix incorrect urls in CLI warnings (#5809)
14+
15+
### Pull Requests
16+
17+
- [#5799](https://github.com/rollup/rollup/pull/5799): Feature/watch on invalidate (@drebrez, @lukastaegert)
18+
- [#5808](https://github.com/rollup/rollup/pull/5808): chore(deps): update dependency vite to v6.0.9 [security] (@renovate[bot])
19+
- [#5809](https://github.com/rollup/rollup/pull/5809): fix: avoid duplicate rollupjs.org prefix (@GauBen, @lukastaegert)
20+
- [#5810](https://github.com/rollup/rollup/pull/5810): chore(deps): update dependency @shikijs/vitepress-twoslash to v2 (@renovate[bot])
21+
- [#5811](https://github.com/rollup/rollup/pull/5811): fix(deps): lock file maintenance minor/patch updates (@renovate[bot])
22+
323
## 4.31.0
424

525
_2025-01-19_

browser/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rollup/browser",
3-
"version": "4.31.0",
3+
"version": "4.32.0",
44
"description": "Next-generation ES module bundler browser build",
55
"main": "dist/rollup.browser.js",
66
"module": "dist/es/rollup.browser.js",

cli/run/batchWarnings.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ const deferredHandlers: Record<string, (warnings: RollupLog[]) => void> = {
262262

263263
function defaultBody(log: RollupLog): void {
264264
if (log.url) {
265-
info(getRollupUrl(log.url));
265+
info(log.url);
266266
}
267267

268268
const loc = formatLocation(log);

docs/configuration-options/index.md

+9
Original file line numberDiff line numberDiff line change
@@ -2864,6 +2864,7 @@ interface WatcherOptions {
28642864
exclude?: string | RegExp | (string | RegExp)[];
28652865
include?: string | RegExp | (string | RegExp)[];
28662866
skipWrite?: boolean;
2867+
onInvalidate?: (id: string) => void;
28672868
}
28682869
```
28692870
@@ -2971,6 +2972,14 @@ export default {
29712972
29722973
该选项用于决定是否在触发重新构建时跳过 `bundle.write()` 步骤。
29732974
2975+
### watch.onInvalidate {#watch-oninvalidate}
2976+
2977+
| | |
2978+
| ----: | :--------------------- |
2979+
| 类型: | `(id: string) => void` |
2980+
2981+
一个可选功能,每当构建中包含的模块发生变化时将立即被调用。它会以变化模块的 id 作为参数接收。这与仅在运行构建完成后才被调用的 [`watchChange`](../plugin-development/index.md#watchchange) 插件挂钩不同。例如,如果知道当前构建完成后将启动另一个构建,则可以使用此回调来防止执行额外步骤。由于它会跟踪每次变化,因此该回调可能在整个构建过程中多次被调用。
2982+
29742983
## 废弃选项 {#deprecated-options}
29752984
29762985
☢️ 这些选项已经废弃,可能从未来的 Rollup 版本中移除。

docs/plugin-development/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ interface SourceDescription {
700700
| 类别: | async, parallel |
701701
| 上一个/下一个钩子: | 此钩子可以在构建和输出生成阶段的任何时候触发。如果是这种情况,则当前构建仍将继续,但会安排一个新的构建在当前构建完成后开始,从 [`options`](#options) 开始 |
702702

703-
`--watch` 模式下,每当 Rollup 检测到监视文件的更改时,就会通知插件。如果返回一个 Promise,Rollup 将等待 Promise 解析后再安排另一个构建。此钩子不能由输出插件使用。第二个参数包含更改事件的其他详细信息
703+
每当 Rollup `--watch` 模式下检测到监控文件发生变化时,会通知插件。如果当前正在运行构建,则在构建完成后调用此挂钩。每次有文件变化时都会被调用一次。如果返回一个 Promise,Rollup 将等待 Promise 解决后再安排另一次构建。此挂钩不能由输出插件使用。第二个参数包含变更事件的额外细节。如果您需要在文件发生变化时立即收到通知,可以使用配置选项 [`watch.onInvalidate`](../configuration-options/index.md#watch-oninvalidate)
704704

705705
## 输出生成钩子 {#output-generation-hooks}
706706

0 commit comments

Comments
 (0)