Skip to content

Commit

Permalink
Strip special characters from vite output (#6588)
Browse files Browse the repository at this point in the history
Fix issue #5561 emulators not starting with vite

---------

Co-authored-by: Viktor Sotov <[email protected]>
Co-authored-by: sotovviktor <[email protected]>
  • Loading branch information
3 people committed Dec 7, 2023
1 parent ed13fde commit 8997c86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- Fix an issue preventing Vite applications from being emulated on Windows. (#6411)
- Addressed an issue preventing Astro applications from being deployed from Windows. (#5709)
- Fixed an issue preventing Angular apps using ng-deploy from being emulated or deployed. (#6584)
- Warn if a Web Framework is outside a well known version range on deploy/emulate. (#6562)
- Use Web Framework's well known version range in `firebase init hosting`. (#6562)
- Limit Web Framework's generated Cloud Function name to 20 characters, fixing deploys for some. (#6260)
- Limit Web Framework's generated Cloud Function name to 23 characters, fixing deploys for some. (#6260)
4 changes: 3 additions & 1 deletion src/frameworks/vite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { spawn } from "cross-spawn";
import { existsSync } from "fs";
import { copy, pathExists } from "fs-extra";
import { join } from "path";
import stripAnsi from "strip-ansi";
import { FrameworkType, SupportLevel } from "../interfaces";
import { promptOnce } from "../../prompt";
import {
Expand Down Expand Up @@ -105,7 +106,8 @@ export async function getDevModeHandle(dir: string) {
const serve = spawn(cli, [], { cwd: dir });
serve.stdout.on("data", (data: any) => {
process.stdout.write(data);
const match = data.toString().match(/(http:\/\/.+:\d+)/);
const dataWithoutAnsiCodes = stripAnsi(data.toString());
const match = dataWithoutAnsiCodes.match(/(http:\/\/.+:\d+)/);
if (match) resolve(match[1]);
});
serve.stderr.on("data", (data: any) => {
Expand Down

0 comments on commit 8997c86

Please sign in to comment.