11## Building
22
3- - With dart2js:
3+ > Note: First make the script executable: ` chmod +x tool/build_extension.sh `
4+
5+ ### With DDC (for development):
46
57```
6- dart run build_runner build web -o build -r
8+ ./tool/build_extension.sh
79```
810
9- This will build to the ` /web ` directory.
11+ - The DDC-compiled extension will be located in the ` /dev_build /web` directory.
1012
11- - With DDC :
13+ ### With dart2js (for release) :
1214
1315```
14- dart run build_runner build web -o build
16+ ./tool/build_extension.sh prod
1517```
1618
17- This will build to the ` /build/web ` directory.
19+ - The dart2js-compiled extension will be located in the ` /prod_build ` directory.
1820
1921## Local Development
2022
21- ### Update ` manifest.json ` :
22-
23- - Change the ` default_icon ` in ` manifest.json ` to ` dart_dev.png ` (Note: this is
24- not strictly necessary, but will help you to distinguish your local version of
25- the extension from the published version)
26- - \[ For Googlers\] The developer key is needed for local development and
27- testing. Add one of the whitelisted keys to ` web/manifest.json ` . IMPORTANT: DO
28- NOT COMMIT THE KEY.
23+ ### \[ For Googlers\] Create an ` extension_key.txt ` file:
2924
30- ```
31- {
32- "name": "Dart Debug Extension",
33- "key": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
34- ...
35- }
36- ```
25+ - Create a ` extension_key.txt ` file at the root of ` /debug_extension ` . Paste in
26+ the value of one of the whitelisted developer keys into this txt file.
27+ IMPORTANT: DO NOT COMMIT THE KEY. It will be copied into the ` manifest.json `
28+ when you build the extension.
3729
3830### Build and upload your local extension
3931
4032- Build the extension following the instructions above
4133- Visit chrome://extensions
4234- Toggle "Developer mode" on
4335- Click the "Load unpacked" button
44- - Select the extension directory: ` /dwds/debug_extension /web`
36+ - Select the extension directory: ` dev_build /web`
4537
4638### Debug your local extension
4739
@@ -58,14 +50,18 @@ This will build to the `/build/web` directory.
5850
59511 . Update the version in ` web/manifest.json ` , ` pubspec.yaml ` , and in the
6052 ` CHANGELOG ` .
61- 1 . Build dart2js: ` pub run build_runner build web -o build -r `
53+ 1 . Follow the instructions above to build the dart2js-compiled release version
54+ of the extension.
6255
63- > * At this point, you should manually verify that everything is working by
64- > following the steps in [ Local Development] ( #local-development ) .*
56+ > \* At this point, you should manually verify that everything is working by
57+ > following the steps in [ Local Development] ( #local-development ) , except load
58+ > the extension from the ` prod_build ` directory. You will need to add an
59+ > extension key to the ` manifest.json ` file in ` prod_build ` to test locally.
6560
66- 3 . Open a PR to submit the version and build changes .
61+ 3 . Open a PR to submit the version change .
67621 . Once submitted, pull the changes down to your local branch, and create a zip
68- of the ` debug_extension/web ` directory (NOT ` debug_extension/build/web ` ).
63+ of the ` prod_build ` directory (NOT ` dev_build/web ` ). ** Remove the Googler
64+ extension key that was added by the builder to the ` manifest.json ` file.**
69651 . Rename the zip ` version_XX.XX.XX.zip ` (eg, ` version_1.24.0.zip ` ) and add it
7066 to the go/dart-debug-extension-zips folder
7167
0 commit comments