vue cli3 implements the steps of packaging by environment

vue cli3 implements the steps of packaging by environment

The vue project built with cli3 is known as a zero configuration file. In order to facilitate packaging (without manually changing different environments for packaging), what should we do when we need to package in different environments?
1. Create three configuration files in the root directory, as shown below

insert image description here

Here I created three, which are my local; offline; online environment. The contents of the three files are as follows: VUE_APP_TITLE corresponds to the current file suffix, build corresponds to production

NODE_ENV = 'production'
VUE_APP_TITLE = 'alpha'
====================================================================
NODE_ENV = 'production'
VUE_APP_TITLE = 'production'
====================================================================
NODE_ENV = 'production'
VUE_APP_TITLE = 'online'

2.package.json configures the corresponding environment packaging name, as shown in the figure:

insert image description here

3.As shown in the figure

insert image description here

4. Intercept files on the interface, as shown in the figure:

insert image description here

5. After configuration, the three environments are packaged as follows:
App packaging offline environment: npm run alpha
App packaging local environment: npm run build
App packaging formal environment: npm run online

This is the end of this article about the steps of vue cli3 to implement environment-specific packaging. For more relevant vue cli3 environment-specific 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:
  • Example of vue-cli3 environment variables and environment packaging
  • Solution to white screen after vue-cli3 packaged code
  • vue cli3.0 packaged and launched static resources and the solution to the problem of not finding the path
  • How to package Vue Cli3 and automatically ignore console.log statements
  • Detailed explanation of customizing the packaging path of css, js and pictures in vue-cli3.0
  • Detailed explanation of vue-cli3 multi-environment packaging configuration

<<:  Tutorial on installing MySQL 5.7.9 using RPM package under CentOS 7

>>:  Win2008 Server Security Check Steps Guide (Daily Maintenance Instructions)

Recommend

Two ways to introduce svg icons in Vue

How to introduce svg icons in Vue Method 1 of int...

How to use css overflow: hidden (overflow hiding and clearing floats)

Overflow Hide It means hiding text or image infor...

Raspberry Pi msmtp and mutt installation and configuration tutorial

1. Install mutt sudo apt-get install mutt 2. Inst...

Notes on using $refs in Vue instances

During the development process, we often use the ...

Two ways to exit bash in docker container under Linux

If you want to exit bash, there are two options: ...

MySQL cursor principle and usage example analysis

This article uses examples to explain the princip...

Detailed explanation of Vue options

Table of contents 1. What are options? 2. What at...

How to implement page screenshot function in JS

"Page screenshot" is a requirement ofte...

JavaScript imitates Jingdong magnifying glass special effects

This article shares the specific code of JavaScri...

Use of Linux relative and absolute paths

01. Overview Absolute paths and relative paths ar...

Tutorial diagram of installing mysql8.0.18 under linux (Centos7)

1 Get the installation resource package mysql-8.0...

Simple usage examples of MySQL custom functions

This article uses examples to illustrate the usag...

Steps for IDEA to integrate Docker to achieve remote deployment

1. Enable remote access to the docker server Log ...

Solve the problem of Docker starting Elasticsearch7.x and reporting an error

Using the Docker run command docker run -d -p 920...