zhengyiming
2025-03-27 538e4f454ba3126ef92278ab9cb675adb9e3b287
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const path = require('path');
 
module.exports = {
  env: {
    NODE_ENV: '"production"',
    BASE_URL: '"https://jfapi.81812333.com"',
    BASE_URL_H5: '"https://jfapi.81812333.com"',
    BASE_URL_JX: '"https://jfapi.81812333.com"',
 
    WEMAP_KEY: 'DYRBZ-ZGPCF-X3OJN-N2AA3-JWUCE-HEBXJ',
    WXPayAppId: '"wxf940ff1d35a98493"',
  },
  defineConstants: {
    OSS_URL: '"https://parkmanagement.oss-cn-hangzhou.aliyuncs.com"',
    CLIENT_ORIGIN: '"https://jf.81812333.com"',
  },
  mini: {},
  h5: {
    output: {
      path: path.resolve(__dirname, '..', `dist/h5-prod`),
    },
    /**
     * WebpackChain 插件配置
     * @docs https://github.com/neutrinojs/webpack-chain
     */
    // webpackChain (chain) {
    //   /**
    //    * 如果 h5 端编译后体积过大,可以使用 webpack-bundle-analyzer 插件对打包体积进行分析。
    //    * @docs https://github.com/webpack-contrib/webpack-bundle-analyzer
    //    */
    //   chain.plugin('analyzer')
    //     .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [])
    //   /**
    //    * 如果 h5 端首屏加载时间过长,可以使用 prerender-spa-plugin 插件预加载首页。
    //    * @docs https://github.com/chrisvfritz/prerender-spa-plugin
    //    */
    //   const path = require('path')
    //   const Prerender = require('prerender-spa-plugin')
    //   const staticDir = path.join(__dirname, '..', 'dist')
    //   chain
    //     .plugin('prerender')
    //     .use(new Prerender({
    //       staticDir,
    //       routes: [ '/pages/index/index' ],
    //       postProcess: (context) => ({ ...context, outputPath: path.join(staticDir, 'index.html') })
    //     }))
    // }
  },
};