vue.config.js 812 B

1234567891011121314151617181920212223242526272829303132333435363738
  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:9999'
  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. proxy: {
  29. '/': {
  30. target: url,
  31. ws: true,
  32. pathRewrite: {
  33. '^/': '/'
  34. }
  35. }
  36. }
  37. }
  38. }