vue.config.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. const { resolve } = require('path')
  2. const { name, version } = require('./package.json')
  3. module.exports = {
  4. publicPath: "/",
  5. outputDir: process.env.NODE_ENV === 'production' ? "dist" : process.env.NODE_ENV === 'test' ? "test" : "dist",
  6. assetsDir: "static",
  7. lintOnSave: false, // 关闭eslint
  8. runtimeCompiler: true,
  9. chainWebpack: config => {
  10. config.resolve.alias
  11. .set('@', resolve('src'))
  12. },
  13. pluginOptions: {
  14. 'style-resources-loader': {
  15. preProcessor: 'sass',
  16. patterns: [
  17. resolve(__dirname, './src/assets/styles/*.scss') //你的.scss文件所在目录
  18. ]
  19. },
  20. // 桌面应用打包配置
  21. electronBuilder: {
  22. preload : 'src/preload.js',
  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}-setup.exe`,
  42. "target": [ { "target": "nsis", "arch": [ "x64", "ia32" ] } ]
  43. },
  44. "linux": {
  45. "icon": "./static/image/desk-logo.ico",
  46. "artifactName": `${name}-v${version}-setup.exe`
  47. },
  48. // "asar": false,
  49. "nsis": {
  50. "oneClick": false,
  51. "guid": "猎豹AI聚合配送",
  52. "perMachine": true,
  53. "allowElevation": true,
  54. "allowToChangeInstallationDirectory": true,
  55. "installerIcon": "./static/image/desk-logo.ico",
  56. "uninstallerIcon": "./static/image/desk-logo.ico",
  57. "installerHeaderIcon": "./static/image/desk-logo.ico",
  58. "createDesktopShortcut": true,
  59. "createStartMenuShortcut": true,
  60. "shortcutName": process.env.NODE_ENV === 'production' ? "猎豹AI聚合配送" : "猎豹AI聚合配送测试版"
  61. }
  62. }
  63. }
  64. }
  65. }