I'm trying to incorporate the chessground library into one of my projects. It appears to be a CommonJS module, so I utilized browserify to bring it into my web page.
browserify -r chessground > chessground.js
To make use of it on my webpage, I am using
const Chessground = require('chessground').Chessground
However, I noticed in this project that they import it as follows:
import {Chessground} from 'chessground'
I understand that they are utilizing webpack, but I can't seem to figure out how to bundle an entire npm package into a single file AND convert it into an ES module. Can someone offer guidance?