1 Star 36 Fork 24

hanlei525 / vue后台管理系统

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
vue.config.js 1.75 KB
一键复制 编辑 原始数据 按行查看 历史
hanlei525 提交于 2022-04-16 15:08 . 配置prettier全局格式化
const path = require('path')
const resolve = (dir) => {
return path.join(__dirname, dir)
}
const CompressionWebpackPlugin = require('compression-webpack-plugin')
const Timestamp = new Date().getTime()
module.exports = {
// 基本路径
publicPath: process.env.VUE_APP_PUBLICPATH,
// 输出文件目录
outputDir: 'dist',
// eslint-loader 是否在保存的时候检查
lintOnSave: true,
// webpack配置
// see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md
chainWebpack: (config) => {
config.resolve.alias
.set('@', resolve('src')) // key,value自行定义,比如.set('@@', resolve('src/components'))
.set('_c', resolve('src/components'))
},
devServer: {
port: 5155, // 端口号
host: '0.0.0.0',
https: false, // https:{type:Boolean}
open: true, // 配置自动启动浏览器
disableHostCheck: true,
proxy: {
'/api': {
target: 'http://localhost:6166/', // 需要代理的接口前缀,当前项目未使用代理
changeOrigin: true,
secure: false,
pathRewrite: {
'^/api/': '/',
},
},
}, // 配置多个代理
},
configureWebpack: {
plugins: [
new CompressionWebpackPlugin({
test: /\.(js|css|svg|woff|ttf|json|html)$/, // 正则匹配需要压缩的文件后缀
threshold: 10240, // 大于10kb的会压缩
deleteOriginalAssets: false, // 是否删除源文件
// 其余配置查看compression-webpack-plugin
}),
],
// 输出重构 打包编译后的 文件名称 【模块名称.版本号.时间戳.js】版本号:${process.env.VUE_APP_Version}
// output: {
// filename: `js/[name].${Timestamp}.js`,
// chunkFilename: `js/[name].${Timestamp}.js`
// }
},
}
JavaScript
1
https://gitee.com/hlshare/express_mongodb_web.git
git@gitee.com:hlshare/express_mongodb_web.git
hlshare
express_mongodb_web
vue后台管理系统
master

搜索帮助