This article guides you on creating and hosting a Vite application on Square Cloud.
my-vite-app
is the name of your new project. Replace it with any desired name for your project. By default, this command sets up a Vite project with JavaScript.
--template
option. Here are some examples:
Select a template by: react
, vue
& lit
.
tsconfig.json
file.
--port 80
parameter in the startup script to ensure your application runs correctly on this port.
--host 0.0.0.0
option is used to bind the Vite server to all available network interfaces. This makes your application accessible not only on localhost
, but also on external devices within the same network, such as other computers or mobile devices. By default, Vite binds to localhost
, which restricts access to the machine where it’s running. Setting the host to 0.0.0.0
allows the server to listen for incoming requests from any IP address.
START
field is essential to customize the startup command. If you want to build and start your Vite application on Square Cloud, configure the START
field as follows:
package.json
:
mysite.com
) instead of the default URL https://mysite.squareweb.app/
, you need the Standard plan or higher. The subdomain is defined by the SUBDOMAIN field in the configuration file. See: How to set up your custom domain..env
file.