$ npm install resolve-sass-import
resolve sass import statement, get sass import content in a single file
npm install resolve-sass-import --save
const resolveSassImport = require('resolve-sass-import');
const sassContent = resolveSassImport('main.scss', path.resolve(process.cwd(), 'src'));
variables1.scss
@color-1: #fff;
variables2.scss
@color-2: #000;
main.scss
@import './variables1.scss';
@import './variables2.scss';
const sassContent = resolveSassImport('main.scss', './'));
// sassContent will log:
// @color-1: #fff;
// @color-2: #000;
© 2010 - cnpmjs.org x YWFE | Home | YWFE