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

Cannot build Electron Vue app using Yarn 2 PnP #915

Closed
JoelTrain opened this issue Jul 22, 2020 · 19 comments
Closed

Cannot build Electron Vue app using Yarn 2 PnP #915

JoelTrain opened this issue Jul 22, 2020 · 19 comments

Comments

@JoelTrain
Copy link

Describe the bug
Able to run yarn serve to see the vue app fine, but cannot run yarn electron:serve without errors.

To Reproduce
Here is my package.json while using yarn 2 as my package manager.

{
  "name": "client",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "electron:build": "vue-cli-service electron:build",
    "electron:serve": "vue-cli-service electron:serve",
    "postinstall": "electron-builder install-app-deps",
    "postuninstall": "electron-builder install-app-deps"
  },
  "main": "background.js",
  "dependencies": {
    "@vue/cli": "^4.4.6",
    "@vue/cli-service": "~4.4.0",
    "@vue/cli-shared-utils": "^4.4.6",
    "electron": "9.0.0",
    "electron-builder": "^22.7.0",
    "electron-devtools-installer": "^3.1.0",
    "vue": "^2.6.11",
    "vue-cli-plugin-electron-builder": "2.0.0-rc.4",
    "vue-template-compiler": "^2.6.11"
  },
  "devDependencies": {
    "pnp-webpack-plugin": "^1.6.4"
  }
}

Expected behavior
Should start the electron app with no errors.


$ yarn electron:serve
 INFO  Starting development server...
98% after emitting CopyPlugin

 DONE  Compiled successfully in 1060ms                                                                                                            6:09:17 AM

  App running at:
  - Local:   http://localhost:8080/
  - Network: http://172.20.2.134:8080/

  Note that the development build is not optimized.
  To create a production build, run npm run build.

Error: Could not find a package.json for module @vue/cli
    at C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\lib\webpackConfig.js:137:19
    at Array.reduce (<anonymous>)
    at getExternals (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\lib\webpackConfig.js:98:57)
    at bundleMain (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:585:20)
    at startElectron (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:299:49)
    at C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:391:7
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: Could not find a package.json for module @vue/cli-service
    at C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\lib\webpackConfig.js:137:19
    at Array.reduce (<anonymous>)
    at getExternals (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\lib\webpackConfig.js:98:57)
    at bundleMain (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:585:20)
    at startElectron (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:299:49)
    at C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:391:7
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: Could not find a package.json for module @vue/cli-shared-utils
    at C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\lib\webpackConfig.js:137:19
    at Array.reduce (<anonymous>)
    at getExternals (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\lib\webpackConfig.js:98:57)
    at bundleMain (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:585:20)
    at startElectron (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:299:49)
    at C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:391:7
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: Could not find a package.json for module electron
    at C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\lib\webpackConfig.js:137:19
    at Array.reduce (<anonymous>)
    at getExternals (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\lib\webpackConfig.js:98:57)
    at bundleMain (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:585:20)
    at startElectron (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:299:49)
    at C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:391:7
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: Could not find a package.json for module electron-builder
    at C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\lib\webpackConfig.js:137:19
    at Array.reduce (<anonymous>)
    at getExternals (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\lib\webpackConfig.js:98:57)
    at bundleMain (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:585:20)
    at startElectron (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:299:49)
    at C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:391:7
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: Could not find a package.json for module electron-devtools-installer
    at C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\lib\webpackConfig.js:137:19
    at Array.reduce (<anonymous>)
    at getExternals (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\lib\webpackConfig.js:98:57)
    at bundleMain (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:585:20)
    at startElectron (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:299:49)
    at C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:391:7
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: Could not find a package.json for module vue
    at C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\lib\webpackConfig.js:137:19
    at Array.reduce (<anonymous>)
    at getExternals (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\lib\webpackConfig.js:98:57)
    at bundleMain (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:585:20)
    at startElectron (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:299:49)
    at C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:391:7
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: Could not find a package.json for module vue-cli-plugin-electron-builder
    at C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\lib\webpackConfig.js:137:19
    at Array.reduce (<anonymous>)
    at getExternals (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\lib\webpackConfig.js:98:57)
    at bundleMain (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:585:20)
    at startElectron (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:299:49)
    at C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:391:7
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: Could not find a package.json for module vue-template-compiler
    at C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\lib\webpackConfig.js:137:19
    at Array.reduce (<anonymous>)
    at getExternals (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\lib\webpackConfig.js:98:57)
    at bundleMain (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:585:20)
    at startElectron (C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:299:49)
    at C:\temp\.yarn\$$virtual\vue-cli-plugin-electron-builder-virtual-0a71385d5d\0\cache\vue-cli-plugin-electron-builder-npm-2.0.0-rc.4-ff81d6b2bf-23ec600f2a.zip\node_modules\vue-cli-plugin-electron-builder\index.js:391:7
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
\  Bundling main process...

 ERROR  Failed to compile with 1 errors                                                                                                           6:09:18 AM
This dependency was not found:

* vue-cli-plugin-electron-builder/lib in ./src/background.js

To install it, you can run: npm install --save vue-cli-plugin-electron-builder/lib
 ERROR  Build failed with errors.

Environment (please complete the following information):

  • custom config for vcp-electron-builder:
