sca

spritesmith-cli-aj

spritesmith-cli

Showing:

Readme

spritesmith cli

install

npm install spritesmith-cli-aj

use

const spritesmith = require('spritesmith-cli-aj')

// return promise object

spritesmith([{
  glob: '**/icon-*.{png,gif,jpg}',
  imageDist: path.resolve(process.cwd(), './dist/sprite-icon.png'),
  styleDist: path.resolve(process.cwd(), './dist/sprite-icon.styl'),
  prefix: 'icon-',
  multiple: 1,
  // spritesmith package option
  options: {
    ...
  }
}, {
  glob: '**/icon-*.{png,gif,jpg}',
  imageDist: path.resolve(process.cwd(), './dist/sprite-icon1.png'),
  styleDist: path.resolve(process.cwd(), './dist/sprite-icon1.styl'),
  prefix: 'icon-',
  multiple: 1,
  // spritesmith package option
  options: {
    ...
  }
}])

//or
spritesmith({
  glob: '**/icon-*.{png,gif,jpg}',
  imageDist: path.resolve(process.cwd(), './dist/sprite-icon.png'),
  styleDist: path.resolve(process.cwd(), './dist/sprite-icon.styl'),
  prefix: 'icon-',
  multiple: 1,
  // spritesmith package option
  options: {
    ...
  }
})

cli

spritesmith --config <config path> // config default './.spritesmith.js'

//config file
module.exports = [{
  glob: '**/icon-*.{png,gif,jpg}',
  imageDist: path.resolve(process.cwd(), './dist/sprite-icon.png'),
  styleDist: path.resolve(process.cwd(), './dist/sprite-icon.styl'),
  prefix: 'icon-',
  multiple: 1,
  // spritesmith package option
  options: {
    ...
  }
}, {
  glob: '**/icon-*.{png,gif,jpg}',
  imageDist: path.resolve(process.cwd(), './dist/sprite-icon1.png'),
  styleDist: path.resolve(process.cwd(), './dist/sprite-icon1.styl'),
  prefix: 'icon-',
  multiple: 1,
  // spritesmith package option
  options: {
    ...
  }
}]

//or

module.exports = {
  glob: '**/icon-*.{png,gif,jpg}',
  imageDist: path.resolve(process.cwd(), './dist/sprite-icon1.png'),
  styleDist: path.resolve(process.cwd(), './dist/sprite-icon1.styl'),
  prefix: 'icon-',
  multiple: 1,
  // spritesmith package option
  options: {
    ...
  }
}