Hey, Thanks.
I’ve edited all the files hundreds of times, with little bits from this how to or another.
So according to this one, I placed it in Main.js as such — after the npm install --save jquery-hoverintent
step (no errors)—and the code is in the node_modules
folder.
Main.js
// import external dependencies
import $ from 'jquery';
import 'bootstrap/dist/js/bootstrap';
// import local dependencies
import Router from './util/router';
import common from './routes/Common';
import 'jquery-hoverintent/jquery.hoverIntent.js';
Then since another one commented to put it into common.js (wow.js example) I also did this.
Common.js
/*eslint-disable */
import 'jquery-hoverintent/jquery.hoverIntent.js';
export default {
init() {
},
finalize() {
// JavaScript to be fired on all pages, after page specific JS is fired
jQuery('a').hoverIntent(function () {
console.log('Worky');
},function (){});
},
};
I turned off all eslint, because I don’t care to use “proper code” when I’m really just trying to get it to register that it exists—why optimize a broken car?
So in one of the many attempts, npm run build
actually produced functioning code, but the live syncs never worked and $
or jQuery
always resulted in hoverIntent() not being a function, or not being defined. I had it as import $ from jquery
and import jquery
as the original code was.
The test for it working was always in common but sometimes in the init and others later. Console.log()s everywhere: main.js, common.init(), common.finalize(), often common.finalize() was never run.
I’m not sure if that package even works though, and that could be step 1 in debugging.
Sage package.json -> "version": "9.0.0-alpha.3",