Build and Deployment
Build
After the project development is completed, execute the following command in the project root directory to build:
bash
pnpm build
After the build is successful, a corresponding dist folder will be generated in the root directory, which contains the built files.
Deployment
When deploying, you may find that the resource paths are incorrect. Simply modify the .env.production file.
bash
# Change the configuration according to your static resource path
VITE_BASE_URL = /art-design-pro/
Deploying to a Non-Root Directory
You need to change the .env.production configuration and modify VITE_BASE_URL to the path where you store the project, for example:
bash
VITE_BASE_URL = /art-design-pro/
Then configure in the nginx configuration file
bash
server {
location /art-design-pro {
alias /usr/local/nginx/html/art-design-pro;
index index.html index.htm;
}
}