If nsg is used twice, back to back, in the same process, the 2nd run will inherit some of the modifications of the 1st run. See stylesheetOptions
in the two snippets below. These are console.log
s from right inside generateSprite and then right after the defaults are applied.
PASSED IN
{ src:
[ 'assets/images/sprite/index/*.png',
'assets/images/sprite/common/*.png' ],
spritePath: 'assets/images/index.png',
stylesheetPath: 'assets/stylesheets/sprite/index.styl' }
OPTIONS AFTER MANIPULATION
{ src:
[ 'assets/images/sprite/index/*.png',
'assets/images/sprite/common/*.png' ],
spritePath: 'assets/images/index.png',
stylesheetPath: 'assets/stylesheets/sprite/index.styl',
layout: 'vertical',
stylesheet: 'stylus',
compositor: 'gm',
layoutOptions: {},
compositorOptions: {},
stylesheetOptions: {} }
OPTIONS BEFORE
{ src:
[ 'assets/images/sprite/index2/*.png',
'assets/images/sprite/common/*.png' ],
spritePath: 'assets/images/index2.png',
stylesheetPath: 'assets/stylesheets/sprite/index2.styl' }
OPTIONS AFTER
{ src:
[ 'assets/images/sprite/index2/*.png',
'assets/images/sprite/common/*.png' ],
spritePath: 'assets/images/index2.png',
stylesheetPath: 'assets/stylesheets/sprite/index2.styl',
layout: 'vertical',
stylesheet: 'stylus',
compositor: 'gm',
layoutOptions: { padding: 0 },
compositorOptions: {},
stylesheetOptions:
{ spritePath: '../../images/index.png',
prefix: '',
nameMapping: [Function],
pixelRatio: 1 } }