I've been struggling for a very long time now to get styles to work in webpack. For some reason referencing the .css file does not import the css. Referencing the .scss gives even more problems.
Referring to this question, I have the same situation:
https://www.syncfusion.com/forums/165499/scss-webpack-typescript-examples
However, the solution is not working for me.
I basically have a index.scss file referencing .scss for all my libraries. Then I import that index.scss file in my main index.js file.
It works fine for my other libraries such as Bootstrap4:
However building this webpack with the suncfusion included, I get the following errors:
1 │ @import "ej2-base/styles/bootstrap4.scss";
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
node_modules\@syncfusion\ej2\base\bootstrap4.scss 1:9 @import
node_modules\@syncfusion\ej2\bootstrap4.scss 4:9 @import
sass\index.scss 2:9 root stylesheet
It's obvious that the .scss files referenced in the ej2-base file for some reason are incorrectly processed (their locations). Thus those files cannot be found and the build fails.
I'm not exactly sure how to solve this problem. Any advice will be appreciated.
|
{
loader: "sass-loader",
options: {
includePaths: [./node_modules/@syncfusion]
}
} |
Thanks, that solved my problem. However, the loader settings should look as follows: