K
K
konstant1n132020-07-13 23:58:47
JavaScript
konstant1n13, 2020-07-13 23:58:47

jQuery import not working. Why?

import $ from 'jquery;
jQuery import not working. I installed jquery via command line: npm i jquery --save-dev. In the js folder itself, there is also a jquery.js file. But the import doesn't work. Why

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2020-07-14
@Casufi

there is a native import that does not need a collector, but there is an import that is processed, for example, using webpack.
How do you connect the main script in which you do the import?
Well, the second question is why --save-dev?
Read https://developer.mozilla.org/en-US/docs/Web/JavaS...
Well, in order to use npm install configure webpack
https://learn.javascript.ru/screencast/webpack

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question