修改打包配置

This commit is contained in:
BianLzhaoMin 2024-07-16 18:00:59 +08:00
parent 5783dde87a
commit 0afc0cecb4
2 changed files with 31 additions and 30 deletions

View File

@ -4,21 +4,21 @@ const path = require('path')
var proxyUrl = var proxyUrl =
module.exports = { module.exports = {
dev: { dev: {
// Paths // Paths
assetsSubDirectory: 'static', assetsSubDirectory: 'static',
assetsPublicPath: '/', assetsPublicPath: '/',
host: 'localhost', // can be overwritten by process.env.HOST host: 'localhost', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false, autoOpenBrowser: false,
errorOverlay: true, errorOverlay: true,
notifyOnErrors: true, notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
devtool: 'cheap-module-eval-source-map', devtool: 'cheap-module-eval-source-map',
cacheBusting: true, cacheBusting: true,
cssSourceMap: true, cssSourceMap: true,
proxyTable: { proxyTable: {
'/screen': { '/screen': {
// target: 'http://112.29.103.165:21626',//重庆 // target: 'http://112.29.103.165:21626',//重庆
target: 'http://192.168.0.14:21624',//测试 target: 'http://192.168.0.14:21624',//测试
@ -26,21 +26,21 @@ module.exports = {
changeOrigin: true, changeOrigin: true,
// secure: true, //如果是https接口需要配置这个参数 // secure: true, //如果是https接口需要配置这个参数
pathRewrite: { pathRewrite: {
'^/screen': '/' '^/screen': '/'
} }
}, },
}
},
build: {
index: path.resolve(__dirname, '../dist/index01.html'),
// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static01',
assetsPublicPath: '/bigScrap',
productionSourceMap: false,
devtool: '#source-map',
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
bundleAnalyzerReport: process.env.npm_config_report
} }
},
build: {
index: path.resolve(__dirname, '../dist/index01.html'),
// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static01',
assetsPublicPath: '/',
productionSourceMap: false,
devtool: '#source-map',
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
bundleAnalyzerReport: process.env.npm_config_report
} }
}

View File

@ -63,6 +63,7 @@ const routes = [
const router = new Router({ const router = new Router({
mode: 'history', mode: 'history',
routes, routes,
base: '/bigScrap'
}) })
router.beforeEach(async (to, from, next) => { router.beforeEach(async (to, from, next) => {