J
J
jww2018-01-30 21:09:26
JavaScript
jww, 2018-01-30 21:09:26

What is the correct way to use jQuery with gulp-conact?

Good day. I use gulp-concat, but Jquery is enabled in the project, as a result of which I have to insert $(document).ready(function() {}) into each js file. Is there any way to avoid this? Or is there nothing wrong with that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artemy, 2018-01-30
Kaydash @kayart

Well, in general, in modern conditions, it is better to implement modularity with some more suitable tool for this - for example, Webpack.
Basically, there is nothing wrong with your approach. Your functionality is packaged into separate files in closures, so the global scope remains clean.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question