Fully featured cross platform browser extension template using Webpack/Babel/React
Please file any issues or feature requests at https://github.com/samueljun/browser-extension-template/issues.
-
Clone this repo and rename for your extension.
-
Install the required node modules:
npm install
- Run the following command so that webpack can watch and recompile the
/src
files live to the/dist
folder:
npm run watch
To run the extension with live reloading in a clean Firefox instance, run the following command in a separate terminal:
npm run watch-firefox
To temporarily load the extension in a normal Firefox instance:
- Go to
about:debugging
- Click
Load Temporary Add-on
- Load the
src
folder
- Go to
chrome://extensions/
- Enable developer mode
- Click
Load unpacked extension...
- Load the
/dist
folder
Run the following command with the appropriate npm version {patch/minor/major}
to bump the package.json version based on semver:
npm version patch && git push && git push --tags
Run the following command so that webpack can recompile the /src
files in production mode to the /dist
and /dist-zip
folder:
npm run build