vue.config.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. 'use strict'
  2. const path = require('path')
  3. function resolve(dir) {
  4. return path.join(__dirname, dir)
  5. }
  6. // If your port is set to 80,
  7. // use administrator privileges to execute the command line.
  8. // For example, Mac: sudo npm run
  9. // You can change the port by the following methods:
  10. // port = 9528 npm run dev OR npm run dev --port = 9528
  11. const port = 9528 // dev port
  12. // All configuration item explanations can be find in https://cli.vuejs.org/config/
  13. module.exports = {
  14. /**
  15. * You will need to set publicPath if you plan to deploy your site under a sub path,
  16. * for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/,
  17. * then publicPath should be set to "/bar/".
  18. * In most cases please use '/' !!!
  19. * Detail: https://cli.vuejs.org/config/#publicpath
  20. */
  21. // publicPath: './',
  22. devServer: {
  23. port: port,
  24. open: true,
  25. disableHostCheck: true,
  26. overlay: {
  27. warnings: false,
  28. errors: true
  29. },
  30. proxy: {
  31. // '/api': {
  32. '/': {
  33. // target: 'https://www.yphyd.club',
  34. // target: 'https://127.0.0.1',
  35. target: 'http://127.0.0.1:8080',
  36. changeOrigin: true,
  37. pathRewrite: {
  38. '^/': ''
  39. }
  40. }
  41. }
  42. // after: require('./mock/mock-server.js')
  43. },
  44. chainWebpack(config) {
  45. config.resolve.alias
  46. .set('@', resolve('src'))
  47. .set('assets', resolve('src/assets'))
  48. .set('util', resolve('src/util'));
  49. },
  50. lintOnSave: false
  51. }