This VS extension provides you with a an effective and quick start for using Razor Pages together with webpack.
Grab the extension here or clone the repository.
If you create a project with this template you can instantly use npm to install packages. The default Razor Page template includes Bootstrap 4 and jQuery via a CDN - in this template those dependencies also are installed via npm.
You put your source files into the /src folder:
Those are moved automatically to your www/dist folder:
Use npm install packagename to install your package.
Import the package in your sourcefiles.
Use npm run build or npm run watch to start webpack.