Détail du package

@swup/debug-plugin

swup46.7kMIT4.1.0

A swup plugin for debugging and helping in development

readme

Swup Debug Plugin

A swup plugin for debugging and helping in development.

  • Detect common mistakes and suggest solutions in the console
  • Output all triggered hooks to the console as they happen
  • Configure swup's log method to make its output visible

Installation

Install the plugin from npm and import it into your bundle.

npm install @swup/debug-plugin
import SwupDebugPlugin from '@swup/debug-plugin';

Or include the minified production file from a CDN:

<script src="https://unpkg.com/@swup/debug-plugin@4"></script>

Usage

To run this plugin, include an instance in the swup options.

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.

{
  globalInstance: true
}

changelog

Changelog

4.1.0 - 2024-08-02

  • Check proper container and selector use

4.0.4 - 2023-09-28

  • Fix package exports

4.0.3 - 2023-09-28

  • Port to TypeScript

4.0.2 - 2023-09-25

  • Use @swup/cli for bundling

4.0.1 - 2023-07-28

  • Bump version

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