Skip to content

Commit a462439

Browse files
authored
docs: npm run watch (#892)
1 parent 1a395e1 commit a462439

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

DEVELOPER-NOTES.md

+12
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* [Clone and install dependencies](#clone-and-install-dependencies)
77
* [Build and run in Firefox](#build-and-run-in-firefox)
88
* [Build and manually install in Chromium](#build-and-manually-install-in-chromium)
9+
* [Run build on file changes](#run-build-on-file-changes)
910
* [Useful tasks](#useful-tasks)
1011
* [Other tips](#other-tips)
1112
* [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
7374
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
7475
| ![installing ipfs-companion as an unpacked extension in chrome](https://bafybeih34e3a5sgkh57lwv26c6253fxn2jdvte6ilhyld6l4ghuhybzldi.ipfs.dweb.link/ipfs-companion-install-chrome-dev.gif) | ![installing ipfs-companion as a temporary add on in firefox](https://bafybeih34e3a5sgkh57lwv26c6253fxn2jdvte6ilhyld6l4ghuhybzldi.ipfs.dweb.link/ipfs-companion-install-firefox-dev.gif) |
7576

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.
7687

7788
## Useful tasks
7889

7990
Each `npm` task can run separately, but most of the time, `dev-build`, `test`, and `fix:lint` are all you need.
8091

8192
- `npm install`: Install all NPM dependencies
8293
- `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)
8395
- `npm run bundle:chromium`: Overwrite manifest and package a generic, Chromium-compatible version
8496
- `npm run bundle:brave`: Overwrite manifest and package a Brave-compatible version requesting access to `chrome.sockets`
8597
- `npm run bundle:firefox`: Overwrite manifest and package a Firefox-compatible version

0 commit comments

Comments
 (0)