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

Detailed explanation of three commonly used web effects in JavaScript

Table of contents 1 element offset series 1.1 Off...

Implementation of Nginx Intranet Standalone Reverse Proxy

Table of contents 1 Nginx Installation 2 Configur...

Solve the problem of setting Chinese language pack for Docker container

If you use docker search centos in Docker Use doc...

A brief discussion on Axios's solution to remove duplicate requests

Table of contents 1. Cancel duplicate requests 2....

Linux C log output code template sample code

Preface This article mainly introduces the releva...

Detailed description of the function of new in JS

Table of contents 1. Example 2. Create 100 soldie...

Hidden overhead of Unix/Linux forks

Table of contents 1. The origin of fork 2. Early ...

Linux centOS installation JDK and Tomcat tutorial

First download JDK. Here we use jdk-8u181-linux-x...

Detailed explanation of how to use $props, $attrs and $listeners in Vue

Table of contents background 1. Document Descript...

Teach you how to use vscode to build a react-native development environment

question The code has no prompt: Many non-front-e...

Installation tutorial of docker in linux

The Docker package is already included in the def...

Explain TypeScript enumeration types in detail

Table of contents 1. Digital Enumeration 2. Strin...