Load Idle.js without script-loader

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-06-04 21:36:15 +02:00
parent 0e7a9df97d
commit cf867daf99
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
2 changed files with 10 additions and 3 deletions

View file

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

View file

@ -213,7 +213,6 @@ module.exports = {
],
index: [
'babel-polyfill',
'script-loader!Idle.Js',
'expose-loader?exposes=LZString!lz-string',
'script-loader!inlineAttachment',
'script-loader!jqueryTextcomplete',
@ -258,7 +257,6 @@ module.exports = {
'script-loader!handlebars',
'expose-loader?exposes=hljs!highlight.js',
'expose-loader?exposes=emojify!emojify.js',
'script-loader!Idle.Js',
'script-loader!gist-embed',
'expose-loader?exposes=LZString!lz-string',
'script-loader!inlineAttachment',
@ -393,6 +391,13 @@ module.exports = {
}
}
},
{
// Idle.js must be imported as CommonJS, as its AMD export is broken
test: require.resolve('Idle.Js'),
parser: {
amd: false
}
},
{
test: /\.js$/,
use: [{ loader: 'babel-loader' }],