vue.config.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. const path = require('path')
  2. const webpack = require('webpack')
  3. function resolve(dir) {
  4. return path.join(__dirname, dir)
  5. }
  6. // vue.config.js
  7. module.exports = {
  8. pages: {
  9. index: {
  10. // page 的入口
  11. entry: 'src/main.js',
  12. // 模板来源
  13. template: 'public/index.html',
  14. // 在 dist/index.html 的输出
  15. filename: 'index.html',
  16. // 当使用 title 选项时,
  17. // template 中的 title 标签需要是 <title><%= htmlWebpackPlugin.options.title %></title>
  18. title: '河北省住房和城乡建设厅空间信息资源服务平台',
  19. // 在这个页面中包含的块,默认情况下会包含
  20. // 提取出来的通用 chunk 和 vendor chunk。
  21. chunks: ['chunk-vendors', 'chunk-common', 'index']
  22. }
  23. },
  24. // ...other config
  25. configureWebpack: {
  26. // webpack plugins
  27. plugins: [
  28. // Ignore all locale files of moment.js
  29. new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
  30. ]
  31. },
  32. productionSourceMap: false, //打包不生成js.map文件
  33. chainWebpack: (config) => {
  34. config.resolve.alias
  35. .set('@$', resolve('src'))
  36. .set('@static', resolve('public/static'))
  37. },
  38. css: {
  39. loaderOptions: {
  40. less: {
  41. modifyVars: {
  42. 'primary-color': '#F05A28',
  43. 'border-color-base': '#F05A28',
  44. 'heading-color': 'rgba(240, 90, 40, 1)',
  45. 'link-color': '#F05A28'
  46. },
  47. javascriptEnabled: true
  48. },
  49. }
  50. },
  51. pluginOptions: {
  52. "style-resources-loader": {
  53. preProcessor: "less",
  54. patterns: [
  55. path.resolve(__dirname, 'src/assets/less/variable.less')
  56. ]
  57. }
  58. },
  59. devServer: {
  60. port: 1004,
  61. proxy: {
  62. '/proxy_oauth/': {
  63. target: 'http://121.43.55.7:10086',
  64. changeOrigin: true,
  65. pathRewrite: {
  66. '^/proxy_oauth': ''
  67. }
  68. },
  69. '/proxy_data/': {
  70. target: 'http://121.43.55.7:10087',
  71. // target: 'http://192.168.1.61:10087',
  72. changeOrigin: true,
  73. pathRewrite: {
  74. '^/proxy_data': ''
  75. }
  76. },
  77. '/proxy_icon/': {
  78. target: 'http://121.43.55.7:10085',
  79. changeOrigin: true,
  80. pathRewrite: {
  81. '^/proxy_icon': ''
  82. }
  83. },
  84. '/proxy_geoserver/': {
  85. target: 'http://121.43.55.7:8889',
  86. changeOrigin: true,
  87. pathRewrite: {
  88. '^/proxy_geoserver': ''
  89. }
  90. },
  91. }
  92. }
  93. }