I took a slightly different (simpler?) route:
Add via Yarn
yarn add barba.js --dev
routes/common.js
import Barba from 'barba.js/dist/barba.min';
export default {
init() {
// JavaScript to be fired on all pages
Barba.Pjax.start();
},
finalize() {
// JavaScript to be fired on all pages, after page specific JS is fired
},
};
That’s my whole routes/common.js
file but you can see it’s just 2 lines added to it. Since I am importing/declaring then using Barba
in the same place, there’s no need to disable the linting…