vue.config.js 826 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. proxy: {
  12. '/api': {
  13. target: 'http://127.0.0.1:8000',
  14. changeOrigin: true,
  15. ws: true,
  16. pathRewrite: {
  17. '^/api': '/api'
  18. }
  19. },
  20. '/tnb': {
  21. target: 'http://127.0.0.1:8000',
  22. changeOrigin: true,
  23. ws: true,
  24. pathRewrite: {
  25. '^/tnb': '/tnb'
  26. }
  27. }
  28. }
  29. },
  30. configureWebpack: {
  31. // provide the app's title in webpack's name field, so that
  32. // it can be accessed in index.html to inject the correct title.
  33. name: name,
  34. resolve: {
  35. alias: {
  36. '@': resolve('src')
  37. }
  38. }
  39. }
  40. }