How to deploy your Vue.js application within your WordPress plugin. This should be a very simple process but there are a couple of bits that can catch you out if you're not careful!
We first have to create our build (dist) files for Vue by running 'npm run build' in our Vue.js project. The resulting files need to be enqueued in our WordPress plugin. You will need to enqueue both the javascript and css files that are created. You will need to move the files from the dist folder over into your WordPress plugin. You will then need to ensure that your enqueue function uses the correct paths to your files.
If this is done correctly your Vue.js app should work. However, if you have images in your Vue.js app you will need to configure the 'base' in your Vue.js project before running the build command. The base can be configured conditionally. You will want to point the base to the location of your build files within your WordPress plugin for when you run the 'build' command, and leave the base as the root ('/') of the project when running the development server.
This video shows you how to do all that so not sure why you bothered reading this.
My Hosting Provider - use code GOBLIN for a discount. Free trial with no card required:
https://platform.cloudways.com/signup...