微小悟公众号管理系统

index.js 1.7KB

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