Skip to content

Commit

Permalink
Fix using dirname in print plugin (#1310)
Browse files Browse the repository at this point in the history
  • Loading branch information
hipstersmoothie authored Sep 2, 2024
1 parent 310b6ef commit db18f76
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/plugin-print/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"lint": "eslint .",
"test": "vitest",
"build": "tshy",
"build": "tshy && cp -r fonts dist",
"dev": "tshy --watch",
"clean": "rm -rf node_modules .tshy .tshy-build dist .turbo"
},
Expand Down
1 change: 1 addition & 0 deletions plugins/plugin-print/src/dirname-cjs.cts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const dirname = __dirname;
6 changes: 6 additions & 0 deletions plugins/plugin-print/src/dirname.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { fileURLToPath } from "url";
import path from "path";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore Dual package
export const dirname = path.dirname(fileURLToPath(import.meta.url));
3 changes: 2 additions & 1 deletion plugins/plugin-print/src/fonts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import path from "path";
import { dirname } from "./dirname.js";

const dir = path.join(__dirname, "../");
const dir = path.join(dirname, "../");

export const SANS_8_BLACK = path.join(
dir,
Expand Down

0 comments on commit db18f76

Please sign in to comment.