1234567891011121314151617181920212223242526272829303132333435363738
  1. module.exports = {
  2. env: {
  3. NODE_ENV: '"production"'
  4. },
  5. defineConstants: {
  6. HOST: '"http://localhost:9087"'
  7. },
  8. mini: {},
  9. h5: {
  10. /**
  11. * WebpackChain 插件配置
  12. * @docs https://github.com/neutrinojs/webpack-chain
  13. */
  14. // webpackChain (chain) {
  15. // /**
  16. // * 如果 h5 端编译后体积过大,可以使用 webpack-bundle-analyzer 插件对打包体积进行分析。
  17. // * @docs https://github.com/webpack-contrib/webpack-bundle-analyzer
  18. // */
  19. // chain.plugin('analyzer')
  20. // .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [])
  21. // /**
  22. // * 如果 h5 端首屏加载时间过长,可以使用 prerender-spa-plugin 插件预加载首页。
  23. // * @docs https://github.com/chrisvfritz/prerender-spa-plugin
  24. // */
  25. // const path = require('path')
  26. // const Prerender = require('prerender-spa-plugin')
  27. // const staticDir = path.join(__dirname, '..', 'dist')
  28. // chain
  29. // .plugin('prerender')
  30. // .use(new Prerender({
  31. // staticDir,
  32. // routes: [ '/pages/index/index' ],
  33. // postProcess: (context) => ({ ...context, outputPath: path.join(staticDir, 'index.html') })
  34. // }))
  35. // }
  36. }
  37. }