webpack.config.js 959 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. var path = require("path");
  2. var OpenBrowserPlugin = require("open-browser-webpack-plugin");
  3. module.exports = {
  4. entry: "./index.js",
  5. output: {
  6. filename: "boundle.js",
  7. path: path.resolve(__dirname, "dist/"),
  8. publicPath: "/test/"
  9. },
  10. module: {
  11. rules: [
  12. {
  13. test: /\.js$/,
  14. include: [path.resolve(__dirname, "./index.js")],
  15. use: {
  16. loader: "babel-loader"
  17. }
  18. },
  19. {
  20. test: /\.js$/,
  21. enforce: "post",
  22. loader: "es3ify-loader"
  23. }
  24. ]
  25. },
  26. plugins:[
  27. new OpenBrowserPlugin({ url: 'http://0.0.0.0:8000/' })
  28. ],
  29. devServer: {
  30. disableHostCheck: true,
  31. progress: true,
  32. proxy: {
  33. "/api/*": {
  34. target: "http://0.0.0.0:9000",
  35. changeOrigin: true,
  36. secure: false
  37. }
  38. },
  39. host: "0.0.0.0",
  40. port: 8000,
  41. contentBase: path.join(__dirname, "./"),
  42. publicPath: "/dist/",
  43. hot: true,
  44. inline: false
  45. }
  46. };