Let’s take a intro to how this works in a real project by using the most popular module bundler today, webpack.
import these files into your application when needed to use their functionality. For example, when building a React application you always write
import React from 'react' at the top of each JS file.
<script> tags, which works, but has several key disadvantages:
<script>tags means more calls to the server, worsening performance