Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问为什么electron 打包 只有这个 会进app.asar.unpacked #3

Closed
naxiemolv opened this issue Jun 26, 2019 · 4 comments
Closed

Comments

@naxiemolv
Copy link

不能正常装进 app.asar

@bergkamp
Copy link

我遇到了类似问题,mac下打包安装后运行时收到错误提示

Error: Cannot find module 'font-list'

把asar拆开发现node_modules目录中没有font-list目录,app.asar.unpacked 中也没有

环境如下

"devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-eslint": "~4.5.0",
    "@vue/cli-service": "^4.5.13",
    "babel-eslint": "^10.1.0",
    "electron": "^11.0.0",
    "electron-builder": "^22.10.5",
    "electron-devtools-installer": "^3.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-vue": "^6.2.2",
    "vue-cli-plugin-electron-builder": "^2.0.0",
    "vue-template-compiler": "^2.6.11"
  },

谢谢

@oldj
Copy link
Owner

oldj commented Jun 28, 2021

@bergkamp 你的打包命令或者脚本是怎样的?去掉敏感信息后贴一下呢?

@bergkamp
Copy link

@oldj
命令很简单 vue-cli-service electron:build

以下是vue.config.js的内容

module.exports = {
  configureWebpack: {
    devtool: 'source-map',
    devServer: {
      host: 'localhost',
    },
  },
  pluginOptions: {
    
    electronBuilder: {
      nodeIntegration: true,
      builderOptions: {
        productName: "xxxx",
        appId: 'xxxx',
        mac: {
          icon: './src/icons/icon.icns',
        },
        win: {
          icon: './src/icons/icon.png',
          target: 'nsis'
        },
        nsis: {//https://www.electron.build/generated/nsisoptions
          oneClick: false,
          allowToChangeInstallationDirectory: true,
          createDesktopShortcut: true
        },
        mas: {
          hardenedRuntime: false,
          type: "distribution",
          entitlements: "build/entitlements.mas.plist",
          entitlementsInherit: "build/entitlements.mas.inherit.plist",
          category: "public.app-category.photography",
          provisioningProfile: "build/zxxx.provisionprofile"
        },
        masDev: {
          hardenedRuntime: false,
          type: "development",
          entitlements: "build/entitlements.mas.plist",
          category: "public.app-category.photography",
          provisioningProfile: "build/zxxx.provisionprofile",
        },
        extraFiles: [
          {
            from: "static",
            to: "static"
          }
        ]
      }
    }
  }
}

@Beats0
Copy link

Beats0 commented Mar 22, 2022

see #29

@oldj oldj closed this as completed Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants