My solution
I have created a .crxignore
custom ignore file, like this:
.*
Makefile
*.md
bin
It is made for zip command! It is different than .gitignore
. You can't add comments eg! See documentation: https://linux.die.net/man/1/zip , look for --exclude
word.
Now you can create a zip without ignred files:
$ zip -qr -9 -X .out/out.zip . -x@.crxignore
# ^^^^^^^^^^^^^ using ignore file
After that I can convert zip
to crx
file with this go script: https://github.com/mmadfox/go-crx3 You have to build it with go build -o out/crx3 crx3/main.go
command (you may get missing mod errors, but there will be the commands what you have to run). --> you can move your out/crx3
to where you want. Eg: [project]/bin/crx3
.
I haven't tried, maybe chrome
command also can convert zip
to crx
.
You have to generate a private key:
$ bin/crx3 keygen .out/key.pem
Final Makefile
build:
rm -f .out/out.zip
zip -qr -9 -X .out/out.zip . -x@.crxignore
bin/crx3 pack .out/out.zip -p .out/key.pem -o .out/out.crx
Build process:
$ make build
# --> build the .out/out.crx file