postcss-node-sass
postcss-node-sass copied to clipboard
the 'data' is overwritten
I want to inject some variables into all scss file, but i found the 'data' is overwritten
opt = Object.assign({
indentWidth: 4,
omitSourceMapUrl: true,
outputStyle: 'expanded',
sourceMap: true,
sourceMapContents: true
}, opt, {
data: css.css,
file: result.opts.from,
outFile: result.opts.to
})
Instead of overwritten, try concat
opt = Object.assign({
indentWidth: 4,
omitSourceMapUrl: true,
outputStyle: 'expanded',
sourceMap: true,
sourceMapContents: true
}, opt, {
data: [opt.data, css.css].join('\n'),
file: result.opts.from,
outFile: result.opts.to
})
???