Skip to content

Commit 01ca2ab

Browse files
committed
fix
1 parent ffce989 commit 01ca2ab

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/vite/plugin.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ export const reactRouterDevTools: (args?: ReactRouterViteConfig) => Plugin[] = (
370370
}
371371

372372
const column = line.indexOf("console.")
373-
const logMessage = `'${chalk.magenta("LOG")} ${chalk.blueBright(`http://localhost:${port}/open-source?source=${id.replace(normalizePath(process.cwd()), "")}&line=${lineNumber + 1}&column=${column + 1}`)}\\n → '`
373+
const logMessage = `'${chalk.magenta("LOG")} ${chalk.blueBright(`http://localhost:${port}/open-source?source=${encodeURIComponent(id.replace(normalizePath(process.cwd()), ""))}&line=${lineNumber + 1}&column=${column + 1}`)}\\n → '`
374374
if (line.includes("console.log(")) {
375375
const newLine = `console.log(${logMessage},`
376376
return line.replace("console.log(", newLine)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default function Index() {
2+
console.log("Epic test")
3+
return <div>
4+
Epic test
5+
</div>
6+
}

0 commit comments

Comments
 (0)