build: improve fileInclude plugin

This commit is contained in:
Vendicated 2024-05-26 19:12:18 +02:00
parent c836270320
commit 9ec671819d
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
8 changed files with 218 additions and 19 deletions

View file

@ -23,12 +23,11 @@ import "./settings";
import { debounce } from "@shared/debounce";
import { IpcEvents } from "@shared/IpcEvents";
import { BrowserWindow, ipcMain, shell, systemPreferences } from "electron";
import monacoHtml from "file://monacoWin.html?minify&base64";
import { FSWatcher, mkdirSync, watch, writeFileSync } from "fs";
import { open, readdir, readFile } from "fs/promises";
import { join, normalize } from "path";
import monacoHtml from "~fileContent/monacoWin.html;base64";
import { getThemeInfo, stripBOM, UserThemeHeader } from "./themes";
import { ALLOWED_PROTOCOLS, QUICKCSS_PATH, THEMES_DIR } from "./utils/constants";
import { makeLinksOpenExternally } from "./utils/externalLinks";

2
src/modules.d.ts vendored
View file

@ -38,7 +38,7 @@ declare module "~git-remote" {
export default remote;
}
declare module "~fileContent/*" {
declare module "file://*" {
const content: string;
export default content;
}

View file

@ -21,8 +21,7 @@ import "./shiki.css";
import { enableStyle } from "@api/Styles";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import previewExampleText from "~fileContent/previewExample.tsx";
import previewExampleText from "file://previewExample.tsx";
import { shiki } from "./api/shiki";
import { createHighlighter } from "./components/Highlighter";