mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 09:01:39 -05:00
Switch to dynamically loaded imports
This doesn't actually seem to work though - TridactylThemeDefault still appears in the root classes
This commit is contained in:
parent
6c701fd83b
commit
c2a3dfab61
2 changed files with 37 additions and 37 deletions
|
@ -13,7 +13,7 @@ import "@src/lib/html-tagged-template"
|
|||
/* import "@src/content/commandline_content" */
|
||||
/* import "@src/excmds_content" */
|
||||
/* import "@src/content/hinting" */
|
||||
import * as Config from "@src/lib/config"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as Logging from "@src/lib/logging"
|
||||
const logger = new Logging.Logger("content")
|
||||
logger.debug("Tridactyl content script loaded, boss!")
|
||||
|
@ -24,46 +24,45 @@ import {
|
|||
addContentStateChangedListener,
|
||||
} from "@src/content/state_content"
|
||||
|
||||
import { CmdlineCmds } from "@src/content/commandline_cmds"
|
||||
import { EditorCmds } from "@src/content/editor"
|
||||
|
||||
import { getAllDocumentFrames } from "@src/lib/dom"
|
||||
|
||||
import state from "@src/state"
|
||||
import { EditorCmds as editor } from "@src/content/editor"
|
||||
/* tslint:disable:import-spacing */
|
||||
|
||||
config.getAsync("disable").then(async TRI_DISABLE => {
|
||||
// Set up our controller to execute content-mode excmds. All code
|
||||
// running from this entry point, which is to say, everything in the
|
||||
// content script, will use the excmds that we give to the module
|
||||
// here.
|
||||
import * as controller from "@src/lib/controller"
|
||||
import * as excmds_content from "@src/.excmds_content.generated"
|
||||
import { CmdlineCmds } from "@src/content/commandline_cmds"
|
||||
import { EditorCmds } from "@src/content/editor"
|
||||
import * as hinting_content from "@src/content/hinting"
|
||||
|
||||
const controller = await import("@src/lib/controller")
|
||||
const excmds_content = await import("@src/.excmds_content.generated")
|
||||
const hinting_content = await import("@src/content/hinting")
|
||||
// Hook the keyboard up to the controller
|
||||
import * as ContentController from "@src/content/controller_content"
|
||||
import { getAllDocumentFrames } from "@src/lib/dom"
|
||||
|
||||
const ContentController = await import("@src/content/controller_content")
|
||||
// Add various useful modules to the window for debugging
|
||||
import * as commandline_content from "@src/content/commandline_content"
|
||||
import * as convert from "@src/lib/convert"
|
||||
import * as config from "@src/lib/config"
|
||||
import * as dom from "@src/lib/dom"
|
||||
import * as excmds from "@src/.excmds_content.generated"
|
||||
import * as finding_content from "@src/content/finding"
|
||||
import * as itertools from "@src/lib/itertools"
|
||||
import * as messaging from "@src/lib/messaging"
|
||||
import state from "@src/state"
|
||||
import * as State from "@src/state"
|
||||
import * as webext from "@src/lib/webext"
|
||||
import * as perf from "@src/perf"
|
||||
import * as keyseq from "@src/lib/keyseq"
|
||||
import * as native from "@src/lib/native"
|
||||
import * as styling from "@src/content/styling"
|
||||
import { EditorCmds as editor } from "@src/content/editor"
|
||||
import * as updates from "@src/lib/updates"
|
||||
import * as urlutils from "@src/lib/url_util"
|
||||
import * as scrolling from "@src/content/scrolling"
|
||||
import * as R from "ramda"
|
||||
import * as visual from "@src/lib/visual"
|
||||
import * as metadata from "@src/.metadata.generated"
|
||||
/* tslint:disable:import-spacing */
|
||||
|
||||
config.getAsync("disable").then(TRI_DISABLE => {
|
||||
const commandline_content = await import("@src/content/commandline_content")
|
||||
const convert = await import("@src/lib/convert")
|
||||
const dom = await import("@src/lib/dom")
|
||||
const excmds = await import("@src/.excmds_content.generated")
|
||||
const finding_content = await import("@src/content/finding")
|
||||
const itertools = await import("@src/lib/itertools")
|
||||
const messaging = await import("@src/lib/messaging")
|
||||
const State = await import("@src/state")
|
||||
const webext = await import("@src/lib/webext")
|
||||
const perf = await import("@src/perf")
|
||||
const keyseq = await import("@src/lib/keyseq")
|
||||
const native = await import("@src/lib/native")
|
||||
const styling = await import("@src/content/styling")
|
||||
const updates = await import("@src/lib/updates")
|
||||
const urlutils = await import("@src/lib/url_util")
|
||||
const scrolling = await import("@src/content/scrolling")
|
||||
const R = await import("ramda")
|
||||
const visual = await import("@src/lib/visual")
|
||||
const metadata = await import("@src/.metadata.generated")
|
||||
|
||||
if (TRI_DISABLE === "true") return
|
||||
|
||||
|
@ -334,7 +333,7 @@ config.getAsync("modeindicator").then(mode => {
|
|||
} else {
|
||||
result = mode
|
||||
}
|
||||
const modeindicatorshowkeys = Config.get("modeindicatorshowkeys")
|
||||
const modeindicatorshowkeys = config.get("modeindicatorshowkeys")
|
||||
if (modeindicatorshowkeys === "true" && suffix !== "") {
|
||||
result = mode + " " + suffix
|
||||
}
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"moduleResolution": "node",
|
||||
"module": "es2020",
|
||||
"esModuleInterop": true,
|
||||
"noImplicitAny": false,
|
||||
"noEmitOnError": true,
|
||||
"outDir": "build/tsc-out",
|
||||
"sourceMap": true,
|
||||
"target": "es2019",
|
||||
"lib": ["es2019", "dom", "dom.iterable"],
|
||||
"lib": ["es2020", "dom", "dom.iterable"],
|
||||
"experimentalDecorators": true,
|
||||
"alwaysStrict": true,
|
||||
"strictBindCallApply": true,
|
||||
|
|
Loading…
Add table
Reference in a new issue