vue.js will display what you created for the time being if you do npm run serve
.
However, depending on the development environment, you may not be able to connect to the outside unless you build it and put it in the specified directory, so do you want to build and check it? ??
However, even though I changed it a little, it is troublesome to have to move the contents of the dist directory created by npm run build
to another place every time.
In such a case, creating a symbolic link will work.
Instead of putting the file directly in the public directory, you can link to it and read a file in another directory.
For example, the public directory is / var / www / html / nginx / publish / website
,
Assuming that the directory used for development is / home / oogaki / dev / website
Previously, the files in / home / oogaki / dev / website / dist
that were built were copied to / var / www / html / nginx / publish / website
.
However, if you delete the / var / www / html / nginx / publish / website
directory and do the following, you can save time.
cd /var/www/html/nginx/publish/
ln -s /home/oogaki/dev/website/dist website
Now, the contents read in / var / www / html / nginx / publish / website
will be the contents of / home / oogaki / dev / website / dist
.
I am using the ln command, but how to specify it is
ln -s Link destination path Link name
It is in the form of. In the first place, it is one way to change the directory to be read in the server settings such as nginx, but when you do not want to mess with the server settings, it is convenient to use symbolic links.
Recommended Posts