1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/liuyaping007-vuefrom1.1.0

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
vue.config.js 1.6 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
liuyaping Отправлено 21.11.2022 11:27 2543523
const path = require('path')
const resolve = (dir) => {
return path.join(__dirname, dir)
}
const shell = require('shelljs')
const prod = process.env.npm_lifecycle_event
shell.cp(`./src/configs/${prod}.js`, './src/configs/index.js')
module.exports = {
publicPath: './',
lintOnSave: false,
chainWebpack: (config) => {
const svgRule = config.module.rule('svg')
svgRule.exclude.add(resolve('src/icons')).end()
config.module
.rule('icons')
.test(/\.svg$/)
.include.add(resolve('src/icons'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]',
})
.end()
config.plugin('define').tap((args) => {
// .env
args[0]['process.env'].BASE_URL = JSON.stringify(process.env.BASE_URL)
return args
})
},
configureWebpack: () => {
const myConfig = {}
myConfig.plugins = []
myConfig.devServer = {
disableHostCheck: true, // 禁用webpack热重载检查 解决热更新失效问题
host: 'localhost',
port: 8083,
https: false,
proxy: {
'/jd': {
// 要请求的后台地址113.240.220.22\http://localhost:8181/net3vs
target: 'http://localhost:8089/iagrain/a/',
ws: true, // 启用websockets
changeOrigin: true, // 是否跨域
pathRewrite: {
'^/jd': '', // 这里理解成用路径中的‘/dev/api’代替target里面的地址,后面组件中我们掉接口时直接用api代替
},
},
},
}
myConfig.devtool = 'source-map'
return myConfig
},
runtimeCompiler: true,
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/liuyaping007-vuefrom1.1.0.git
git@api.gitlife.ru:oschina-mirror/liuyaping007-vuefrom1.1.0.git
oschina-mirror
liuyaping007-vuefrom1.1.0
liuyaping007-vuefrom1.1.0
master