| 12345678910111213141516171819202122232425 |
- // vue.config.js - disable thread-loader for compatibility
- // 2026-11-03 H5 部署配置:
- // - publicPath:生产构建产物以 /frontend/ 为根(配合 cfc.iwintrue.com/frontend 反代);
- // dev 模式保持 '/'(dev server 直接访问 http://127.0.0.1:8551/ 不受影响)
- // - devServer.port:uni-app H5 dev server 端口 8081 → 8551(原 8080 被 gogs 占用)
- module.exports = {
- parallel: false, // Ensure we use the correct source directory
- publicPath: process.env.NODE_ENV === 'production' ? '/frontend/' : '/',
- pages: undefined,
- devServer: {
- port: 8551
- },
- configureWebpack: {
- resolve: {
- extensions: ['.vue', '.js', '.json'], // Ensure .vue files resolve correctly
- },
- // node:false 会禁用 global/process polyfill,uni-app H5 运行时在浏览器访问 global 报
- // "global is not defined"(模块 1d50:global.__uniConfig / global["____DA59D6D____"])。
- // 改用 webpack4 node 配置:注入 global(=> window)与 process,兼容 uni-app H5 运行时。
- node: {
- global: true,
- process: true,
- },
- },
- }
|