2
2
2Ernest52020-11-05 20:49:54
npm
2Ernest5, 2020-11-05 20:49:54

Are npm modules duplicated?

I'm building a project with Gulp. I have a main.js file to which other files with scripts are connected: initialization of sliders, scripts for menus, etc. In these files I use plugins from npm, a probably stupid question arose: "If I connect the same npm module, for example JQuery, to different files, and then I connect these files to main.js - will the modules from npm be duplicated? "

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2020-11-05
@2Ernest5

Building a project with Gulp
Gulp cannot collect anything, since Gulp is a task runner (task launcher if in Russian), it can collect what Gulp launches, for example, a bundler (collector) like Webpack or Rollup, or just a file concatenator.
If I include the same npm module, for example JQuery, in different files, and then I include these files in main.js - will the modules from npm be duplicated?
depends on what you are collecting, if the usual concatenation of files - then yes, there will be duplication. And if Webpack or Rollup - no.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question