1. Prepare the environment (download nodejs and set environment variables) npm install -g @vue/cli About old versions 3. Create a new project based on the webpack template (first create a new project folder and open the command line at the location) vue init webpack my-project 4. Perform default configuration # Some configuration is required here, just press Enter by default This will install Vue 2.x version of the template. For Vue 1.x use: vue init webpack#1.0 my-project # Start configuration? Project name my-project ? Project description A Vue.js project ? Author runoob <[email protected]> ? Vue build standalone ? Use ESLint to lint your code? Yes ? Pick an ESLint preset Standard ? Setup unit tests with Karma + Mocha? Yes ? Setup e2e tests with Nightwatch? Yes # Configuration ends vue-cli · Generated "my-project". To get started: cd my-project npm install npm run dev Documentation can be found at https://vuejs-templates.github.io/webpack 5. Enter the project, install node_modules, and start the project cd my-project npm install npm run dev 6. Package the project and configure nginx #Package project npm run build nginx configuration worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 8081; server_name localhost; location / { root E:/vuework/my-project/dist; try_files $uri $uri/ /index.html; index index.html index.htm; } } } 7. Repeated packaging, file not updated. 8. Deployment: configure nginx, package the project, and start nginx npm run build start nginx This is the end of this article about using vue-cli to create a project and webpack packaging. For more related vue webpack packaging content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Mysql WorkBench installation and configuration graphic tutorial
>>: MySQL Workbench download and use tutorial detailed explanation
1. Download the MySQL jdbc driver (mysql-connecto...
1. Installation 1. Download Go to the MySQL offic...
Table of contents 1. Test environment 1.1 Hardwar...
Table of contents 1. VueRouter 1. Description 2. ...
Environment Preparation Docker environment MySQL ...
<META http-equiv="Page-Enter" CONTENT...
This article uses an example to share with you a ...
Overview An index is a table of correspondence be...
Table of contents Introduction Creating an Array ...
A list is defined as a form of text or chart that...
In some scenarios, we want to assign multiple IPs...
Table of contents Lazy Loading CSS styles: HTML p...
Table of contents background analyze Data simulat...
1.1. Download: Download the zip package from the ...
This article shares the specific code of JavaScri...