Ionaru/easy-markdown-editor

CodeMirror.commands undefined when importing package

開放

#43 建立於 2019年1月7日

 (5 則留言) (5 個反應) (0 位負責人)JavaScript (358 個分叉)user submission
BugHelp wanted

倉庫指標

星標
 (3,064 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

I'm submitting a...

  • Bug report
  • Feature request

Reproduction steps

  1. Install package npm install --save easymde
  2. Use webpack to bundle your js and point it to an entrypoint javascript file.
  3. Import it in your JS file import "easymde" or import { EasyMDE } from "easymde" or import * as EasyMDE from "easymde"
  4. Visit page that JS is loaded, it will say CodeMirror.commands is undefined in browser console.

If I import the minified js file (see below) it works fine, so I guess the issue is related to the bundling, perhaps some dependency or something that have to be set in the webpack config file that is not specified?

const EasyMDE = require('easymde/dist/easymde.min.js');

Version information

Browser type and version: Chrome/Firefox EasyMDE version: 2.4.2

貢獻者指南