webpackangular-cliangular2-cli

angular.cli - Webpack compile scss to css


I'm using Angular-cli - Webpack and when I use ng-build , I see all scss files but not compiled css.

I expect that assets/styles/_default.scss will compile to assets/styles/_default.css

what can be the problem ?

thanks.


Solution

  • a known issue. it will be fixed in next updates of angular-cli I think.

    if you need to load .scss in runtime so you need to use this line:

    require('style-loader!assets/styles/_default.scss');
    

    and add it to tsconfig file.