Vite
@winglibs/vite allows using a Vite project with Wing.
Prerequisites
Installation
npm i @winglibs/vite
Usage
bring cloud;
bring vite;
let api = new cloud.Api();
let website = new vite.Vite(
  // The path to the website root.
  root: "../website",
  // Environment variables passed to the Vite project.
  // They'll available through the global `wing` object.
  publicEnv: {
    API_URL: api.url,
  },
);
// Get the URL of the website.
let url = website.url;
License
This library is licensed under the MIT License.
API Reference
Table of Contents
- Classes
 - Structs
 
Vite (preflight class) 
No description
Constructor
new(props: ViteProps): Vite
Properties
| Name | Type | Description | 
|---|---|---|
url | str | No description | 
Methods
No methods
Vite_tf_aws (preflight class) 
No description
Constructor
new(props: ViteProps): Vite_tf_aws
Properties
| Name | Type | Description | 
|---|---|---|
url | str | No description | 
Methods
No methods
Vite_sim (preflight class) 
No description
Constructor
new(props: ViteProps): Vite_sim
Properties
| Name | Type | Description | 
|---|---|---|
url | str | No description | 
Methods
No methods
ViteProps (struct) 
No description
Properties
| Name | Type | Description | 
|---|---|---|
generateTypeDefinitions | bool? | No description | 
openBrowser | bool? | No description | 
publicEnv |  | No description | 
publicEnvName | str? | No description | 
root | str | No description | 
typeDefinitionsFilename | str? | No description |