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

less or sass support #18

Closed allenhwkim closed 8 years ago

allenhwkim commented 8 years ago

We have a very common component like this.

@Component({
  selector: login',
  templateUrl: 'login.tpl.html',
  styleUrls:  ['login.css'],
})

The problem is login.css is written in login.less and it is built by a gulp task into a build directory, which is not in the source directory.

In the source directory we have login.less, not login.css, which results in 404 file not found.

My work around is to compile .less file into our source directory then run this module, then remove it. It works, but it requires two more gulp tasks.

My suggestion is ..

  1. As usual, find .css, and add it inline.
  2. If .css is not found. find .less, then compile in memory, then add it inline.

Thanks for this wonderful module.

ludohenin commented 8 years ago

Similar to #11