A
A
Andrew2017-08-11 00:59:11
Node.js
Andrew, 2017-08-11 00:59:11

Why webpack if you can bundle without it?

By and large, the main goal of webpack is to split the project into many modules, which is done by nodejs import/export. What a problem to make an entry point where all other modules will be connected via nodejs, and then give the page to the user who requests it, and all this can happen without webpack, for which it is needed if bundling is possible and without using additional libraries.
Additionally, there is still a question, is there a difference in performance if the project is already bundled in node js and on the client by connecting modules through the script tag, are these two methods interchangeable? the second way will work slower? because of what will be the request for each js file?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2017-08-11
@undefined_title

Yes, you can do this and that. You can collect as you like, even with your hands in the notepad. Yes, connecting a couple hundred script tags is slower than one. Webpack, in theory, gives you convenience. If you have more problems from him - no one forces you.

K
Konstantin Kitmanov, 2017-08-11
@k12th

Webpack provides integration of a bunch of tools out of the box: transpilers and preprocessors, linters, live and hot reload, AJAX request proxying, minification. In grunt and gulp, putting it all together was sometimes quite tedious.
webpack has a very small build overhead.
If you don’t like webpack for some reason, then the world hasn’t converged on it like a wedge: grunt, gulp, browserify, rollup.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question