swup / fragment-plugin

A swup plugin for dynamically replacing containers based on rules 🧩
https://swup-fragment-plugin.netlify.app
MIT License
16 stars 1 forks source link

API Draft #1

Closed hirasso closed 1 year ago

hirasso commented 1 year ago
import Swup from 'swup';
import SwupFragmentPlugin from '@swup/fragment-plugin';

new SwupFragmentPlugin({
    rules: [
        {
            between: '/users/*',
            and: '/users/*',
            replace: ['#users-list']
        },
        {
            between: '/users/*',
            and: '/user/:name',
            replace: ['#user-detail']
        },
    ]
});
hirasso commented 1 year ago

The API changed a bit during development. Closing this issue as it'a no longer needed.