M
M
Muhammad Magomedov2019-11-13 21:24:11
webpack
Muhammad Magomedov, 2019-11-13 21:24:11

Why is WOW.js not working in Webpack?

Good evening.
I loaded the WOW.js library via webpack and wrote the following code in the index.js file:

import "wowjs/dist/wow.min.js";
import "./style.scss";

$(function() {
 
  new WOW().init()

})

The wow.js library is added to the main.js file, but it doesn't work. The following error appears in the site console:
Uncaught ReferenceError: WOW is not defined
    at HTMLDocument.eval (index.js:13)
    at mightThrow (jquery.js:3557)
    at process (jquery.js:3625)

And when I add the WOW.js file manually, it works.
In addition to WOW.js, jquery is also added to the main.js file.
Here is a link to the repository in GitHube
Ps To run webpack, type the command in the console:
npm i
And after downloading, write the command:
npm run webpack
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alexsoin, 2020-01-07
@alexsoin

const WOW = require('wowjs');

window.wow = new WOW.WOW();
window.wow.init();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question