webpack.prod.js 874 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. var webpack = require("webpack");
  2. var UglifyJSPlugin = require("uglifyjs-webpack-plugin");
  3. var merge = require("webpack-merge");
  4. var common = require("./webpack.common.js");
  5. var path = require("path");
  6. module.exports = merge(common, {
  7. devtool: "source-map",
  8. devServer: {
  9. disableHostCheck: true,
  10. progress: true,
  11. proxy: {
  12. "/api/*": {
  13. target: "http://0.0.0.0:9000",
  14. changeOrigin: true,
  15. secure: false
  16. }
  17. },
  18. host: "0.0.0.0",
  19. contentBase: path.join(__dirname, "./"),
  20. publicPath: "/dist/",
  21. hot: false,
  22. inline: false
  23. },
  24. plugins: [
  25. new UglifyJSPlugin({
  26. sourceMap: true,
  27. uglifyOptions:{
  28. output: {
  29. comments: false,
  30. beautify: false
  31. }
  32. }
  33. }),
  34. new webpack.DefinePlugin({
  35. "process.env.NODE_ENV": JSON.stringify("production")
  36. })
  37. ]
  38. });