{"_id":"@alectalisman/webpack-ext-reloader","name":"@alectalisman/webpack-ext-reloader","dist-tags":{"latest":"1.1.9-a"},"versions":{"1.1.9-a":{"name":"@alectalisman/webpack-ext-reloader","version":"1.1.9-a","private":false,"description":"Watch for file changes and reload WebExtensions on browsers.","main":"dist/webpack-ext-reloader.js","bin":{"webpack-ext-reloader":"dist/webpack-ext-reloader-cli.js"},"types":"typings/webpack-ext-reloader.d.ts","repository":{"type":"git","url":"git://github.com/alecdwm-forks/webpack-ext-reloader.git"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"npm test"}},"lint-staged":{"*.{js,ts}":["npm run lint:files","npm run format:files"]},"scripts":{"build":"NODE_ENV=production webpack","test":"NODE_ENV=test webpack && mocha dist/tests.js","analyze":"NODE_ENV=production webpack --env.analyze","start:dev":"NODE_ENV=development webpack --watch","start:sample:chrome":"cross-env NODE_ENV=development cross-env TARGET_BROWSER=chrome webpack --config sample/webpack.plugin.js --watch","start:sample:firefox":"cross-env NODE_ENV=development cross-env TARGET_BROWSER=firefox webpack --config sample/webpack.plugin.js --watch","prepublishOnly":"npm run build","lint":"eslint \"{src,client,typings,specs}/**/*.ts\" --fix --format codeframe","format":"prettier --write \"{src,client,typings,specs}/**/*.ts\"","lint:files":"eslint --fix --format codeframe","format:files":"prettier --write"},"author":{"name":"Rubens Pinheiro Gonçalves Cavalcante"},"license":"MIT","bugs":{"url":"https://github.com/SimplifyJobs/webpack-ext-reloader/issues"},"homepage":"https://github.com/SimplifyJobs/webpack-ext-reloader#readme","keywords":["webpack","plugin","browser","extension","WebExtensions","hot-reload"],"dependencies":{"@types/webextension-polyfill":"^0.8.2","@types/webpack":"^5.28.0","@types/webpack-sources":"^3.2.0","clean-webpack-plugin":"^4.0.0","colors":"^1.4.0","cross-env":"^7.0.3","lodash":"^4.17.21","minimist":"^1.2.6","useragent":"^2.3.0","webextension-polyfill":"^0.8.0","webpack-sources":"^3.2.3","ws":"^8.4.2"},"peerDependencies":{"webpack":"^5.61.0"},"devDependencies":{"@babel/core":"7.17.10","@babel/eslint-parser":"7.17.0","@babel/plugin-proposal-class-properties":"7.16.7","@babel/plugin-proposal-logical-assignment-operators":"7.16.7","@babel/plugin-proposal-object-rest-spread":"7.17.3","@babel/plugin-syntax-dynamic-import":"7.8.3","@babel/plugin-transform-regenerator":"7.17.9","@babel/preset-env":"7.17.10","@types/chai":"4.3.1","@types/lodash":"4.14.182","@types/minimist":"1.2.2","@types/mocha":"9.1.1","@types/sinon":"10.0.11","@types/useragent":"2.3.1","@types/ws":"8.5.3","@typescript-eslint/eslint-plugin":"5.22.0","@typescript-eslint/parser":"5.22.0","autoprefixer":"10.4.7","babel-loader":"8.2.5","chai":"4.3.6","copy-webpack-plugin":"10.2.4","css-loader":"6.7.1","eslint":"8.14.0","eslint-config-airbnb":"19.0.4","eslint-config-prettier":"8.5.0","eslint-formatter-codeframe":"7.32.1","eslint-import-resolver-alias":"1.1.2","eslint-plugin-import":"2.26.0","eslint-plugin-jsx-a11y":"6.5.1","eslint-plugin-node":"11.1.0","eslint-plugin-prettier":"4.0.0","eslint-plugin-react":"7.29.4","eslint-plugin-react-hooks":"4.5.0","husky":"4.3.8","json-loader":"0.5.7","lint-staged":"12.4.1","mini-css-extract-plugin":"2.6.0","mocha":"9.2.2","prettier":"2.6.1","raw-loader":"4.0.2","sinon":"13.0.2","source-map-support":"0.5.21","style-loader":"3.3.1","ts-loader":"9.3.0","typescript":"4.6.4","webpack":"5.72.0","webpack-bundle-analyzer":"4.5.0","webpack-cli":"4.9.2"},"gitHead":"7b20beb798c61824a0bdd928264a3a2db4772cdc","_id":"@alectalisman/webpack-ext-reloader@1.1.9-a","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-71qW6SKUSBaH08aGKSTehTiwVARFNUk/8jqO738ETQJfaRX9ybBgSmP1rjOMXps3h02jdZpVG0Dk37bWybivIQ==","shasum":"64dff2b491ec4ee414c8ab3ac2f0e8392e506703","tarball":"https://registry.npmjs.org/@alectalisman/webpack-ext-reloader/-/webpack-ext-reloader-1.1.9-a.tgz","fileCount":32,"unpackedSize":5381294,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmEqKPSIcr6/EhwbqUyh0GTH4SPFRy0D0JND14CbeWFAIhAKQFiXJZNZLso7WYnvnsueyooTkXU6uB+R1vM2TSt3ws"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJieInVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpbjw/7BJVxyYn46wHcVgOar/vITuUmK6wOoF/3lvNUvyP2TbiNMlv+\r\nUXjhpcwZ/+B4Ivk1NErMj53qzw1bwkYLARHtR+nVvZ2rFt8rrEL36cMVGSNk\r\nF4bPCrCADI5Ze7Wg3Uwfob0zT0AA4UlQ28EjAyMlztWZfgdZYE8Qd2LRRJd+\r\n/lWJUPK8r41jv1L8wz0HqqnPWPMZzYQ16autNwR8WCCtd0w627fPa9i0Ho/i\r\nq6mRo2m/Y3QuR1y6xA6khTEHM+Wsh7L5VpeWQeZM/QoZfCs/80cnlEQovmtq\r\nIGsfe2ysOtwz41H3QsE/zv8wlvIAbrYW5/3ip504171dytHxTvmP6+6a9ad1\r\n7nriMbd1FY+gxv5U5EktyiFXJnGIbQJLNjME9HDMFOgWJItYCUmBEdcSpSCi\r\nWC3USTxGwlXXISy5EJr8tGlnSj8RaivdaJlqKNUdl5ivrhSSq2DmRgOmh/BK\r\nEd/ZvjmZVTudOT1aF21nc+E+TXvuBfOO+Haje2XkR/MvbfiEXrN2XHzPSGjz\r\nN7EBlqjHheHYRvK7deaZQfVuy3lyQkla2DLUshHL3JDtoa4vX2MVhGY1d1WE\r\nsxfSxxCJTh+/JWwAg8pE+SKMPFZwM3t8UUs+7n0FzIOqd1gL+qhQvWPCzZ27\r\nB78qsW0SqvboNgY1wyLLP0U9bOBPI/80ANY=\r\n=yR4y\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"alectalisman","email":"alec@talisman.xyz"},"directories":{},"maintainers":[{"name":"alectalisman","email":"alec@talisman.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webpack-ext-reloader_1.1.9-a_1652066773245_0.0003754565913458574"},"_hasShrinkwrap":false}},"time":{"created":"2022-05-09T03:26:13.163Z","1.1.9-a":"2022-05-09T03:26:13.505Z","modified":"2022-05-09T03:26:13.630Z"},"maintainers":[{"name":"alectalisman","email":"alec@talisman.xyz"}],"description":"Watch for file changes and reload WebExtensions on browsers.","homepage":"https://github.com/SimplifyJobs/webpack-ext-reloader#readme","keywords":["webpack","plugin","browser","extension","WebExtensions","hot-reload"],"repository":{"type":"git","url":"git://github.com/alecdwm-forks/webpack-ext-reloader.git"},"author":{"name":"Rubens Pinheiro Gonçalves Cavalcante"},"bugs":{"url":"https://github.com/SimplifyJobs/webpack-ext-reloader/issues"},"license":"MIT","readme":"# Webpack Extension Reloader\n\nA Webpack plugin to automatically reload browser extensions during development.\n\n<div align=\"center\">\n  <a href=\"https://github.com/webpack/webpack\">\n    <img width=\"200\" height=\"200\" src=\"https://webpack.js.org/assets/icon-square-big.svg\">\n  </a>\n  <br>\n  <br>\n</div>\n  \n[![npm version](https://img.shields.io/npm/v/webpack-ext-reloader)](https://www.npmjs.com/package/webpack-ext-reloader)\n[![Test Status](https://github.com/SimplifyJobs/webpack-ext-reloader/workflows/tests/badge.svg)](https://github.com/SimplifyJobs/webpack-ext-reloader/actions?query=branch%3Amaster)\n[![Known Vulnerabilities](https://snyk.io/test/github/SimplifyJobs/webpack-ext-reloader/badge.svg)](https://snyk.io/test/github/SimplifyJobs/webpack-ext-reloader/)\n[![NPM Downloads](https://img.shields.io/npm/dt/webpack-ext-reloader.svg)](https://www.npmjs.com/package/webpack-ext-reloader)\n\n## Installing\n\nnpm\n\n```bash\nnpm install webpack-ext-reloader --save-dev\n```\n\nyarn\n\n```bash\nyarn add webpack-ext-reloader --dev\n```\n\n## What is this?\n\nThis is a webpack plugin that allows you to bring hot reloading functionality to WebExtensions, essentially `webpack-dev-server`, but for (WebExtensions)[https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions].\n\nThis is a fork from [`webpack-extension-reloader`](https://github.com/rubenspgcavalcante/webpack-extension-reloader), maintained and updated by the team here at Simplify. The goal here is to continue to support the latest version of webpack (`webpack-extension-reloader` only supports webpack v4) while adding new improvements (i.e. HMR).\n\n![](.github/sample-gif.gif)\n\n**Note**: This plugin doesn't support [**Hot Module Replacement (HMR)**](https://webpack.js.org/concepts/hot-module-replacement/) yet.\n\n## How to use\n\n### Using as a plugin\n\nAdd `webpack-ext-reloader` to the plugins section of your webpack configuration file. Note that this plugin don't outputs the manifest (at most read it to gather information).\nFor outputing not only the `manifest.json` but other static files too, use `CopyWebpackPlugin`.\n\n```js\nconst ExtReloader = require('webpack-ext-reloader');\n\nplugins: [\n  new ExtReloader(),\n  new CopyWebpackPlugin([\n      { from: \"./src/manifest.json\" },\n      { from: \"./src/popup.html\" },\n    ]),\n]\n```\n\nYou can point to your `manifest.json file`...\n\n```js\nplugins: [\n  new ExtReloader({\n    manifest: path.resolve(__dirname, \"manifest.json\")\n  }),\n  // ...\n]\n```\n\n... or you can also use some extra options (the following are the default ones):\n\n```js\n// webpack.dev.js\nmodule.exports = {\n  mode: \"development\", // The plugin is activated only if mode is set to development\n  watch: true,\n  entry: {\n    'content-script': './my-content-script.js',\n    background: './my-background-script.js',\n    popup: 'popup',\n  },\n  //...\n  plugins: [\n    new ExtReloader({\n      port: 9090, // Which port use to create the server\n      reloadPage: true, // Force the reload of the page also\n      entries: { // The entries used for the content/background scripts or extension pages\n        contentScript: 'content-script',\n        background: 'background',\n        extensionPage: 'popup',\n      }\n    }),\n    // ...\n  ]\n}\n```\n\n**Note I**: `entry` or `manifest` are needed. If both are given, entry will override the information comming from `manifest.json`. If none are given the default `entry` values (see above) are used.\n\nAnd then just run your application with Webpack in watch mode:\n\n```bash\nNODE_ENV=development webpack --config myconfig.js --mode=development --watch \n```\n\n**Note II**: You need to set `--mode=development` to activate the plugin (only if you didn't set on the webpack.config.js already) then you need to run with `--watch`, as the plugin will be able to sign the extension only if webpack triggers the rebuild (again, only if you didn't set on webpack.config).\n\n### Multiple Content Script and Extension Page support\n\nIf you use more than one content script or extension page in your extension, like:\n\n```js\nentry: {\n  'my-first-content-script': './my-first-content-script.js',\n  'my-second-content-script': './my-second-content-script.js',\n  // and so on ...\n  background: './my-background-script.js',\n  'popup': './popup.js',\n  'options': './options.js',\n  // and so on ...\n}\n```\n\nYou can use the `entries.contentScript` or `entries.extensionPage` options as an array:\n\n```js\nplugins: [\n  new ExtReloader({\n    entries: { \n      contentScript: ['my-first-content-script', 'my-second-content-script', /* and so on ... */],\n      background: 'background',\n      extensionPage: ['popup', 'options', /* and so on ... */],\n    }\n  }),\n  // ...\n]\n```\n\n### CLI\n\nIf you don't want all the plugin setup, you can just use the client that comes with the package.  \nYou can use by installing the package globally, or directly using `npx`:\n\n```bash\nnpx webpack-ext-reloader\n```\n\nIf you run directly, it will use the  default configurations, but if you want to customize\nyou can call it with the following options:\n\n```bash\nnpx webpack-ext-reloader --config wb.config.js --port 9080 --no-page-reload --content-script my-content.js --background bg.js --extension-page popup.js\n```\n\nIf you have **multiple** content scripts or extension pages, just use comma (with no spaces) while passing the option\n\n```bash\nnpx webpack-ext-reloader --content-script my-first-content.js,my-second-content.js,my-third-content.js --extension-page popup.js,options.js\n```\n\n### Client options\n\n| name             | default           | description                                                       |\n| ---------------- | ----------------- | ----------------------------------------------------------------- |\n| --help           |                   | Shows this help                                                   |\n| --config         | webpack.config.js | The webpack configuration file path                               |\n| --port           | 9090              | The port to run the server                                        |\n| --manifest       |                   | The path to the extension **manifest.json** file                  |\n| --content-script | content-script    | The **entry/entries** name(s) for the content script(s)           |\n| --background     | background        | The **entry** name for the background script                      |\n| --extension-page | popup             | The **entry/entries** name(s) for the extension pages(s)          |\n| --no-page-reload |                   | Disable the auto reloading of all **pages** which runs the plugin |\n\nEvery time content or background scripts are modified, the extension is reloaded :)  \n**Note:** the plugin only works on **development** mode, so don't forget to set the NODE_ENV before run the command above\n\n### Contributing\n\nPlease before opening any **issue** or **pull request** check the [contribution guide](/.github/CONTRIBUTING.MD).\n\n### License\n\nThis project has been forked from [rubenspgcavalcante/webpack-extension-reloader](https://github.com/rubenspgcavalcante/webpack-extension-reloader), which is licensed under the [MIT license](https://github.com/rubenspgcavalcante/webpack-extension-reloader/blob/master/LICENSE). All changes made in this fork have been licensed via the [MIT license](https://github.com/SimplifyJobs/webpack-ext-reloader/blob/master/LICENSE).\n","readmeFilename":"README.md"}