mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
refactor: replace URL.pathname with fileURLToPath for cross-platform … (#581)
Co-authored-by: dhassoun <david@muxd.com>
This commit is contained in:
co-authored by
dhassoun
parent
8763a57360
commit
ba17f34091
@@ -1,7 +1,8 @@
|
||||
import { readdirSync } from 'node:fs';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { defineConfig } from 'tsdown';
|
||||
|
||||
const defineDir = new URL('./src/define', import.meta.url).pathname;
|
||||
const defineDir = fileURLToPath(new URL('./src/define', import.meta.url));
|
||||
const defineFiles = readdirSync(defineDir).filter(file => file.endsWith('.ts'));
|
||||
|
||||
export default defineConfig({
|
||||
@@ -22,7 +23,7 @@ export default defineConfig({
|
||||
sourcemap: true,
|
||||
clean: true,
|
||||
alias: {
|
||||
'@': new URL('./src', import.meta.url).pathname,
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
},
|
||||
dts: {
|
||||
oxc: true,
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { existsSync, readdirSync } from 'node:fs';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { defineConfig } from 'tsdown';
|
||||
import buildStyles from './build/build-styles.ts';
|
||||
|
||||
const GENERATED_ICONS_DIR = new URL('./src/icons/generated-icons', import.meta.url).pathname;
|
||||
const GENERATED_ICONS_DIR = fileURLToPath(new URL('./src/icons/generated-icons', import.meta.url));
|
||||
|
||||
function hasGeneratedIcons(): boolean {
|
||||
if (!existsSync(GENERATED_ICONS_DIR)) return false;
|
||||
@@ -23,7 +24,7 @@ export default defineConfig({
|
||||
sourcemap: true,
|
||||
clean: true,
|
||||
alias: {
|
||||
'@': new URL('./src', import.meta.url).pathname,
|
||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
},
|
||||
dts: {
|
||||
oxc: true,
|
||||
|
||||
Reference in New Issue
Block a user