ludohenin / gulp-inline-ng2-template

Gulp plugin to inline HTML and CSS into Angular 2 component decorators
MIT License
126 stars 26 forks source link

Support for .scss in the templateUrl #78

Closed aelbore closed 7 years ago

aelbore commented 7 years ago

Can i use .scss instead of .css on the templateUrl? Thanks

aelbore commented 7 years ago

Heres a code ^^

import sass from 'node-sass';

styleProcessor: (stylePath, ext, styleFile, callback) => {
  if (ext[0] === '.scss') {
    let sassObj = sass.renderSync({ file: stylePath });
    if (sassObj && sassObj['css']){
      styleFile = sassObj.css.toString('utf8');
    }
  }
  return callback(null, styleFile);  
}