"presets": {
    "ProtoSetup": {
      "useConfigFiles": true,
      "plugins": {
        "@vue/cli-plugin-typescript": {
          "classComponent": false
        },
        "@vue/cli-plugin-router": {
          "historyMode": false
        },
        "@vue/cli-plugin-vuex": {},
        "@vue/cli-plugin-eslint": {
          "config": "prettier",
          "lintOn": [
            "save"
          ]
        },
        "@vue/cli-plugin-unit-jest": {}
      }
    },
  • terminal output from running vue info:
$ yarn vue info

Environment Info:

  System:
    OS: Windows 10 10.0.18363
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 14.5.0 - C:\Users\JoelTrain\AppData\Local\Temp\xfs-efebf09d\node.CMD
    Yarn: 2.1.1 - C:\Users\JoelTrain\AppData\Local\Temp\xfs-efebf09d\yarn.CMD
    npm: 6.14.5 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 84.0.4147.89
    Edge: Spartan (44.18362.449.0)
  npmGlobalPackages:
    @vue/cli: Not Found

Additional context
Any help with this is apprciated!

I guess maybe the problem is that I do not have @vue/cli installed as a global package.
Is that necessary? I am able to see the regular vue app on the web page without that, just not the electron version.

@JoelTrain
Copy link
Author

Tried adding @vue/cli as a global npm package as well, but it did not help

@JoelTrain
Copy link
Author

may be related to this electron/electron#22472

@JoelTrain
Copy link
Author

using this plugin has helped somewhat https://yarnpkg.com/api/modules/plugin_node_modules.html
but I am using a yarn root folder with a package.json with a nested yarn workspace underneath it with another package.json

and the nested one is still not getting all of the node_modules copied down from the higher level, this is likely more of an issue for the yarn github

@JoelTrain
Copy link
Author

after using the node-modules nodeLinker mode with Yarn 2
I can at least launch the electron vue app version, but I still get a lot of errors about missing node_modules

it looks like the reason those node_modules are not in that folder is because they have been hoisted up to the root folder since I am using a yarn workspace

and I am getting the issues described here yarnpkg/yarn#4503

@JoelTrain
Copy link
Author

looks like I need noHoist for use with vue-cli-plugin-electron-builder and it's use of webpack https://classic.yarnpkg.com/blog/2018/02/15/nohoist/

@nklayman
Copy link
Owner

See the code snippet on the using native modules section of the docs for yarn workspace support.

@JoelTrain
Copy link
Author

I have looked that over, and don't understand which of my dependencies are native.

@JoelTrain
Copy link
Author

I solved the issue actually by moving my top level package.json down into the folder I am using and not using Yarn 2's workspace feature. Since everything is only happening in one folder, there is no longer a need for hoisting and I can just do everything in one folder.

I think the issue is that Yarn 2 has no option to disable hoisting like version 1 did.

Even putting it in pnpMode: loose did not solve it.

@JoelTrain
Copy link
Author

the other way I solved it was to manually copy the missing node modules from the root level to the workspace folder node_modules folder

@JoelTrain
Copy link
Author

for anyone seeing this later, perhaps an alternative would have been to use
https://github.com/arcanis/pnp-webpack-plugin
and then you can use nodeLinker: "pnp" in your .yarn.yml
https://yarnpkg.com/configuration/yarnrc#nodeLinker

@JoelTrain
Copy link
Author

I am going to close this issue, since it appears to be more of an issue with Yarn Berry (version 2) than with this plugn.

Thanks for the response, and feel free to re-open this issue if you decide it is necessary.

@nklayman
Copy link
Owner

@JoelTrain have you configured nodeModulesPath? It should help with your workspace issues.

// vue.config.js
module.exports = {
  pluginOptions: {
    electronBuilder: {
      // If you are using Yarn Workspaces, you may have multiple node_modules folders
      // List them all here so that VCP Electron Builder can find them
      nodeModulesPath: ['../../node_modules', './node_modules']
    }
  }
}

@JoelTrain
Copy link
Author

Yup I had that configured but the webpack calls in the vue-cli-plugin-electron-builder were not using it. Though I did have multiple node nodules paths in that array

@fanthos
Copy link
Contributor

fanthos commented Jan 21, 2021

  if (process.versions.pnp) {
    const PnpWebpackPlugin = require(`pnp-webpack-plugin`)

    config.resolve
      .plugin('pnp')
      .use(PnpWebpackPlugin)

    config.resolveLoader
      .plugin('pnp')
      .use(PnpWebpackPlugin.moduleLoader(module))
  }

This block should added to bundleMain in vue-cli-plugin-electron-builder/index.js to support auto detect yarn pnp support.

node_modules not support by yarn pnp, require.resolve should use instead of path.resolve.

@nklayman
Copy link
Owner

@fanthos until Vue CLI itself supports Yarn PNP, I'm not going to add support to this plugin. See vuejs/vue-cli#2850 for Vue CLI's status.

@fanthos
Copy link
Contributor

fanthos commented Jan 25, 2021

Currently vue-cli works great with yarn run serve.

in webpackConfig.js, the following lines(L102-L114) should move outside if block.

          // If dep is in whitelist, don't add it no matter what
          if (userExternalsWhitelist.includes(dep)) {
            return depList
          }
          const name = userExternals.find((name) =>
            new RegExp(`^${dep}(/|$)`).test(name)
          )
          // If dep is listed in user external array, it is an external
          if (name) {
            // Use user-provided name if it exists to support subpaths
            depList.push(name || dep)
            return depList
          }

@nklayman
Copy link
Owner

Why should those lines be moved outside the if block? I don't see what that would accomplish.

@fanthos
Copy link
Contributor

fanthos commented Jan 25, 2021

For example, some pure js package does not have ['main', 'module', 'jsnext:main', 'browser'] in package.json, it this function will mark the package external. I can manually remove it from external and bundle it in dist files using pluginOptions.electronBuilder.externals.

Setting process.env.VCPEB_EXPERIMENTAL_NATIVE_DEP_CHECK = 1 in vue.config.js could use for temporary workaround for this.

@nklayman
Copy link
Owner

If you enable the new native dep checker then it will set that env var and use the new checker. I will be enabling it by default in the next release but I wanted people to test it out beforehand so I don't cause any breaking changes.

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

3 participants