-2

there is bundle.js

window.$ = window.jQuery = require('jquery');
import './app.js';

and there is app.js

$('#button').on('click', function(e) {
    ...
});

so I get this:

Uncaught ReferenceError: $ is not defined

why imported script does not see jquery?

Pavel Prokofiev
  • 449
  • 2
  • 4
  • 14

1 Answers1

0

you must load this script tag

< script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"> < /script>

Jerrin stephen
  • 204
  • 3
  • 12