Compile prosemirror as it is in examples


#1

Hi, I would like to know, how to build prosemirror as it is in example site https://prosemirror.net/examples/basic/. I would like to have library composed from modules defined by me in one file (like this https://prosemirror.net/examples/prosemirror.js) and second file with definition of editor

var EditorState = require("prosemirror-state").EditorState;
var EditorView = require("prosemirror-view").EditorView;
var DOMParser = require("prosemirror-model").DOMParser;
var schema =  require("prosemirror-schema-basic").schema;
var exampleSetup = require("prosemirror-example-setup").exampleSetup;

window.view = new EditorView(document.querySelector("#editor"), {
  state: EditorState.create({
    doc: DOMParser.fromSchema(schema).parse(document.querySelector("#content")),
    plugins: exampleSetup({schema: schema})
  })
})

How can I achieve this? Thank you.


#2

The examples on the website are built with this Makefile, using Browserify with the -x option.