Vue 4.0 and above modify the default 8080 port number

Time:2021-8-21

The detailed process is shown in:Vue 4.0 and above modify the default 8080 port number
Modifying the default port number in vue4.0 is greatly different from previous versions. The modification method is as follows:

  1. Find the corresponding file to modify the port
    The directory is:
    Project folder / node_ modules/@vue/cli-service/lib/options.js
    • 2. Open the options.js file, drag the bottom, find the following code and cancel the comment
devServer: {
    open: process.platform === 'darwin',
    host: '0.0.0.0',
    port: 6080,
    https: false,
    hotOnly: false,
    proxy: null, // string | Object
    before: app => {}
  }

Port: 6080 in the above circle is my modified port number. If it is not modified, it should be 8080 by default
• 3. Cancel the comments in the above box (the parameters in the above code are commented out by default) to modify the port number of the project
Note: do not add notes after modification.

Recommended Today

The selector returned by ngrx store createselector performs one-step debugging of fetching logic

Test source code: import { Component } from ‘@angular/core’; import { createSelector } from ‘@ngrx/store’; export interface State { counter1: number; counter2: number; } export const selectCounter1 = (state: State) => state.counter1; export const selectCounter2 = (state: State) => state.counter2; export const selectTotal = createSelector( selectCounter1, selectCounter2, (counter1, counter2) => counter1 + counter2 ); // […]