revert dynamic Codemirror mode import

- Closes #653
main
Mike Fix 6 years ago
parent a25c9d0dc5
commit 8100090b17

@ -908,8 +908,18 @@ const unfold = (f, seed) => {
}`
if (typeof window !== 'undefined' && typeof window.navigator !== 'undefined') {
require(`codemirror/mode/javascript/javascript`)
import('./modes')
const alreadyLoaded = new Set()
LANGUAGES.filter(language => language.mode !== 'auto' && language.mode !== 'text').forEach(
language => {
if (language.mode && !alreadyLoaded.has(language.mode)) {
alreadyLoaded.add(language.mode)
language.custom
? require(`./custom/modes/${language.mode}`)
: require(`codemirror/mode/${language.mode}/${language.mode}`)
}
}
)
}
export const DEFAULT_SETTINGS = {

Loading…
Cancel
Save