vue.config.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. const { resolve } = require('path')
  2. const { name, version } = require('./package.json')
  3. console.log('安装包:', `${name}-v${version}-${process.platform}-${process.arch}-setup.exe`);
  4. module.exports = {
  5. publicPath: "/",
  6. outputDir: process.env.NODE_ENV === 'production' ? "dist" : process.env.NODE_ENV === 'test' ? "test" : "dist",
  7. assetsDir: "static",
  8. lintOnSave: false, // 关闭eslint
  9. runtimeCompiler: true,
  10. chainWebpack: config => {
  11. config.resolve.alias
  12. .set('@', resolve('src'))
  13. },
  14. pluginOptions: {
  15. 'style-resources-loader': {
  16. preProcessor: 'sass',
  17. patterns: [
  18. resolve(__dirname, './src/assets/styles/*.scss') //你的.scss文件所在目录
  19. ]
  20. },
  21. // 桌面应用打包配置
  22. electronBuilder: {
  23. builderOptions: {
  24. // build配置在此处
  25. // options placed here will be merged with default configuration and passed to electron-builder
  26. "appId": "XXX",
  27. "directories": {
  28. "output": process.env.NODE_ENV === 'production' ? "dist_electron" : "test_electron" // 输出文件夹
  29. },
  30. "publish": [
  31. {
  32. "provider": "generic",
  33. "url": "https://pc.liebaoai.cn/download/",//更新服务器地址,可为空
  34. }
  35. ],
  36. "mac": {
  37. "icon": "./static/image/desk-logo.ico",
  38. },
  39. "win": {
  40. "icon": "./static/image/desk-logo.ico",
  41. // "artifactName": `${name}-v${version}-${process.platform}-${process.arch}-setup.exe`,
  42. // "target": [{
  43. // "target": "nsis", "arch": ["x64","ia32"]
  44. // }]
  45. },
  46. "linux": {
  47. "icon": "./static/image/desk-logo.ico",
  48. // "artifactName": `${name}-v${version}-${process.platform}-${process.arch}-setup.exe`
  49. },
  50. // "asar": false,
  51. "nsis": {
  52. "oneClick": false,
  53. "guid": "猎豹AI聚合配送",
  54. "perMachine": true,
  55. "allowElevation": true,
  56. "allowToChangeInstallationDirectory": true,
  57. "installerIcon": "./static/image/desk-logo.ico",
  58. "uninstallerIcon": "./static/image/desk-logo.ico",
  59. "installerHeaderIcon": "./static/image/desk-logo.ico",
  60. "createDesktopShortcut": true,
  61. "createStartMenuShortcut": true,
  62. "shortcutName": process.env.NODE_ENV === 'production' ? "猎豹AI聚合配送" : "猎豹AI聚合配送测试版"
  63. }
  64. }
  65. }
  66. }
  67. }