-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from swup/next
Update for swup 4
- Loading branch information
Showing
6 changed files
with
158 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Changelog | ||
|
||
<!-- ## [Unreleased] --> | ||
|
||
## [4.0.0] - 2023-07-26 | ||
|
||
- Update for swup 4 compatibility | ||
|
||
## [3.0.0] - 2023-03-10 | ||
|
||
- Switch to microbundle | ||
- Export native ESM module | ||
|
||
## [2.0.0] - 2022-08-20 | ||
|
||
- Make global instance on window optional | ||
|
||
## [1.0.0] - 2019-05-02 | ||
|
||
- Initial release | ||
|
||
[Unreleased]: https://github.com/swup/debug-plugin/compare/4.0.0...HEAD | ||
|
||
[4.0.0]: https://github.com/swup/debug-plugin/releases/tag/4.0.0 | ||
[3.0.0]: https://github.com/swup/debug-plugin/releases/tag/3.0.0 | ||
[2.0.0]: https://github.com/swup/debug-plugin/releases/tag/2.0.0 | ||
[1.0.0]: https://github.com/swup/debug-plugin/releases/tag/1.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Swup Debug Plugin | ||
|
||
A [swup](https://swup.js.org) plugin for debugging and helping in development. | ||
|
||
- Output all triggered hooks to the console as they happen | ||
- Rewrites swup's `log` method so that any output provided by plugins is visible | ||
- Detect common mistakes and suggest solutions in the console | ||
|
||
## Installation | ||
|
||
Install the plugin from npm and import it into your bundle. | ||
|
||
```bash | ||
npm install @swup/debug-plugin | ||
``` | ||
|
||
```js | ||
import SwupDebugPlugin from '@swup/debug-plugin'; | ||
``` | ||
|
||
Or include the minified production file from a CDN: | ||
|
||
```html | ||
<script src="https://unpkg.com/@swup/debug-plugin@4"></script> | ||
``` | ||
|
||
## Usage | ||
|
||
To run this plugin, include an instance in the swup options. | ||
|
||
```javascript | ||
const swup = new Swup({ | ||
plugins: [new SwupDebugPlugin()] | ||
}); | ||
``` | ||
|
||
## Options | ||
|
||
### globalInstance | ||
|
||
If `true`, the plugin will store the swup instance on the global window object, making swup | ||
available at `window.swup`. Defaults to `false`. | ||
|
||
```javascript | ||
{ | ||
globalInstance: true | ||
} | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.