First I was searching for a way without build process as FF understands ES6 including module import (about:config, dom.moduleScripts.enabled true). Unfortunately “Bare import” fails (see here).
Next I was trying pm’s build process:
git clone https://github.com/ProseMirror/prosemirror-example-setup.git
cd prosemirror-example-setup/
npm install
npm run-script build
The resulting dist/index.js uses commonJs which is not understood by browser.
Packaging just the example-setup module won’t give you a full editor — that’s just a glue module that pulls in and sets up some plugins.
You could run rollup directly on the ES6 source files, but you’ll have to provide it with a bunch of configuration to make it ignore the dependency modules’ main files and use the sources in src/ instead. This is going to be awkward and isn’t something that I explicitly support—the compiled code is the recommended way to consume these modules.
Browser support for ES modules doesn’t come with any kind of intelligent resolution at the moment (it expects imported names to be relative URLs only), so directly loading a multi-module system like this in that way isn’t possible.
Actually I start trying to understand the basics of pm. A good starting point seems to be your examples. In the basic example you mention prosemirror-example-setup but some pieces are missing for me to understand how to start.
What exactly is to be done to run the basic example (without nodejs as web server)?
Run a bundler on the CommonJS code. Rollup with the rollup-plugin-node-resolve and rollup-plugin-commonjs plugins works pretty well. Browserify and Webpack should also do fine.