When incorporating a resource into a web page, I have the option to either link to the file (locally, hosted by the web server, or on a CDN)
<link rel="stylesheet" href="https://somecdn.com/mycssresource.min.css">
<script src="alocalscript.js"></script>
or utilize webpack which combines npm
installed modules into one bundle.js
, served by my web server.
When exploring documentation for frameworks, I frequently encounter (most recently in Bulma) the suggested method of installing the framework as
npm install <framework>
I comprehend the use case for Node.js programs (where everything operates locally on the server, so the framework sources belong there) but for browser-based development, the files installed through npm install
residing in node_modules
must ultimately find their way to the browser where the code is executed.
Is the recommendation (or preferred approach) to install a framework via npm install
suitable for code intended for browsers, or is it more geared towards Node.js or webpack (or similar bundlers) usage?