webpack.development.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. //开发环境配置
  2. const HtmlWebpackPlugin = require('html-webpack-plugin');
  3. // vue-loader15.*之后的版本都必须要加上这个,否则会报错
  4. const VueLoaderPlugin = require('vue-loader/lib/plugin');
  5. const CopyWebpackPlugin = require('copy-webpack-plugin'); //复制文件
  6. module.exports = {
  7. mode: 'development',
  8. output: {
  9. filename: 'bundle.js'
  10. },
  11. devtool: 'source-map',
  12. plugins: [
  13. new CopyWebpackPlugin([{
  14. from: "src/public",
  15. to: "public"
  16. }]),
  17. new HtmlWebpackPlugin({
  18. template: 'index.html'
  19. }),
  20. new VueLoaderPlugin()
  21. ],
  22. devServer: {
  23. index: "index.html", //默认文件名
  24. hot: true, //热更新
  25. host: "0.0.0.0",
  26. compress: true,
  27. port: 9000,
  28. disableHostCheck: true,
  29. proxy: {
  30. '/screen': {
  31. // target: "http://127.0.0.1:9008",
  32. target: "https://dzfarmingmapscream.dev.dazesoft.cn",
  33. pathRewrite: {
  34. "^/screen": ""
  35. },
  36. changeOrigin: true,
  37. },
  38. "/defdata": {
  39. target: "http://127.0.0.1:3002",
  40. // target: "http://lldp2.z.gyhywa.com:9527",
  41. pathRewrite: {
  42. "^/defdata": ""
  43. },
  44. changeOrigin: true
  45. },
  46. "/htdata": {
  47. // target: "http://lyfbht.hw.hongweisoft.com",
  48. target:"http://172.16.90.199:8104",
  49. // target: "http://47.111.224.169:8310",
  50. // target: 'http://58.16.127.62:2035',
  51. // pathRewrite: {
  52. // "^/htdata": ""
  53. // },
  54. changeOrigin: true
  55. },
  56. "/amapData": {
  57. target: "https://restapi.amap.com",
  58. // target: 'http://58.16.127.62:2035',
  59. pathRewrite: {
  60. "^/amapData": ""
  61. },
  62. changeOrigin: true
  63. },
  64. '/product': {
  65. target: 'http://ghost.nat300.top',
  66. pathRewrite: {
  67. '^/product': ''
  68. },
  69. changeOrigin: true
  70. },
  71. '/forest-admin': {
  72. target: 'http://lyfbht.hw.hongweisoft.com',
  73. changeOrigin: true
  74. }
  75. }
  76. }
  77. }