diff --git a/extensions/markdown/js/package-lock.json b/extensions/markdown/js/package-lock.json index 941d62776..1730006b1 100644 --- a/extensions/markdown/js/package-lock.json +++ b/extensions/markdown/js/package-lock.json @@ -2869,11 +2869,6 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" }, - "harmony-reflect": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/harmony-reflect/-/harmony-reflect-1.6.1.tgz", - "integrity": "sha512-WJTeyp0JzGtHcuMsi7rw2VwtkvLa+JyfEKJCFyfcS0+CDkjQ5lHPu7zEhFZP+PDSRrEgXa5Ah0l1MbgbE41XjA==" - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", diff --git a/extensions/markdown/js/package.json b/extensions/markdown/js/package.json index 4500a9610..b76b407f6 100644 --- a/extensions/markdown/js/package.json +++ b/extensions/markdown/js/package.json @@ -5,7 +5,6 @@ "@github/markdown-toolbar-element": "^0.1.1", "@webcomponents/custom-elements": "^1.2.1", "flarum-webpack-config": "0.1.0-beta.10", - "harmony-reflect": "^1.6.1", "mdarea": "^0.0.10", "webpack": "^4.26.0", "webpack-cli": "^3.1.2" diff --git a/extensions/markdown/js/src/forum/index.js b/extensions/markdown/js/src/forum/index.js index e8c3ea202..047fefcc8 100644 --- a/extensions/markdown/js/src/forum/index.js +++ b/extensions/markdown/js/src/forum/index.js @@ -2,12 +2,17 @@ import { extend } from 'flarum/extend'; import TextEditor from 'flarum/components/TextEditor'; import icon from 'flarum/helpers/icon'; -import '@webcomponents/custom-elements'; -import 'harmony-reflect'; -import '@github/markdown-toolbar-element'; -import MarkdownArea from 'mdarea/mdarea.js'; +let MarkdownArea; + +if (window.Reflect) { + require('@webcomponents/custom-elements'); + require('@github/markdown-toolbar-element'); + MarkdownArea = require('mdarea/mdarea.js'); +} app.initializers.add('flarum-markdown', function(app) { + if (!MarkdownArea) return; + let index = 1; extend(TextEditor.prototype, 'init', function() {