I tried to include myst-parser as external JavaScript library for a SharePoint WebPart, following
"externals": {
"myst-parser": {
"path": "https://cdn.jsdelivr.net/npm/[email protected]/dist/myst.min.js",
"globalName": "myst-parser"
}
},
In my webpart:
import * as myst from 'myst-parser';
const html = myst.mystParse('# Hello to the world!')
I am able to server the web part. However, it shows
=> How to correctly include myst-parser in Sharepoint?
Related:
https://github.com/executablebooks/mystmd/issues/824#issuecomment-1880858355

I hade to downgrade the version of unified and adapt gulpfile.js to include a custom webpack configuration.
Content of package.json:
Content of gulpfile.js:
Example usage: