vue.config.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * @Author: tengmingxue 1473375109@qq.com
  3. * @Date: 2022-10-08 14:40:20
  4. * @LastEditors: zjz
  5. * @LastEditTime: 2024-08-21 14:55:25
  6. * @FilePath: \mbBigScreen\vue.config.js
  7. * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  8. */
  9. const path = require('path')
  10. function resolve(dir) {
  11. return path.join(__dirname, dir)
  12. }
  13. const baseUrl = process.env.VUE_APP_API_BASE_URL
  14. //自定义配置信息
  15. // const defaultSettings = require('./src/utils/settings.js')
  16. // const name = defaultSettings.sysTitle || '登录系统' // page title
  17. /**
  18. * @description vue 配置相关
  19. */
  20. module.exports = {
  21. publicPath: './',
  22. outputDir: 'dist',
  23. assetsDir: 'static',
  24. // indexPath: 'index.html',
  25. lintOnSave: false, //'default'
  26. productionSourceMap: false, // 生产环境是否生成 sourceMap 文件
  27. devServer: {
  28. port: "9000", // 端口
  29. open: true, // 自动开启浏览器
  30. compress: false, // 开启压缩
  31. overlay: {
  32. warnings: false,
  33. errors: false
  34. },
  35. proxy: {
  36. '/api': {
  37. target: baseUrl,
  38. changeOrigin: true,
  39. pathRewrite: {
  40. '^/api': 'http://125.64.42.165:1111'
  41. }
  42. },
  43. '/service':{
  44. //target: 'http://221.182.8.141:10005',
  45. target: 'http://117.176.120.194:8085',
  46. changeOrigin: true,
  47. pathRewrite: {
  48. '^/service': '/service'
  49. }
  50. },
  51. }
  52. },
  53. css: {
  54. // 是否使用css分离插件 ExtractTextPlugin
  55. extract: true,
  56. // 开启 CSS source maps?
  57. // sourceMap: false,
  58. // css预设器配置项
  59. loaderOptions: {
  60. // pass options to sass-loader
  61. sass: {
  62. // 引入全局变量样式,@使我们设置的别名,执行src目录
  63. //data: `@import "@/styles/index.scss";`
  64. }
  65. },
  66. requireModuleExtension: true
  67. },
  68. configureWebpack: {
  69. },
  70. chainWebpack:(config) =>{
  71. config.resolve.alias
  72. .set('@views',resolve('src/views'))
  73. }
  74. }