Answer the question
In order to leave comments, you need to log in
Why do you need browserify for the frontend?
Hello community.
Recently I came across a thing on the net called browserify and for the life of me I don’t understand its essence. Why is it needed at all. No, I understand that you can add libraries with a simple require from js, but this is what raises questions for me.
For example, I work with jquery with several plugins.
This thing will collect jq and other plugins into one file.
Well, it seems like this place should be WOW!
But why?
In this case, we will get a hefty file with everything that is possible in 300 - 350 kilobytes.
In my opinion, it is better to load libraries from CDNs with fallback. There will be a chance that the user has them cached.
Another reason to use it is that you can install and update libraries via npm. But after all it is possible and through bower. And without unnecessary complications. Then I wanted to glue the library files into one, I didn’t want to glue them together.
Question: What is it about it that makes you use it (if you use it)?
Answer the question
In order to leave comments, you need to log in
browserify is needed in order to be able to use commonjs modules in the browser. If you have not worked with nodejs, then it will be difficult for you to understand. You are used to downloading libraries a la jquery from CDN, this is certainly correct, but when developing on nodejs, packages are installed via npm. There are many packages, including delicious ones.
By installing some package, or writing your own module, you can use it both on the client and on the server (nodejs).
If you are not working with nodejs, then it is better to use AMD(require.js).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question