webpack.development.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. pathRewrite: {
  33. "^/screen": ""
  34. },
  35. changeOrigin: true,
  36. },
  37. "/defdata": {
  38. target: "http://127.0.0.1:3002",
  39. // target: "http://lldp2.z.gyhywa.com:9527",
  40. pathRewrite: {
  41. "^/defdata": ""
  42. },
  43. changeOrigin: true
  44. },
  45. "/htdata": {
  46. // target: "http://lyfbht.hw.hongweisoft.com",
  47. target:"http://172.16.90.199:8104",
  48. // target: "http://47.111.224.169:8310",
  49. // target: 'http://58.16.127.62:2035',
  50. // pathRewrite: {
  51. // "^/htdata": ""
  52. // },
  53. changeOrigin: true
  54. },
  55. "/amapData": {
  56. target: "https://restapi.amap.com",
  57. // target: 'http://58.16.127.62:2035',
  58. pathRewrite: {
  59. "^/amapData": ""
  60. },
  61. changeOrigin: true
  62. },
  63. '/product': {
  64. target: 'http://ghost.nat300.top',
  65. pathRewrite: {
  66. '^/product': ''
  67. },
  68. changeOrigin: true
  69. },
  70. '/forest-admin': {
  71. target: 'http://lyfbht.hw.hongweisoft.com',
  72. changeOrigin: true
  73. }
  74. }
  75. }
  76. }