problem description
recently attempted to update project scaffolding from vue-cli2 webpack2 to vue/cli 3 webpack4
vue-cli-service serve
index
login
, window.location.href = "/login"
login
index.html
index.js
url localhost:3007/login.html
urllocalhost: 3007/login/.html
login.html
login.js
PS: buildnodejs
the environmental background of the problems and what methods you have tried
related codes
vue.config.js
module.exports = {
devServer: {
port: 3007,
host: "localhost",
open: true,
proxy: {
"/api": {
target: "localhost: 3333",
changeOrigin: true,
// ws: true,
pathRewrite: {
"^/api": "/api"
}
}
}
},
chainWebpack: config => {
},
pages: {
index: {
// page
entry: "src/main.js",
//
template: "public/index.html",
// dist/index.html
filename: "index.html",
// title
// template title <title><%= htmlWebpackPlugin.options.title %></title>
title: "Index Page",
//
// chunk vendor chunk
chunks: ["chunk-vendors", "chunk-common", "index"]
},
login: {
entry: "src/login.js",
template: "public/login.html",
filename: "login.html",
title: "",
chunks: ["chunk-vendors", "chunk-common", "login"]
},
//
// `public/subpage.html`
// `public/index.html`
// `subpage.html`
// subpage: "src/subpage/main.js"
},
}