I was using WOW.js since a while with Sage 8 without any difficulty, but i’m clearly locked to import it with SAGE 9
npm install wowjs
Then i’ve tried a lot of things in main.js
import 'wowjs/dist/wow.min.js';
import 'wowjs/dist/wow.';
import 'wowjs/dist/wow.js';
import WOW from 'wowjs/dist/wow';
But the result is always the same.
new WOW().init();
ReferenceError: WOW is not defined
There’s proablby something wrong in he way i use, but i’am really not familar with Webpack
For the record, i have removed bootstrap for this project and replace it by materializecss.
I have alos tried to direclty create a wow.js file in my assets/script then add it to config.json and then put it with wp enqueue scripts, but eslint is stoping (more than 1660 errors ).
Finally, if i copy/paste the lib from github directly to the public/scripts/wow.js, and it’s working … but tat’s definivelly not the good way
My current main.js :
// import external dependencies
import 'wowjs/dist/wow.min.js';
import 'jquery';
import 'jquery-numerator';
import 'materialize-css/dist/js/materialize';
// import local dependencies
import Router from './util/router';
import common from './routes/Common';
import home from './routes/Home';
import aboutUs from './routes/About';
import postTypeArchiveDownload from './routes/Download';
// Use this variable to set up the common and page specific functions. If you
// rename this variable, you will also need to rename the namespace below.
const routes = {
// All pages
common,
// Home page
home,
// About us page, note the change from about-us to aboutUs.
aboutUs,
// Download Archive Page
postTypeArchiveDownload,
};
// Load Events
jQuery(document).ready(() => new Router(routes).loadEvents());
Sorry, my english is … as it
Any ideas ?