Skip to content

Commit

Permalink
Try assetsInclude
Browse files Browse the repository at this point in the history
  • Loading branch information
brookslybrand committed Jan 19, 2024
1 parent d3fad19 commit 94610ac
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Binary file added app/routes/img.$slug/inter-roman-latin-var.woff
Binary file not shown.
11 changes: 11 additions & 0 deletions app/routes/img.$slug/utils.server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { json } from "@remix-run/node";
import getEmojiRegex from "emoji-regex";
import interFilePath from "./inter-roman-latin-var.woff";
// import fsp from "fs/promises";
// import path from "path";

console.log({ interFilePath });

function stripEmojis(string: string): string {
return string.replace(getEmojiRegex(), "").replace(/\s+/g, " ").trim();
Expand Down Expand Up @@ -60,6 +65,12 @@ export function getDataFromParams(

export async function getFont(fontPath: string) {
try {
// console.log({ dir: __dirname, interFilePath });
// let asdf = await fsp.readFile(interFilePath);

// console.log("reading from file system");
// console.log(asdf);

let res = await fetch(fontPath);
return res.arrayBuffer();
} catch (err) {
Expand Down
1 change: 1 addition & 0 deletions vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default defineConfig({
ssr: {
noExternal: ["@docsearch/react"],
},
assetsInclude: ["**/*.woff2", "**/*.woff"],
plugins: [
remix({ serverModuleFormat: "cjs" }),
tsconfigPaths(),
Expand Down

0 comments on commit 94610ac

Please sign in to comment.