{"_id":"@bn3t/forge-externals-plugin","_rev":"1-0c17504e4e5e480d77bb39e75fbb997a","name":"@bn3t/forge-externals-plugin","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@bn3t/forge-externals-plugin","version":"1.0.0","description":"An electron-forge plugin to copy native dependencies into the packaged app","main":"index.js","scripts":{"test":"cd test-app && npm i && npm run start && npm run package"},"repository":{"type":"git","url":"git+https://github.com/bn3t/forge-externals-plugin.git"},"author":{"name":"Bernard Niset"},"license":"MIT","bugs":{"url":"https://github.com/bn3t/forge-externals-plugin/issues"},"homepage":"https://github.com/bn3t/forge-externals-plugin#readme","dependencies":{"flora-colossus":"1.0.1"},"gitHead":"3c066bf4ce7998aa77b4e5bdb7490ebb1d0f68e9","_id":"@bn3t/forge-externals-plugin@1.0.0","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"integrity":"sha512-4D4OqN/OIOA0BsW4wNNvAVYREKIf+WzKDEtectJmJ1LvyeROfGPYSfFaf0eXq2NT2t+96y3Ol9D7GKtJ13y+7A==","shasum":"f302231c52539a95e48cad5f07c745837f9da379","tarball":"https://registry.npmjs.org/@bn3t/forge-externals-plugin/-/forge-externals-plugin-1.0.0.tgz","fileCount":4,"unpackedSize":5499,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQHOxCRA9TVsSAnZWagAAQx4QAI97hVsoGB16bZACCM4q\ntAsa8BlJtT2O3BERcu9pkwjQIFtmauSwHLEc/5/N2mtzd9iYjVLr9+ZHOeBP\ny4zRN9GfdltHrbJl+oFbZe2X0SshgaPgC+xFWml5HaBabRc3N4XEf8r6cQ+C\nNtB02SpkW89oGZhyszqLZi5PvE7F7rZm8xczb2fWjH3sOl44mL2LNmkiXgbU\n2CorZPntKMenWVYPBGrPSm8lGqNz1GRDUZNZ0YQtfseMXpyPLnXJaKVokjPN\new9KCk8H7MGJKp1AThbM7s+Ln9HpB8QISS2QtRCvZk8biaK4pitqKMgzIUWT\ntBGGgGfkicjGfDfXH6QdcQVUfNea2Zng1BxFPEBp7i2NszgviEbUeAMPqf5g\njnGMt7eONVbrZOFhrNX9Stk0VOW/IP+qQqCmk5mq/2FAsCdNHgwpQYlk/L1a\n51Z/K04vTlYH/hJzQisFbBlW77lPEhKyY4dtiSj/15c06eYptOeEuF4A9pCz\nAghPhKPUlePYP3EYTKnQZeZxdvA61IZ/YxNMJD7QMVSy7euDrYn43xUWEb1Y\nwAAxiuM3HiQUiD0LVpUHHjpQ/W164NXdxEzUiFoInedaXpOJ+D6iBi2VPl4s\nLF5Du3lilEnviBguv1ejIJq4aoBIwyEQjpQt6lFqo8rBbezBn09uEDAxd0ck\nA6qr\r\n=Rtnr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDP7K/qbP2ZD1LWunDaW6sQ6s/upF+dUkXgwHrvW46IoAiB+RjiEXIa1EoPGWlarm4+P1fMSLRYFB0TEl26JyEjpaw=="}]},"_npmUser":{"name":"bn3t","email":"bernard.niset@gmail.com"},"directories":{},"maintainers":[{"name":"bn3t","email":"bernard.niset@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/forge-externals-plugin_1.0.0_1631613873047_0.44179178634376237"},"_hasShrinkwrap":false}},"time":{"created":"2021-09-14T10:04:33.008Z","1.0.0":"2021-09-14T10:04:33.179Z","modified":"2022-04-04T19:53:25.192Z"},"maintainers":[{"name":"bn3t","email":"bernard.niset@gmail.com"}],"description":"An electron-forge plugin to copy native dependencies into the packaged app","homepage":"https://github.com/bn3t/forge-externals-plugin#readme","repository":{"type":"git","url":"git+https://github.com/bn3t/forge-externals-plugin.git"},"author":{"name":"Bernard Niset"},"bugs":{"url":"https://github.com/bn3t/forge-externals-plugin/issues"},"license":"MIT","readme":"# @bn3t/forge-externals-plugin\r\n\r\nWhen using Electron with Webpack, the easiest way to support native\r\nmodules is to add them to Webpack `externals` configuration. This tells webpack\r\nto load them from `node_modules` via `require()`:\r\n\r\n```js\r\nmodule.exports = {\r\n  module: {\r\n    rules,\r\n  },\r\n  plugins: plugins,\r\n  resolve: {\r\n    extensions: [\".js\", \".ts\", \".jsx\", \".tsx\", \".css\"],\r\n  },\r\n  externals: {\r\n    // Always load `native-hello-world` via require\r\n    \"native-hello-world\": \"commonjs2 native-hello-world\",\r\n  },\r\n};\r\n```\r\n\r\nThis works in development but with Electron Forge + Webpack,\r\n`node_modules` gets excluded during packaging so the modules are missing in the\r\npackaged app.\r\n\r\nThis plugin should be added after `@electron-forge/plugin-webpack` and it\r\nensures that your external modules and their dependencies are included in the\r\npackaged app.\r\n\r\n```json\r\n \"config\": {\r\n    \"forge\": {\r\n      \"packagerConfig\": {},\r\n      \"makers\": [],\r\n      \"plugins\": [\r\n        [\r\n          \"@electron-forge/plugin-webpack\",\r\n          {\r\n            \"mainConfig\": \"./webpack.main.config.js\",\r\n            \"renderer\": {\r\n              \"config\": \"./webpack.renderer.config.js\",\r\n              \"entryPoints\": [\r\n                {\r\n                  \"html\": \"./src/index.html\",\r\n                  \"js\": \"./src/renderer.ts\",\r\n                  \"name\": \"main_window\"\r\n                }\r\n              ]\r\n            }\r\n          }\r\n        ],\r\n        [\r\n          \"@bn3t/forge-externals-plugin\",\r\n          {\r\n            \"externals\": [\"native-hello-world\"],\r\n            \"includeDeps\": true\r\n          }\r\n        ]\r\n      ]\r\n    }\r\n  },\r\n```\r\n","readmeFilename":"README.md"}