0

My project is based on this nice repo - https://github.com/qdouble/angular-webpack2-starter/tree/minimal. And I updated packages to angular 2.2.3, webpack 2.1.0-beta.27 and bootstrap-loader 2.0.0-beta.16. And when I try to build it I get these:

ERROR in ./~/css-loader?sourceMap!./~/resolve-url/resolve-url.js!./~/sass-loader?sourceMap!./src/app/shared/datepicker/datepicker.component.scss Module build failed: ReferenceError: document is not defined

Here's how I use SASS in my components: @Component({ selector: '...', template: `...`, providers: [], encapsulation: ViewEncapsulation.None, styleUrls: ["./datepicker.component.scss"] }) and the datepicker.component.scss file: @import "/node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker3.min.css";

Can someone explain what this error is please?

1 Answer 1

0

try: styles: require("./datepicker.component.scss")

That way, a standard webpack configuration can scan for the required files and properly load and link them.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.