vue.config.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. module.exports = {
  2. outputDir:"yos",
  3. lintOnSave: false,
  4. productionSourceMap:false,
  5. publicPath: './',
  6. chainWebpack: (config) => {
  7. config.cache({
  8. type: 'filesystem',
  9. buildDependencies: {
  10. config: [__filename],
  11. },
  12. });
  13. },
  14. configureWebpack: {
  15. optimization: {
  16. splitChunks: {
  17. cacheGroups: {
  18. 'element-ui': {
  19. test: /[\\/]node_modules[\\/]element-ui[\\/]/,
  20. name: 'chunk-element-ui',
  21. priority: 20,
  22. chunks: 'all',
  23. },
  24. 'antv': {
  25. test: /[\\/]node_modules[\\/]@antv[\\/]/,
  26. name: 'chunk-antv',
  27. priority: 20,
  28. chunks: 'all',
  29. },
  30. 'ant-design-vue': {
  31. test: /[\\/]node_modules[\\/]ant-design-vue[\\/]/,
  32. name: 'chunk-antd',
  33. priority: 20,
  34. chunks: 'all',
  35. },
  36. },
  37. },
  38. },
  39. },
  40. devServer: {
  41. headers: {
  42. 'Access-Control-Allow-Origin': '*',
  43. },
  44. open: true,
  45. host: 'localhost',
  46. port: 8000,
  47. proxy: {
  48. '/apis': {
  49. target: 'http://61.164.207.46:8000',
  50. ws: true,
  51. changeOrigin: true,
  52. pathRewrite: {
  53. '^/apis': '',
  54. },
  55. },
  56. }
  57. }
  58. }