This commit is contained in:
2022-03-21 12:44:51 +08:00
commit 521d9581ae
215 changed files with 34114 additions and 0 deletions

75
vue.config.js Normal file
View File

@@ -0,0 +1,75 @@
/*
* @Description:
* @Author: Wang Minjie
* @Date: 2020-01-04 11:48:59
* @LastEditTime : 2020-01-07 19:17:55
* @LastEditors : Wang Minjie
*/
const path = require('path')
const resolve = dir => {
return path.join(__dirname, dir)
}
// 项目部署基础
// 默认情况下,我们假设你的应用将被部署在域的根目录下,
// 例如http://pro.api.phalapi.net/
// 默认:'/'
// 如果您的应用程序部署在子路径中,则需要在这指定子路径
// 例如http://pro.api.phalapi.net/admin/
// 需要将它改为'/my-app/'
// iview-admin线上演示打包路径 https://file.iviewui.com/admin-dist/
const BASE_URL = process.env.NODE_ENV === 'production'
? '/platform/'
: '/'
const webpack = require('webpack')
module.exports = {
// Project deployment base
// By default we assume your app will be deployed at the root of a domain,
// e.g. https://www.my-app.com/
// If your app is deployed at a sub-path, you will need to specify that
// sub-path here. For example, if your app is deployed at
// https://www.foobar.com/my-app/
// then change this to '/my-app/'
publicPath: BASE_URL,
// tweak internal webpack configuration.
// see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md
// 如果你不需要使用eslint把lintOnSave设为false即可
lintOnSave: true,
chainWebpack: config => {
config.resolve.alias
.set('@', resolve('src')) // key,value自行定义比如.set('@@', resolve('src/components'))
.set('_c', resolve('src/components'))
config.plugin('provide').use(webpack.ProvidePlugin, [{
'window.Quill': 'quill/dist/quill.js',
'Quill': 'quill/dist/quill.js'
}])
},
// 设为false打包时不生成.map文件
productionSourceMap: false,
// 这里写你调用接口的基础路径来解决跨域如果设置了代理那你本地开发环境的axios的baseUrl要写为 '' ,即空字符串
// devServer: {
// proxy: 'localhost:3000'
// }
// 添加如下配置
devServer: {
proxy: {
'/api': {
// TODO更换成您本地的测试域名或正式域名
target: 'http://pro-test.api.yesapi.cn/',
// target: 'http://mac.pro.phalapi.net/',
changeOrigin: true,
pathRewrite: {
'^api/': '/api'
}
}
}
}
// chainWebpack: config => {
// config.plugin('provide').use(webpack.ProvidePlugin, [{
// 'window.Quill': 'quill'
// }])
// }
}