Skip to content

Commit

Permalink
fix: windows
Browse files Browse the repository at this point in the history
  • Loading branch information
deer committed Jan 15, 2024
1 parent 0df72f4 commit f4939d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions plugins/tailwind.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Plugin, PluginMiddleware, ResolvedFreshConfig } from "../server.ts";
import type postcss from "npm:[email protected]";
import * as path from "https://deno.land/std@0.207.0/path/mod.ts";
import { walk } from "https://deno.land/std@0.207.0/fs/walk.ts";
import * as path from "https://deno.land/std@0.211.0/path/mod.ts";
import { walk } from "https://deno.land/std@0.211.0/fs/walk.ts";
import { TailwindPluginOptions } from "./tailwind/types.ts";

async function initTailwind(
Expand Down Expand Up @@ -49,10 +49,9 @@ export default function tailwind(
} catch (_error) {
// if it did, then the user doesn't have styles.css defined
// it must then be provided by the plugin
filePath = path.join(
new URL(".", import.meta.url).pathname,
"./tailwind/styles.css",
);
const fileUrl = new URL(".", import.meta.url);
const directoryPath = path.fromFileUrl(fileUrl);
filePath = path.join(directoryPath, "tailwind", "styles.css");
}
let text = "";
try {
Expand Down
2 changes: 1 addition & 1 deletion tests/tailwind_test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { fetchHtml, runBuild, withFakeServe, withFresh } from "./test_utils.ts";
import {
assert,
assertEquals,
assertStringIncludes,
dirname,
join,
TextLineStream,
} from "./deps.ts";
import { assertEquals } from "$std/assert/assert_equals.ts";

Deno.test("TailwindCSS - dev mode", async () => {
await withFakeServe("./tests/fixture_tailwind/dev.ts", async (server) => {
Expand Down

0 comments on commit f4939d4

Please sign in to comment.