# @prefresh/core

> The core logic for prefresh.

Latest version **1.5.11** (published 2026-08-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @prefresh/core
pnpm add @prefresh/core
yarn add @prefresh/core
bun add @prefresh/core
```

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 1.5.11 |
| Published | 2026-08-27 |
| First published | 2020-05-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 27.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 390 |
| Maintainers | jdecroock, marvinhagemeister, developit |

## Links

- npm: https://www.npmjs.com/package/@prefresh/core
- Repository: https://github.com/preactjs/prefresh
- Homepage: https://github.com/preactjs/prefresh#readme
- Issues: https://github.com/preactjs/prefresh/issues
- npm.io page: https://npm.io/package/@prefresh/core

## Recent versions

- 1.5.11 (latest) — 2026-08-27
- 0.8.0-alpha.0 (alpha) — 2020-08-04
- 1.5.10 — 2026-05-12
- 1.5.9 — 2025-11-10
- 1.5.8 — 2025-10-03
- 1.5.7 — 2025-08-20
- 1.5.6 — 2025-08-19
- 1.5.5 — 2025-07-02
- 1.5.4 — 2025-06-28
- 1.5.3 — 2024-11-16
- 1.5.2 — 2023-10-01
- 1.5.1 — 2023-05-31
- 1.5.0 — 2023-05-09
- 1.4.1 — 2022-09-08
- 1.4.0 — 2022-09-07
- … 20 more at https://npm.io/package/@prefresh/core/versions

## README

# Prefresh-core

[![npm version](https://badgen.net/npm/v/@prefresh/core)](https://www.npmjs.com/package/@prefresh/core)

We are still fleshing out the details on how to go about this approach best for [Preact](https://github.com/preactjs/preact), we'd
love to give you the best reloading experience possible.

Note that now the refreshing component will dispose of its `hookState` to reload in case of added hook, ... this to ensure consistency.

## How to use

This plugin will set up a series of hooks onto the webpack instance, so the first thing
to do is ensure that this package is part of your entries.

This will add a method on the window `window.__PREFRESH__.replaceComponent`, this function
expects two arguments. The first being the old `class/function` and the second the new one.

This will go over all vnodes it knows for the `oldType` and rerender them according to the
`NewType`.

---
_Source: https://npm.io/package/@prefresh/core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
