{"action":"created","issue":{"url":"https://api.github.com/repos/nklayman/vue-cli-plugin-electron-builder/issues/51","repository_url":"https://api.github.com/repos/nklayman/vue-cli-plugin-electron-builder","labels_url":"https://api.github.com/repos/nklayman/vue-cli-plugin-electron-builder/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/nklayman/vue-cli-plugin-electron-builder/issues/51/comments","events_url":"https://api.github.com/repos/nklayman/vue-cli-plugin-electron-builder/issues/51/events","html_url":"https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/51","id":351211719,"node_id":"MDU6SXNzdWUzNTEyMTE3MTk=","number":51,"title":"Errors retrieving paths, node-module externalization?","user":{"login":"lspohn","id":32612162,"node_id":"MDQ6VXNlcjMyNjEyMTYy","avatar_url":"https://avatars1.githubusercontent.com/u/32612162?v=4","gravatar_id":"","url":"https://api.github.com/users/lspohn","html_url":"https://github.com/lspohn","followers_url":"https://api.github.com/users/lspohn/followers","following_url":"https://api.github.com/users/lspohn/following{/other_user}","gists_url":"https://api.github.com/users/lspohn/gists{/gist_id}","starred_url":"https://api.github.com/users/lspohn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lspohn/subscriptions","organizations_url":"https://api.github.com/users/lspohn/orgs","repos_url":"https://api.github.com/users/lspohn/repos","events_url":"https://api.github.com/users/lspohn/events{/privacy}","received_events_url":"https://api.github.com/users/lspohn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-08-16T13:43:40Z","updated_at":"2018-08-19T17:43:22Z","closed_at":"2018-08-17T17:38:18Z","author_association":"NONE","body":"**Describe the bug**\r\n\r\nHello! Thanks a lot to your for providing this plugin.\r\n\r\nI tried to migrate my project from electron-webpack to vue-cli-plugin-electron-builder cause HMR is broken in electron-webpack atm.\r\n\r\nI created a new project with vue cli and then merged the automatically created files with my project and deleted the unneccesary ones.\r\n\r\nWhen I run serve:electron, I get the error shown in the screenshot. Note that leveldown is a native dependency in my project and shouldnt be included in Webpack.\r\n\r\n![image](https://user-images.githubusercontent.com/32612162/44211957-66512780-a16a-11e8-9766-4e4e433f3831.png)\r\n\r\nWith electron-webpack, the \"renderer.js\" webpack file has 4,000 lines.\r\nWith vue-cli-plugin-electron-builder, I get to 19,000 lines in \"app.js\"!\r\n\r\nI suspected that webpack didn't externalize the node-modules. \r\n\r\nSo I then changed the vue.js.config to externalize all packages in my package.json by webpack (see below). Then, I get a strange path error. It seems to try to fetch modules from:\r\n\r\n\"C:\\[appfolder]\\node_modules\\electron\\dist\\resources\\default_app.asar\\node_modules\"\r\n\"C:\\[appfolder]\\node_modules\\electron\\dist\\resources\\node_modules\"\r\n\"C:\\[appfolder]\\node_modules\\electron\\dist\\resources\\electron.asar\\renderer\\api\\exports\"\r\nand throws an error (cause package is located in \"C:\\[appfolder]\\node_modules\")\r\n\r\nTo summarize:\r\n- Something's wrong with the module externalization\r\n- Something's wrong with the path.\r\n\r\nThanks a lot for your help.\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n- Add node-modules as webpack.externals\r\n- Check projects with native libraries\r\n\r\n\r\n**Environment (please complete the following information):**\r\n - OS and version: Win 10 x64 Prof\r\n - Node version: 8.11.4\r\n - npm version: recent\r\n - yarn version (if used): recent\r\n - other vue plugins used: \r\n    \"vue\": \"^2.5.17\",\r\n    \"vue-async-computed\": \"^3.4.0\",\r\n    \"vue-electron\": \"^1.0.6\",\r\n    \"vue-router\": \"^3.0.1\",\r\n    \"vue-shortkey\": \"^3.0.2\",\r\n    \"vuedraggable\": \"^2.16.0\",\r\n    \"vuetify\": \"^1.1.11\"\r\n    \"@vue/cli-plugin-babel\": \"^3.0.0\",\r\n    \"@vue/cli-plugin-eslint\": \"^3.0.0\",\r\n    \"@vue/cli-plugin-unit-jest\": \"^3.0.0\",\r\n    \"@vue/cli-service\": \"^3.0.0\",\r\n    \"@vue/eslint-config-standard\": \"^3.0.0\",\r\n    \"@vue/test-utils\": \"^1.0.0-beta.20\",\r\n    \"vue-cli-plugin-electron-builder\": \"^1.0.0-beta.6\",\r\n    \"vue-template-compiler\": \"^2.5.17\",\r\n - custom config for vcp-electron-builder: \r\n```\r\nvar nodeExternals = require('webpack-node-externals');\r\nmodule.exports = {\r\n  pluginOptions: {\r\n    electronBuilder: {\r\n      chainWebpackRendererProcess: config => {\r\n        config.externals(nodeExternals(\r\n          {\r\n            modulesFromFile: true,\r\n            whitelist: ['vue']\r\n          }\r\n        ))\r\n        return config\r\n      },\r\n  }\r\n}\r\n}\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/nklayman/vue-cli-plugin-electron-builder/issues/comments/414143466","html_url":"https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/51#issuecomment-414143466","issue_url":"https://api.github.com/repos/nklayman/vue-cli-plugin-electron-builder/issues/51","id":414143466,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDE0MzQ2Ng==","user":{"login":"nklayman","id":12448243,"node_id":"MDQ6VXNlcjEyNDQ4MjQz","avatar_url":"https://avatars2.githubusercontent.com/u/12448243?v=4","gravatar_id":"","url":"https://api.github.com/users/nklayman","html_url":"https://github.com/nklayman","followers_url":"https://api.github.com/users/nklayman/followers","following_url":"https://api.github.com/users/nklayman/following{/other_user}","gists_url":"https://api.github.com/users/nklayman/gists{/gist_id}","starred_url":"https://api.github.com/users/nklayman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nklayman/subscriptions","organizations_url":"https://api.github.com/users/nklayman/orgs","repos_url":"https://api.github.com/users/nklayman/repos","events_url":"https://api.github.com/users/nklayman/events{/privacy}","received_events_url":"https://api.github.com/users/nklayman/received_events","type":"User","site_admin":false},"created_at":"2018-08-19T17:43:22Z","updated_at":"2018-08-19T17:43:22Z","author_association":"OWNER","body":"Hmm, I'm not sure what's wrong. I should have the auto-externalization feature ready later today, so you can just wait for that."}}
{"actor":{"display_login":"nklayman"}}