vue.config.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. builderOptions: {
  23. // build配置在此处
  24. // options placed here will be merged with default configuration and passed to electron-builder
  25. "appId": "XXX",
  26. "directories": {
  27. "output": process.env.NODE_ENV === 'production' ? "dist_electron" : "test_electron" // 输出文件夹
  28. },
  29. "publish": [
  30. {
  31. "provider": "generic",
  32. "url": "https://pc.liebaoai.cn/download/",//更新服务器地址,可为空
  33. }
  34. ],
  35. "mac": {
  36. "icon": "./static/image/desk-logo.ico",
  37. },
  38. "win": {
  39. "icon": "./static/image/desk-logo.ico",
  40. "artifactName": `${name}-v${version}-setup.exe`,
  41. "target": [{
  42. "target": "nsis", "arch": ["ia32"]
  43. }]
  44. },
  45. "linux": {
  46. "icon": "./static/image/desk-logo.ico",
  47. "artifactName": `${name}-v${version}-setup.exe`
  48. },
  49. // "asar": false,
  50. "nsis": {
  51. "oneClick": false,
  52. "guid": "猎豹AI聚合配送",
  53. "perMachine": true,
  54. "allowElevation": true,
  55. "allowToChangeInstallationDirectory": true,
  56. "installerIcon": "./static/image/desk-logo.ico",
  57. "uninstallerIcon": "./static/image/desk-logo.ico",
  58. "installerHeaderIcon": "./static/image/desk-logo.ico",
  59. "createDesktopShortcut": true,
  60. "createStartMenuShortcut": true,
  61. "shortcutName": process.env.NODE_ENV === 'production' ? "猎豹AI聚合配送" : "猎豹AI聚合配送测试版"
  62. }
  63. }
  64. }
  65. }
  66. }