Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Fix path formatting on windows #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
26 changes: 13 additions & 13 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { packageName } from './data/pkg-name';
import { parseSvgs, generateSprite, optimizeSvgContent, writeFile, printFileStats, vitePluginSvgSprite } from './core';
import { hasSvgFilesInDirectory, measureExecutionTime } from './utils';
import { getEntryPath, getOutputPath } from './paths';
import { fileURLToPath } from 'url'

export interface PluginConfig {
/**
Expand Down Expand Up @@ -93,7 +94,7 @@ export default function svgSprite(astroConfig: PluginConfig = {}): AstroIntegrat
},
'astro:config:done': async ({ config: cfg }) => {
config = cfg;
filePath = `${config.publicDir.pathname}${output}/sprite.svg`;
filePath = `${fileURLToPath(config.publicDir)}${output}/sprite.svg`;
},
'astro:server:start': async () => {
executionTime = measureExecutionTime(emitFile);
Expand Down