[] Based vue Vue project nodejs package compiled deployment

A · Compile project

1 · enter the terminal command in the project directory

npm run build

Normally the following figure, in case of an error not compile successfully and compiled html file can not be rendered properly.


 

2 · compiled after the completion of the project into the next dist directory run the generated index.html file

After the open f12 following error (resource file not found)

Open the project index.js file modification build in the assetsPublicPath property to be empty

 

Re-open the index.html find items background pictures found

 

Go css file to find the file name is not found, the search login_bg.162737a.png

 

Modify the resource file for the corresponding img png relative path pictures ../img/login_bg.162737a.png

 

Two -deployment project

1 · project using the Apache http server as a boot container

2 · environment to build:

1. Install the main Apache httpd: [yum install httpd]

2. Start / sbin / service httpd start

3. project directory cd / var / the WWW / HTML

· 4 program directory / etc / httpd

3 · default 80 port. For other ports please modify

Modify the configuration file Listen 80   designated ports

/etc/httpd/conf/httpd.conf

4 · The front page is placed in / var / the WWW / HTML lower, such as in the root directory that is the server ip: port access

As at www New Directory as the directory ump that server ip: port + / ump access

5 · If there is no modification Apache http server configuration files needed to deploy the normal front-end program without having to restart Apache http server service.

Original Address: https: //blog.csdn.net/b376924098/article/details/78726710

Guess you like

Origin www.cnblogs.com/jpfss/p/11112943.html