$ git clone https://github.com/redox/chrome-extension-skeleton.git
# in case you don't have Grunt yet
$ sudo npm install -g grunt-cli
# install dependencies
$ npm install
# generate your private key (required for Chrome)
$ openssl genrsa 2048 | openssl pkcs8 -topk8 -nocrypt > mykey.pem
# build it
$ grunt
When developing, write unit-tests, use the dev
Grunt task to check that your JS code passes linting tests and unit-tests.
When ready to try out the extension in the browser, use default Grunt task to build it. In build
directory you'll find develop version of the extension in unpacked-dev
subdirectory (with source maps), and production (uglified) version in unpacked-prod
directory.
- Open
chrome://extensions
- Enable the developer mode
- Click the "Load unpacked extension..." button
- Locate the
build/unpacked-dev
folder - Every time you update the code, wait for the Grunt watch+build to end and click "Reload"
clean
: cleanbuild
directorytest
: JS-lint and mocha test, single rundev
: continuoustest
loop- default:
clean
,test
, build step (copy all necessary files tobuild
directory, browserify JS sources, prepare production version (using uglify) and pack thecrx