Skip to content

Commit

Permalink
fix(cli): use dirname intrinsic in react-vite template (#7062)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chriscbr authored Aug 30, 2024
1 parent 1760b9c commit 00c1a8f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
8 changes: 1 addition & 7 deletions apps/wing/project-templates/wing/react-vite/backend/main.w
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@ bring vite;
bring http;
bring "./broadcaster.w" as broadcaster;

// Winglang doesn't have a built-in support for __dirname yet, so we use a workaround to get the current directory.
// @see tracking issue: https://github.com/winglang/wing/issues/3736
class Utils {
extern "utils.js" pub static __dirname(): str;
}

let myBroadcaster = new broadcaster.Broadcaster() as "Broadcaster";
let api = new cloud.Api(cors: true);
let counter = new cloud.Counter();

let website = new vite.Vite(
root: "{Utils.__dirname()}/../frontend",
root: "{@dirname}/../frontend",
publicEnv: {
TITLE: "Wing + Vite + React",
API_URL: api.url,
Expand Down

This file was deleted.

0 comments on commit 00c1a8f

Please sign in to comment.