Yes, Vite does have a watch function that automatically rebuilds the assets when changes are detected. To use it, you can run the following command:
npm run watch
This command will start the Vite development server and watch for changes in your code. Whenever you make a change, Vite will automatically rebuild the assets, including the CSS files.
Make sure you are in the root directory of your project when running this command. If you encounter any issues, double-check your package.json file to ensure that the "watch" script is properly configured.
Note that the "npm run dev" command you mentioned earlier is typically used for development purposes, but it may not trigger the automatic rebuild of assets like the "watch" command does.