Example: Running On Internet Explorer 11

CodeMirror is entirely written with ECMAScript 2018 syntax (avoiding some constructs that are awkward or verbose to compile down to ES5) using, almost entirely, the ES5 standard library.

That means that you don't have to polyfill a lot, to run it on Internet Explorer, but you do have to compile the syntax down to ES5—the distributed files are in ES2015 syntax. Since you'll need to use some kind of bundler to load the modules anyway, you could use a bundler plugin that wires in Babel or another syntax-downgrader.

A rollup setup that does this using Bublé might look like this:

import buble from "@rollup/plugin-buble"
import resolve from "@rollup/plugin-node-resolve"

module.exports = {
  input: "./editor.js",
  output: {
    file: "./www/editor.js",
    format: "umd"
  plugins: [
    buble({transforms: {dangerousForOf: true}}),

(All for/of loops in the library are on arrays, so crude for/of compilation like Bublé's dangerousForOf can safely be used.)

There are three library features that the library uses but IE11 doesn't support. For these you'll need to load polyfills of some kind.

You can either manually include code that defines these when they aren't already available, or use a service like polyfill.io to get them...

<script src=