mirror of
https://github.com/iconoir-icons/iconoir
synced 2026-03-14 14:05:44 +01:00
Fix building on Windows (#553)
This commit is contained in:
parent
6e6d2e27ea
commit
2911b580e9
2 changed files with 5 additions and 3 deletions
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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, ' ');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue