vue.config.js 908 B

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