@@ -70,19 +70,22 @@ import {setupRealDark, takeUsersOutOfRealDark} from './real-dark.js';
7070import { formatISODate , updateAndCalcTopBarHeight } from './utils.js' ;
7171
7272const logos = require . context ( '../views/resources/logos' , false , / \. ( p n g | s v g ) $ / ) ;
73-
7473const siteTemplateScreenshots = require . context ( '../views/resources/template_screenshots' , false , / \. p n g $ / ) ;
74+ import changelogDocument from './generated/changelog.pug' ;
75+ import cookiesDocument from './generated/cookies.pug' ;
76+ import privacyDocument from './generated/privacy.pug' ;
7577
7678if ( ! window . PRODUCTION && ! options . embedded ) {
79+ // TODO: Replace with top-level await import() when we move to Vite
7780 require ( './tests/_all' ) ;
7881}
7982
8083//css
81- require ( 'bootstrap/dist/css/bootstrap.min.css' ) ;
82- require ( 'golden-layout/src/css/goldenlayout-base.css' ) ;
83- require ( 'tom-select/dist/css/tom-select.bootstrap5.css' ) ;
84- require ( './styles/colours.scss' ) ;
85- require ( './styles/explorer.scss' ) ;
84+ import 'bootstrap/dist/css/bootstrap.min.css' ;
85+ import 'golden-layout/src/css/goldenlayout-base.css' ;
86+ import 'tom-select/dist/css/tom-select.bootstrap5.css' ;
87+ import './styles/colours.scss' ;
88+ import './styles/explorer.scss' ;
8689
8790// Check to see if the current unload is a UI reset.
8891// Forgive me the global usage here
@@ -91,8 +94,8 @@ const simpleCooks = new SimpleCook();
9194const historyWidget = new HistoryWidget ( ) ;
9295
9396const policyDocuments = {
94- cookies : require ( './generated/cookies.pug' ) . default ,
95- privacy : require ( './generated/privacy.pug' ) . default ,
97+ cookies : cookiesDocument ,
98+ privacy : privacyDocument ,
9699} ;
97100
98101function setupSettings ( hub : Hub ) : [ Themer , SiteSettings ] {
@@ -193,7 +196,7 @@ function setupButtons(options: CompilerExplorerOptions, hub: Hub) {
193196
194197 $ ( '#changes' ) . on ( 'click' , ( ) => {
195198 // TODO(jeremy-rifkin): Fix types
196- alertSystem . alert ( 'Changelog' , $ ( require ( './generated/changelog.pug' ) . default . text ) as any ) ;
199+ alertSystem . alert ( 'Changelog' , changelogDocument . text ) ;
197200 } ) ;
198201
199202 $ . get ( window . location . origin + window . httpRoot + 'bits/icons.html' )
0 commit comments