Under windows vue front-end development environment to build and deploy nginx

Reprinted, the original link: https: //blog.csdn.net/qq_32340877/article/details/79105565

 

Under windows vue + webpack nginx front-end development environment to build and deploy
a development environment to build
a front-end frame generally rely nodejs, we must first install node.js.
Please refer to http://blog.csdn.net/qq_32340877/article/details/79092310.
2, since many of the sources are npm address abroad, particularly slow to install, so we are here to take advantage of Taobao mirror server.
Installation command: npm install -g cnpm -registry = https : Enter the command after waiting //registry.npm.taobao.org
3, then install global vue-cli scaffolding, used to help build a template for the development of the Vue framework
command: cnpm install -g vue-cli, enter, wait for the installation
after installation, you can enter vue -V, then enter, if vue client version information appears, the installation was successful.
4, with mounted npm Webpack: cnpm install webpack -g
case Webpack has been installed to the global environment, through the command line webpack -h try.
4. Create a directory in a folder vuepro, cd to the directory and enter the command: vue init webpack vue-test (the default project name)

At this point, observe vuepro the folder one more vue-test folder, this is the template vue project.
5, start debugging Enter the following command:
cd-VUE the Test
CNPM install (here need to wait)
npm RUN dev (this is a debug command to deploy)

Appears above a port on behalf of a successful start, listening port is 8080. This port can be modified in vue-test / config / index.js in:

It will open a page after a successful start

Development environment to build complete.
Second, the compiler deploy
1, vue-test input command npm run build the project path

After compilation will find vue-test folder more than a dist folder there is a compiled file.
2, nginx online download, Download http://nginx.org/en/download.html, unzip the downloaded file nginx.
3, deployment configuration, the Edit nginx.conf nginx / conf, modified as shown below:

4, start nginx. Nginx installation cd command window to enter the directory, enter the start nginx start nginx.

Then visit http://127.0.0.1:8088/ accessed through a browser.
5, nginx stop command: nginx -s quit
nginx restart command: nginx -s reload


Guess you like

Origin www.cnblogs.com/andrew-303/p/12163180.html