generate-cordova-assets
Automatically generate assets for a Cordova based project.
Last updated 3 years ago by remcohaszing .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install generate-cordova-assets 
SYNC missed versions from official npm registry.

generate-cordova-assets

NPM version build status Downloads

Automatically generate assets for a Cordova based project.

This provides a Cordova hook which can automatically generate icons and splash screens from a single source.

Installation

npm install generate-cordova-assets --save-dev

Usage

Cordova Hook

This project comes with a Cordova hook that generates pixel perfect icons and splash screens from one icon.

This is best put in the after_prepare hook. This means that the hook will overwrite images after Cordova has copied its default images.

For more info, see the Cordova documentation about icons and splash screens.

Preference configuration options

Name Description
IconSource The source icon to read.
IconBackgroundColor The color to use to fill the color for images that may not be transparent.

Example

Add the following configurations to the config.xml file in your Cordova project:

<preference name="IconSource" value="www/icon.svg"/>
<preference name="IconBackgroundColor" value="#eeeeee"/>

<hook type="after_prepare" src="node_modules/generate-cordova-assets/hook.js"/>

CLI Tool

The CLI tool may be used to convert an icon to an output icon of a given width, height and background color. This may be useful to create assets for uploading to Google Play or the App Store.

For options, run:

./node_modules/.bin/process-icon --help

NodeJS

The NodeJS API may be used. However, it is not the main API and it is not guaranteed to stay the same in the forseeable future.

FAQ

Why not any of the other hooks on npm?

The other hooks I found don't support SVG or splash screens or require extra configurations.

Why are legacy launch images used for iOS?

There are two methods of defining splash images docs.

  1. Legacy launch images.
  2. Launch storyboard images.

Cordova defaults to the legacy launch images, when nothing is specified in config.xml.

Current Tags

  • 2.0.7                                ...           latest (3 years ago)

13 Versions

  • 2.0.7                                ...           3 years ago
  • 2.0.6                                ...           3 years ago
  • 2.0.5                                ...           3 years ago
  • 2.0.4                                ...           3 years ago
  • 2.0.3                                ...           3 years ago
  • 2.0.2                                ...           3 years ago
  • 2.0.1                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 1.2.1                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.1                                ...           3 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (9)
Dev Dependencies (10)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |