Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(en): merge rollup/master into rollup-docs-cn/master @ 2538304e #164

Merged
merged 8 commits into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# rollup changelog

## 4.32.0

_2025-01-24_

### Features

- Add watch.onInvalidate option to trigger actions immediately when a file is changed (#5799)

### Bug Fixes

- Fix incorrect urls in CLI warnings (#5809)

### Pull Requests

- [#5799](https://github.com/rollup/rollup/pull/5799): Feature/watch on invalidate (@drebrez, @lukastaegert)
- [#5808](https://github.com/rollup/rollup/pull/5808): chore(deps): update dependency vite to v6.0.9 [security] (@renovate[bot])
- [#5809](https://github.com/rollup/rollup/pull/5809): fix: avoid duplicate rollupjs.org prefix (@GauBen, @lukastaegert)
- [#5810](https://github.com/rollup/rollup/pull/5810): chore(deps): update dependency @shikijs/vitepress-twoslash to v2 (@renovate[bot])
- [#5811](https://github.com/rollup/rollup/pull/5811): fix(deps): lock file maintenance minor/patch updates (@renovate[bot])

## 4.31.0

_2025-01-19_
Expand Down
2 changes: 1 addition & 1 deletion browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rollup/browser",
"version": "4.31.0",
"version": "4.32.0",
"description": "Next-generation ES module bundler browser build",
"main": "dist/rollup.browser.js",
"module": "dist/es/rollup.browser.js",
Expand Down
2 changes: 1 addition & 1 deletion cli/run/batchWarnings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ const deferredHandlers: Record<string, (warnings: RollupLog[]) => void> = {

function defaultBody(log: RollupLog): void {
if (log.url) {
info(getRollupUrl(log.url));
info(log.url);
}

const loc = formatLocation(log);
Expand Down
9 changes: 9 additions & 0 deletions docs/configuration-options/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2864,6 +2864,7 @@ interface WatcherOptions {
exclude?: string | RegExp | (string | RegExp)[];
include?: string | RegExp | (string | RegExp)[];
skipWrite?: boolean;
onInvalidate?: (id: string) => void;
}
```

Expand Down Expand Up @@ -2971,6 +2972,14 @@ export default {

该选项用于决定是否在触发重新构建时跳过 `bundle.write()` 步骤。

### watch.onInvalidate {#watch-oninvalidate}

| | |
| ----: | :--------------------- |
| 类型: | `(id: string) => void` |

一个可选功能,每当构建中包含的模块发生变化时将立即被调用。它会以变化模块的 id 作为参数接收。这与仅在运行构建完成后才被调用的 [`watchChange`](../plugin-development/index.md#watchchange) 插件挂钩不同。例如,如果知道当前构建完成后将启动另一个构建,则可以使用此回调来防止执行额外步骤。由于它会跟踪每次变化,因此该回调可能在整个构建过程中多次被调用。

## 废弃选项 {#deprecated-options}

☢️ 这些选项已经废弃,可能从未来的 Rollup 版本中移除。
Expand Down
2 changes: 1 addition & 1 deletion docs/plugin-development/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ interface SourceDescription {
| 类别: | async, parallel |
| 上一个/下一个钩子: | 此钩子可以在构建和输出生成阶段的任何时候触发。如果是这种情况,则当前构建仍将继续,但会安排一个新的构建在当前构建完成后开始,从 [`options`](#options) 开始 |

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

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

Expand Down
Loading
Loading