Fix building on Windows (#553)

This commit is contained in:
Pascal Jufer 2025-07-27 13:52:57 +02:00 committed by GitHub
commit 2911b580e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -1,3 +1,4 @@
import { normalize } from 'node:path';
import ts from 'typescript';
/**
@ -16,7 +17,7 @@ export function getDts(path, content, options) {
const _readFile = host.readFile;
host.readFile = (filename) => {
if (filename === path)
if (normalize(filename) === path)
return content;
return _readFile(filename);
@ -25,7 +26,7 @@ export function getDts(path, content, options) {
const dtsFilename = path.replace(/\.(m|c)?(ts|js)x?$/, '.d.$1ts');
host.writeFile = (filename, contents) => {
if (filename === dtsFilename)
if (normalize(filename) === dtsFilename)
output = contents;
};

View file

@ -1,4 +1,5 @@
import fs from 'node:fs/promises';
import { EOL } from 'node:os';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
@ -29,7 +30,7 @@ export default async (ctx, target) => {
const fileContent = await fs.readFile(icon.path, 'utf8');
const transformedContent = fileContent
.replace(/\n/g, '')
.replaceAll(EOL, '')
.replace(/(width|height)="\d+px"/g, '')
.replace(/ +/g, ' ');