webpack.development.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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://47.111.224.169:8310",
  48. // target: 'http://58.16.127.62:2035',
  49. // pathRewrite: {
  50. // "^/htdata": ""
  51. // },
  52. changeOrigin: true
  53. },
  54. "/amapData": {
  55. target: "https://restapi.amap.com",
  56. // target: 'http://58.16.127.62:2035',
  57. pathRewrite: {
  58. "^/amapData": ""
  59. },
  60. changeOrigin: true
  61. },
  62. '/product': {
  63. target: 'http://ghost.nat300.top',
  64. pathRewrite: {
  65. '^/product': ''
  66. },
  67. changeOrigin: true
  68. },
  69. '/forest-admin': {
  70. target: 'http://lyfbht.hw.hongweisoft.com',
  71. changeOrigin: true
  72. }
  73. }
  74. }
  75. }