vue.config.js 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // const path = require('path');
  2. //
  3. // function resolve(dir) {
  4. // return path.join(__dirname, dir)//path.join(__dirname)设置绝对路径
  5. // }
  6. module.exports = {
  7. // transpileDependencies: true,
  8. publicPath: './',
  9. outputDir: 'dist',
  10. assetsDir: 'static',
  11. lintOnSave: false, // eslint-loader 是否在保存的时候检查
  12. productionSourceMap: true,
  13. // devServer: {
  14. // host: '0.0.0.0',
  15. // open: false,
  16. // proxy: {
  17. // '/': {
  18. // // target:'http://192.168.0.2:7777/',//开发
  19. // // target:'http://192.168.0.222:7777/',//开发
  20. // // target:'http://192.168.1.253:7777/',//测试
  21. // target:'http://data.cqna.gov.cn/',//线上
  22. // changeOrigin: true,
  23. // pathRewrite: {
  24. // '^ /': ''
  25. // }
  26. // },
  27. // },
  28. // disableHostCheck: true,
  29. // }
  30. pluginOptions: {
  31. electronBuilder: {
  32. customFileProtocol: "./",
  33. nodeIntegration: true,
  34. externals: ['serialport'],
  35. builderOptions: {
  36. "productName": "cxj-client",
  37. "appId": "com.apitool",
  38. "win": {
  39. },
  40. //window自动义安装
  41. "nsis": {
  42. "oneClick": false, //是否静默安装(一键式安装)
  43. "perMachine": true, //安装模式 true=所有用户 false=自己
  44. "allowElevation": true, //允许请求提升。 如果为false,则用户必须使用提升的权限重新启动安装程序
  45. "allowToChangeInstallationDirectory": true, //是否安装时是否能更换安装目录
  46. "createDesktopShortcut": true, //是否创建桌面快捷建
  47. "menuCategory": true, //是否在开始菜单里创建子菜单
  48. // "installerIcon": "build/icons/icon.ico", //安装应用的图片,一定要 ico格式的图片
  49. // "installerSidebar": "public/logo.bmp", //安装程序左边的图片,一定是要位图 bmp 格式 一定要 164*314
  50. // "uninstallerSidebar": "build/icons/uninstall.bmp", //安装程序左边的图片,一定是要位图 bmp 格式 一定要 164*314
  51. // "include": "scripts/installer.nsi"
  52. }
  53. }
  54. }
  55. }
  56. // chainWebpack(config) {
  57. // // set svg-sprite-loader
  58. // config.module
  59. // .rule('svg')
  60. // .exclude.add(resolve('src/icons'))
  61. // .end()
  62. // config.module
  63. // .rule('icons')
  64. // .test(/\.svg$/)
  65. // .include.add(resolve('src/icons'))
  66. // .end()
  67. // .use('svg-sprite-loader')
  68. // .loader('svg-sprite-loader')
  69. // .options({symbolId: 'icon-[name]'})
  70. // .end()
  71. // // 配置别名
  72. // config.resolve.alias
  73. // .set('@', resolve('./src'))
  74. // .set('public', resolve('./public'))
  75. // }
  76. }