Package a google chrome extension.
This plugin requires Grunt ~0.4.1
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-chrome-compile --save-dev
One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-chrome-compile');
In your project's Gruntfile, add a section named chrome-extension
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
'chrome-extension': {
options: {
name: "demo-ext",
version: "0.0.1",
id: "00000000000000000000000000000000",
updateUrl: "http://example.com/extension/111111/",
chrome: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
clean: true,
certDir: 'cert',
buildDir: 'build',
resources: [
"js/**",
"images/**",
"*.html"
]
}
},
})
Type: String
Default value: demo-ext
The name of your google chrome extension
Type: String
Default value: 0.0.1
Your extension's version number.
Type: String
Default value: 00000000000000000000000000000000
The ID assigned by the Chrome Web Store
Type: String
Default value: ``
Optional url where your extension can be updated from outside of the Chrome Web Store
Type: String
Default value: build
Relative location to your build directory. .zip, .crx, and updates.xml will be created here.
Type: String
Default value: cert
Relative location to your extension's certificate.
Type: array
Project resources that should be packaged into the final .zip and .crx.
Caution: Make sure your cert files are not included here
Type: String
Default value: OSX Path
The path to your Google Chrome installation.
- OSX: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
- OSX Canary: /Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary
- Windows: C:\Users\user\AppData\Local\Google\Chrome\Application\chrome.exe
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
0.2.1 Initial release!