2

I am using webpack with angular 2 and got sass working with it. My next step is to get AOT working. I am now stuck because ngc fails when it gets to my scss files as it can't find the imports.

The message is "Resource file not found..." and refers to an import statement. It makes sense that the compiler might need the scss files process first but that would require the app to be built first and for it to successfully build the ngFactories need to be created.

gelliott181
  • 1,008
  • 11
  • 19
Jason
  • 1,316
  • 13
  • 25
  • 1
    Please embed the full error description (This doesn't have to include the stack trace) for context. – gelliott181 Sep 16 '16 at 18:05
  • I'm experiencing the same issue. The full error I'm receiving reads, "Error: Compilation failed. Resource file not found: /Users/dbudiac/Projects/editor/node_modules/bourbon/app/assets/stylesheets/bourbon". The path is valid, and `bourbon` is valid shorthand for `_bourbon.scss`. – dansays Sep 21 '16 at 19:26
  • Hi did you find out how to sort this issue, I'm facing the same issue. – LintonB Apr 28 '17 at 06:24

1 Answers1

2

Currently (2016/12/28), there is no way to handle it. Yes, that sucks.

The best way to do it is using node-sass to compile it before running ngc.

Here is the example from angular-webpack2-starter

It seems like pretty inconvenience.

Here is the hope. @ngtools/webpack

With this, we can just use scss directly in component.

maxisam
  • 21,975
  • 9
  • 75
  • 84