shlomiassaf / ngc-webpack

Angular compiler-cli with webpack's loader chain.
MIT License
84 stars 15 forks source link

v1.2.0 still gives error with resourceOverride option set #8

Closed jlee1201 closed 7 years ago

jlee1201 commented 7 years ago

I saw your discussion here: https://github.com/AngularClass/angular2-webpack-starter/issues/1406 and updated to 1.2.0.

I still get this error:

ERROR in ./~/css-loader!./~/postcss-loader!./~/sass-loader/lib/loader.js!./config/resource-override.js
Module build failed: No input specified: provide a file name or a source string to process
 @ ./src/app/moneyback-guarantee/moneyback-guarantee.style.scss 2:21-180
 @ ./src/app/moneyback-guarantee/moneyback-guarantee.component.ts
 @ ./compiled/src/app/app.module.ngfactory.ts
 @ ./src/main.browser.aot.ts

when I comment out the resourceOverride option in my webpack config, the error goes away.

     new ngcWebpack.NgcWebpackPlugin({
        disabled: !AOT,
        tsConfig: helpers.root('tsconfig.webpack.json')/*,
        resourceOverride: helpers.root('config/resource-override.js')*/
      })

In the .scss file mentioned in error, the only poignant things I have are:

@import "../shared/config";

(which contains a bunch of variable declarations), and:

.moneyback-text__bottom__button {
  height: 3.5em;
  width: 3.5em;
  border: none;
  outline: none;
  background: transparent url('/assets/img/next-button.png');
  background-size: contain;
}
pglazkov commented 7 years ago

Looks like it this problem only appears after updating the sass-loader package from 4.1.1 to the latest version. With 4.1.1 it works fine.

shlomiassaf commented 7 years ago

FYI: With version 3.2.0 of ngc-webpack using reousrceOverride is no longer needed not recommended.

Just add the loader along with the plugin and everything should work.