mirror of
https://github.com/cupcakearmy/liquet.git
synced 2025-09-05 23:40:40 +00:00
13 lines
365 B
JavaScript
13 lines
365 B
JavaScript
import Swup from 'swup'
|
|
import SwupPreloadPlugin from '@swup/preload-plugin'
|
|
|
|
export default (fn) => {
|
|
const swup = new Swup({
|
|
linkSelector: `a[href^="${window.location.origin}"]:not([data-no-swup]), a[href^="/"]:not([data-no-swup])`,
|
|
plugins: [new SwupPreloadPlugin()],
|
|
containers: ['#app']
|
|
})
|
|
|
|
swup.on('contentReplaced', fn)
|
|
}
|