Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix using dirname in print plugin #1310

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading