Load ot without script-loader

The ot library is tricky to load with Webpack, as it writes
it's functions into a global `ot` object and does not export anything.
I got it working using `exports-loader` to put the `ot` object
into a CommonJS export and then forcing Webpack to only
load using CommonJS.

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-06-06 18:17:52 +02:00
parent 4f4a4cb747
commit bd62e79f7d
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
4 changed files with 27 additions and 11 deletions

View file

@ -1,7 +1,7 @@
/* eslint-env browser, jquery */
/* eslint no-console: ["error", { allow: ["warn", "error", "debug"] }] */
/* global Cookies, moment, serverurl,
key, Dropbox, ot, hex2rgb, Visibility */
key, Dropbox, hex2rgb, Visibility */
import TurndownService from 'turndown'
import CodeMirror from 'codemirror/lib/codemirror.js'
@ -13,6 +13,8 @@ import Idle from 'Idle.Js'
import '../vendor/jquery-textcomplete/jquery.textcomplete'
import { ot } from '../vendor/ot/ot.min.js'
import { saveAs } from 'file-saver'
import randomColor from 'randomcolor'
import store from 'store'