vue.config.js 933 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. const path = require('path')
  2. function resolve(dir) {
  3. return path.join(__dirname, dir)
  4. }
  5. const name = 'bili'
  6. module.exports = {
  7. productionSourceMap: false,
  8. // options...
  9. devServer: {
  10. port: 8080,
  11. disableHostCheck: true
  12. // TODO 部署到 nginx 中后,使用 rewrite 指令配置
  13. /* proxy: {
  14. '/tnb': {
  15. target: process.env.VUE_APP_BASE_API,
  16. changeOrigin: true,
  17. ws: true,
  18. pathRewrite: {
  19. '^/tnb': '/tnb'
  20. }
  21. },
  22. '/api': {
  23. target: process.env.VUE_APP_BASE_API,
  24. changeOrigin: true,
  25. ws: true,
  26. pathRewrite: {
  27. '^/api': '/api'
  28. }
  29. }
  30. }*/
  31. },
  32. configureWebpack: {
  33. // provide the app's title in webpack's name field, so that
  34. // it can be accessed in index.html to inject the correct title.
  35. name: name,
  36. resolve: {
  37. alias: {
  38. '@': resolve('src')
  39. }
  40. }
  41. }
  42. }