postcss-node-sass icon indicating copy to clipboard operation
postcss-node-sass copied to clipboard

the 'data' is overwritten

Open yanhaijing opened this issue 7 years ago • 1 comments

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
    })

yanhaijing avatar Nov 30 '18 12:11 yanhaijing

???

yanhaijing avatar Dec 03 '18 09:12 yanhaijing