This is more of a general JS question, but I haven’t really found good answers to this. So far I seem to always be able to import AMD modules from other, non-ES6 packages into an ES6 project by trying a variety of different things.
But what’s the recommended way of doing it in ProseMirror?
In the case of ProseMirror, the simple case such as:
var EditorState = require("prosemirror-state").EditorState
turns into
import {EditorState} from "prosemirror-state"
right?
What about
var history = require("prosemirror-history")
is this
import * as history from "prosemirror-history"
?
And
const {Schema} = require("prosemirror-model")
turns into
import * as Schema from "prosemirror-model"
?
Is there a particular reason why history and Schema are being exported differently than the other things, or I am just not reading the code right?