Aaron Ullal
Aaron Ullal

Reputation: 5245

Angular Library "includePaths" alternative

I am trying to build a angular 11 library with some wrapper components around Syncfusion's EJ2. I am trying to import scss files from their node_modules directive, and as per their documentation, to avoid SCSS compilation issues and to map the SCSS file path it's required to add "node_modules/@syncfusion" to the "includePaths" property of the "stylePreprocessorOptions" in the angular.json config file.

Being in angular library however, I do not have such property. What would be the equivalent or a way to achieve the same result?

ALREADY TRIED

Upvotes: 0

Views: 1134

Answers (1)

user3860630
user3860630

Reputation: 199

We have created a sample angular library application for your reference that you can download from the below link.

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/workspace1508444094

“ng-package.json” configuration:

{
  "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
  "dest": "../../dist/lib",
  "lib": {
    "entryFile": "src/public-api.ts",
    "styleIncludePaths": [“../../node_modules/@syncfusion”]
  }
}

“lib.component.scss”:

@import '~@syncfusion/ej2-angular-buttons/styles/material.scss';
  1. Download the sample
  2. Run the “npm install” command in root directory.
  3. Build the library and app using “ npm run build”
  4. Serve the application with lib component using “ npm run start”.

Upvotes: 3

Related Questions