grunt-webapp
Generate webapp manifests with grunt. It takes as much information as possible from your package.json file.
Getting Started
This plugin requires Grunt ~0.4.5
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-webapp --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-webapp');
The "webapp" task
Overview
In your project's Gruntfile, add a section named webapp
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
webapp: {
options: {
localeDir: 'locale',
target: 'web'
},
your_target: {
'manifest.webapp': 'dist/manifest.webapp'
},
},
});
Options
options.localeDir
Type: String
Default value: ''
The directory containing localizations for the webapp manifest with a subdirectory
per language, each containing a "manifest.json" with the two properties name
and description
. If not specified, the locale property of the webapp manifest
will remain untouched.
options.target
Type: String
Default value: 'web'
This should either be set to 'web'
or 'packaged'
. If set to 'packaged'
,
the appcache_path
property is removed if it exists.
options.icons
Type: String
Default value: 'images/icon-*.png'
Icon files pattern to use in the icons property
options.iconsTarget
Type: String
Default value: ''
Icon URL pattern to use in the manifest, if you move your icon files around. You can use a {size} placeholder, which will be replaced with the icon's size.
Contributing
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.