Hi,
I am a web/node noob and have attempted to install code mirror using:
npm i codemirror
as per google suggestions and https://www.npmjs.com/package/codemirror as I can’t find any installation instructions at the codemirror site.
But now what, how is my web app meant to ‘find’ the various libs? Example code on the codemirror site says I should use:
import {EditorView, basicSetup} from “codemirror”
import {javascript} from “@codemirror/lang-javascript”
But since npm installs stuff to a node_modules dir, the browser can’t find these dependencies.
What am I missing? Does the web page need to be served from a node js server of some kind? I know you can serve vue/react etc pages via node and it does all sorts of magic stuff, but my webapp will not be served by a node server so it needs to be able to run standalone.
I can ‘cheat’ by copying/pasting codemirror.js from the node_modules or the codemirror site, but I’d like to do all this the ‘right’ way. Or is just copying/pasting stuff from node_modules the ‘right’ way in this case!
Sorry for the stupid questions. I really don’t do enough web stuff, and each time I return to do a bit it seems to have become 1000 times more complex than last time!
Also, I can’t seem to find a lang-javascript.js file anywhere.
Bye,
Mark