Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
broccoli-sprite
Advanced tools
In your project directory, run this command:
npm install --save broccoli-sprite
You will need to install at least one of the following,
before installing broccoli-sprite
.
sudo apt-get install graphicsmagick
sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++
npm install -g canvas
In Brocfile.js
, add the following:
var broccoliSprite = require('broccoli-sprite');
var spritesTree = broccoliSprite('public', {
src: [
'images/sprites/*.png'
],
spritePath: 'assets/sprites.png',
stylesheetPath: 'assets/sprites.css',
stylesheet: 'css',
stylesheetOptions: {
prefix: 'sprite-',
},
});
… and be sure to merge spritesTree
into the main tree.
ember-cli
appsTo use broccoli-sprite
in an ember-cli
app:
var app = new EmberApp(/* ... */);
/* other ember-cli init for app */
var broccoliSprite = require('broccoli-sprite');
var spritesTree = broccoliSprite(/* ... */);
var appTree = app.toTree();
var broccoliMergeTrees = require('broccoli-merge-trees');
module.exports = broccoliMergeTrees([spritesTree, appTree]);
Ideally, however, the plugin should be integrated into
node_modules/ember-cli/lib/preprocessors.js
.
However, currently, this is not possible,
until this preprocessors.js
exposes its registry of BroccoliJs plugins.
broccoli-sprite
wraps around the excellent
node-sprite-generator
library.
When you call broccoliSprite
, it accepts two arguments: tree
and options
.
tree
This is any broccoli tree.
In an ember-cli
app, this would most likely be "public"
.
options
These options are passed into node-sprite-generator
,
so follow the options specified here.
File paths, however, are not passed in verabtim, and are processed to enable them to work with BroccoliJs' trees.
src
is is an array of file paths specified relative to the input tree.
Notice that in the example above,
the tree is 'public'
, and "public" is not repeated in the paths within src
.
The same is also true for output paths though,
spritePath
and stylesheetPath
,
which must be specified relative to the tree.
Notice that "public" is not repeated within these paths.
FAQs
Broccoli plugin for CSS image sprite generation
The npm package broccoli-sprite receives a total of 20 weekly downloads. As such, broccoli-sprite popularity was classified as not popular.
We found that broccoli-sprite demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.