diff --git a/public/js/index.js b/public/js/index.js index e565c52b3..3ffcc58dd 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -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' diff --git a/webpack.common.js b/webpack.common.js index 7bddebee3..67b0271fd 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -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' }],