Skip to content

Commit 2f761fd

Browse files
committed
Use pathToFileUrl to fix file protocol issues on windows
1 parent bbbf560 commit 2f761fd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cli/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env node
2+
const { pathToFileURL } = require('url')
23
const { resolveConfigPath } = require('../lib/tailwindConfigUtils')
34
const program = require('commander')
45
program
@@ -14,8 +15,9 @@ program
1415
port: args.port,
1516
tailwindConfigProvider: async () => {
1617
const configPath = resolveConfigPath(program.config)
17-
delete require.cache[configPath]
18-
const config = await import(configPath)
18+
const configHref = pathToFileURL(configPath).href;
19+
delete require.cache[configHref]
20+
const config = await import(configHref)
1921
return config.default || config
2022
},
2123
shouldOpen: args.open

0 commit comments

Comments
 (0)