In this recipe, we will learn how to prepare our application to be deployed to Netlify:
- Open your Vue project and open the package.json file. Check whether you have the build script defined, as in the following example:
"scripts": {
"serve": "Vue-CLI-service serve",
"build": "Vue-CLI-service build",
"lint": "Vue-CLI-service lint"
},
- Open Terminal (macOS or Linux) or Command Prompt/PowerShell (Windows) and execute the following command:
> npm run build
- Make sure your application build script creates a dist folder in the main folder.
- If your vue-router is defined to work with history mode, you have to create a _redirects file in the public folder. In this file, you need to add the instruction to the Netlify router:
# Netlify settings for single-page application
/* /index.html 200
- Publish your application to a GitHub repository. Don't worry about the build folder, because it's...