diff --git a/src/static/js/rjquery.ts b/src/static/js/rjquery.ts index 167e96090..9a28da15f 100644 --- a/src/static/js/rjquery.ts +++ b/src/static/js/rjquery.ts @@ -1,6 +1,8 @@ // @ts-nocheck 'use strict'; // Provides a require'able version of jQuery without leaking $ and jQuery; -window.$ = require('./vendors/jquery'); +import $ from './vendors/jquery.js'; +window.$ = $; const jq = window.$.noConflict(true); -exports.jQuery = exports.$ = jq; + +export {jq as jQuery, jq as $}; diff --git a/src/static/js/timeslider.ts b/src/static/js/timeslider.ts index d0e45973f..93497e038 100644 --- a/src/static/js/timeslider.ts +++ b/src/static/js/timeslider.ts @@ -25,13 +25,13 @@ // These jQuery things should create local references, but for now `require()` // assigns to the global `$` and augments it with plugins. -require('./vendors/jquery'); +import './vendors/jquery.js'; -import {randomString, Cookies} from "./pad_utils"; -const hooks = require('./pluginfw/hooks'); -import padutils from './pad_utils' -const socketio = require('./socketio'); -import html10n from '../js/vendors/html10n' +import {randomString, Cookies} from "./pad_utils.js"; +import hooks from './pluginfw/hooks.js'; +import padutils from './pad_utils.js' +import socketio from './socketio.js'; +import html10n from '../js/vendors/html10n.js' let token, padId, exportLinks, socket, changesetLoader, BroadcastSlider; let cp = ''; const playbackSpeedCookie = 'timesliderPlaybackSpeed'; @@ -222,5 +222,5 @@ const handleClientVars = (message) => { }); }; -exports.baseURL = ''; -exports.init = init; +export const baseURL = ''; +export {init}; diff --git a/src/static/js/underscore.ts b/src/static/js/underscore.ts index 79a3e8e7f..c9ec7e0f7 100644 --- a/src/static/js/underscore.ts +++ b/src/static/js/underscore.ts @@ -1,4 +1,6 @@ // @ts-nocheck 'use strict'; -module.exports = require('underscore'); +import _ from 'underscore'; + +export default _;