1. Install npm -- https://nodejs.org/en/download/
(Note: on windows, you also need to add "%appdata%\npm" to your PATH)
From the root of this project, run:
$ npm install
The default command to build and test:
$ npm run build
or
$ npm run build -- --<arg>
- Compiles LESS and TypeScript into /build
- Bundles the JavaScript modules together into /build/bundles
- Exports all the needed files to /target
- In chrome, open chrome://extensions/
- Enable developer mode (upper right toggle)
- Click on "load unpacked" and select the target/chrome folder
- On subsequent builds, you don't have to go through this flow again. Simply refreshing the page should update the add-in
- In edge, go to edge://extensions
- Enable developer mode (bottom left toggle)
- Restart edge
- Click on top right "...", then Extensions
- Click on "Load unpacked" and select the target\edge\OneNoteWebClipper\edgeextension\manifest\extension
- On subsequent builds, you need to go through steps (4) and (5) again
Set the "enable_console_logging" local storage entry to true
Every store is different and you'll have to look at our internal guide to understand how to ship an update. In general, shipping in chrome/edge is easy and shipping in FF/Safari is hard. We don't ship any updates to IE anymore.
- Build locally
npm run build:prod
- Run
npm run pack-edge
. The results will be in /OneNoteWebClipper/EdgeExtension - The file you will upload is the
target/edge/OneNoteWebClipper/edgeextension/package/edgeExtension.appx
file. You can also test by uploading thetarget/edge/onenotewebclipper/edgeextension/manifest/extension
folder locally in edge - Now follow our internal instructions to update the package.
At this point you should see the tests passing, and see the packaged code in the target
folder
$ npm run clean
Removes all of the generated files from build