index.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // see http://vuejs-templates.github.io/webpack for documentation.
  2. var path = require('path')
  3. module.exports = {
  4. build: {
  5. env: require('./prod.env'),
  6. index: path.resolve(__dirname, '../dist/index.html'),
  7. assetsRoot: path.resolve(__dirname, '../dist'),
  8. assetsSubDirectory: 'static',
  9. assetsPublicPath: './',
  10. productionSourceMap: false,
  11. // Gzip off by default as many popular static hosts such as
  12. // Surge or Netlify already gzip all static assets for you.
  13. // Before setting to `true`, make sure to:
  14. // npm install --save-dev compression-webpack-plugin
  15. productionGzip: false,
  16. productionGzipExtensions: ['js', 'css'],
  17. // Run the build command with an extra argument to
  18. // View the bundle analyzer report after build finishes:
  19. // `npm run build --report`
  20. // Set to `true` or `false` to always turn it on or off
  21. bundleAnalyzerReport: process.env.npm_config_report
  22. },
  23. dev: {
  24. env: require('./dev.env'),
  25. port: 8086,
  26. autoOpenBrowser: true,
  27. assetsSubDirectory: 'static',
  28. assetsPublicPath: '/',
  29. proxyTable: {
  30. '/api':{
  31. // target:'http://jsonplaceholder.typicode.com',
  32. target: 'http://127.0.0.1:3000/api/',
  33. changeOrigin:true,
  34. pathRewrite:{
  35. '^/api':''
  36. }
  37. },
  38. // '/ms':{
  39. // target: 'https://www.easy-mock.com/mock/592501a391470c0ac1fab128',
  40. // changeOrigin: true
  41. // }
  42. },
  43. // CSS Sourcemaps off by default because relative paths are "buggy"
  44. // with this option, according to the CSS-Loader README
  45. // (https://github.com/webpack/css-loader#sourcemaps)
  46. // In our experience, they generally work as expected,
  47. // just be aware of this issue when enabling this option.
  48. cssSourceMap: false
  49. }
  50. }