Is there a step-by-step guide to pack CodeMirror to use in a browser extension?

I have been using CodeMirror 5 in a (userscript manager) browser extension with linting for JavaScript & CSS (only).

Is there a guide on generating the necessary CM6 (and linters) code to include in the browser extension?