|
6 | 6 | * [Clone and install dependencies](#clone-and-install-dependencies)
|
7 | 7 | * [Build and run in Firefox](#build-and-run-in-firefox)
|
8 | 8 | * [Build and manually install in Chromium](#build-and-manually-install-in-chromium)
|
| 9 | + * [Run build on file changes](#run-build-on-file-changes) |
9 | 10 | * [Useful tasks](#useful-tasks)
|
10 | 11 | * [Other tips](#other-tips)
|
11 | 12 | * [Using IPFS Companion on Firefox for Android](#using-ipfs-companion-on-firefox-for-android)
|
@@ -73,13 +74,24 @@ Then open `chrome://extensions` in your Chromium-based browser, enable "Develope
|
73 | 74 | |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
74 | 75 | |  |  |
|
75 | 76 |
|
| 77 | +### Run build on file changes |
| 78 | + |
| 79 | +Regular build minifies code and strips source maps. It is possible to run build in the `watch` mode, which will rebuild a debug version of all changed bundles: |
| 80 | + |
| 81 | +```bash |
| 82 | +npm run build # do regular build first |
| 83 | +npm run watch # watch for new changes |
| 84 | +``` |
| 85 | + |
| 86 | +**Note:** `watch` is a blocking command, so one needs to run it in a different terminal than `firefox` or `chromium`. Press ctrl+c to stop it. |
76 | 87 |
|
77 | 88 | ## Useful tasks
|
78 | 89 |
|
79 | 90 | Each `npm` task can run separately, but most of the time, `dev-build`, `test`, and `fix:lint` are all you need.
|
80 | 91 |
|
81 | 92 | - `npm install`: Install all NPM dependencies
|
82 | 93 | - `npm run build`: Build the add-on (copy external libraries, create `.zip` bundles for Chrome and Firefox)
|
| 94 | +- `npm run watch`: Rebuild JS/CSS on file changes (run regular `build` first to ensure everything else is in place) |
83 | 95 | - `npm run bundle:chromium`: Overwrite manifest and package a generic, Chromium-compatible version
|
84 | 96 | - `npm run bundle:brave`: Overwrite manifest and package a Brave-compatible version requesting access to `chrome.sockets`
|
85 | 97 | - `npm run bundle:firefox`: Overwrite manifest and package a Firefox-compatible version
|
|
0 commit comments