vue.config.js 826 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * 配置该文件可以参考:
  3. * https://cli.vuejs.org/zh/config/#%E7%9B%AE%E6%A0%87%E6%B5%8F%E8%A7%88%E5%99%A8
  4. *
  5. */
  6. const url = 'http://localhost:6100'
  7. // 基础路径,发布前修改这里,当前配置打包出来的资源都是相对路径
  8. let publicPath = './'
  9. module.exports = {
  10. publicPath: publicPath,
  11. lintOnSave: true,
  12. productionSourceMap: false,
  13. css: {
  14. // 忽略 CSS order 顺序警告
  15. extract: {ignoreOrder: true}
  16. },
  17. chainWebpack: config => {
  18. const entry = config.entry('app')
  19. entry
  20. .add('babel-polyfill')
  21. .end()
  22. entry
  23. .add('classlist-polyfill')
  24. .end()
  25. },
  26. // 配置转发代理
  27. devServer: {
  28. port: 6010,
  29. proxy: {
  30. '/': {
  31. target: url,
  32. ws: true,
  33. pathRewrite: {
  34. '^/': '/'
  35. }
  36. }
  37. }
  38. }
  39. }