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
Solution 1 Completely uninstall and delete all da...
1. Background Recently, some friends encountered ...
1. SSH remote management SSH is a secure channel ...
environment: 1. CentOS6.5 X64 2.mysql-5.6.34-linu...
Those who have played King of Glory should be fam...
1. First, create the corresponding folder accordi...
This article mainly introduces the breadcrumb fun...
closure service nginx stop systemctl stop nginx s...
Color is one of the most important elements for a...
Mixins provide distributed reusable functionality...
Today, when verifying the concurrency problem of ...
When I was writing a project yesterday, I needed ...
This article example shares the specific code of ...
WeChat applet trajectory playback mainly uses pol...
Table of contents cache Cache location classifica...