Skip to content

Commit

Permalink
normalize paths for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianGonz97 committed Apr 15, 2024
1 parent fb52ade commit c17b9a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import color from 'chalk';
import * as css from 'css-tree';
import * as estree from 'estree-walker';
import htmlExtractor from 'purgecss-from-html';
import { normalizePath, type ResolvedConfig, type Plugin } from 'vite';
import { PurgeCSS, mergeExtractorSelectors, standardizeSafelist, defaultOptions } from 'purgecss';
import {
resolveTailwindConfig,
Expand All @@ -15,7 +16,6 @@ import {
} from './tailwind.js';
import { log, createLogger } from './logger.js';
import type { ExtractorResultDetailed } from 'purgecss';
import type { ResolvedConfig, Plugin } from 'vite';
import type { Node } from 'estree';
import type { PurgeOptions } from './types.js';

Expand Down Expand Up @@ -66,7 +66,7 @@ export function purgeCss(purgeOptions?: PurgeOptions): Plugin {

// if the files haven't been cached
if (files.size === 0) {
const contentGlobs = getContentPaths(tailwindConfig.content);
const contentGlobs = getContentPaths(tailwindConfig.content).map((p) => normalizePath(p));
for (const file of fg.globSync(contentGlobs, { cwd: viteConfig.root, absolute: true })) {
if (file.endsWith('.html')) htmlFiles.push(file);
files.add(file);
Expand Down

0 comments on commit c17b9a4

Please sign in to comment.