question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to use "styleIncludePaths" ?

See original GitHub issue

Type of Issue

[?] Bug Report

Description

"styleIncludePaths": {
          "description": "Any additional paths that should be used to resolve style imports",
          "type": "array",
          "items": {
            "type": "string"
          }
}

I found this schema, but no matter how I try, it doesn’t work. My lib dir structure is like this:

/lib/module/src/styles/index.scss
/lib/module/ng-package.json

And I add styleIncludePaths in ng-packge.json like this:

"lib": {
    "entryFile": "src/public_api.ts",
    "styleIncludePaths": [
      "styles/index.scss" // and I have tried "index.scss" , "src/styles/index.scss", but nothing happened.
    ]
}

How To Reproduce

No error, but nothing happened.

Expected Behaviour

How do I use it? If it doesn’t work anyway, can u add a “staticAssetsPaths” schema, like angular.json’s architect.build.options.assets ? I think not only me, many developers need to include static resources in the package, such as font icons. I now use Python to do this.

Version Information

$ node_modules/.bin/ng-packagr --version
ng-packagr: latest
@angular/*: latest
typescript: 2.9.2
rxjs: latest
node: latest
npm/yarn: latest

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
alan-agius4commented, Sep 10, 2018

You need to follow the angular cli schema for libraries. https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/build_ng_packagr/src/build/schema.json

Those changes need to be added to ng-packagr.json

6reactions
zjl1985commented, Oct 22, 2018

I also encountered the same problem…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular library - Ng-packagr: entrypoint and styleIncludePaths
I'd like to setup a main entrypoint inside my angular lib so the link is cleaner; I'd like to use styleIncludePaths from ng-packagr...
Read more >
use "stylePreprocessorOptions.includePaths" from project.json ...
Nx Workspace: use "stylePreprocessorOptions. ... WEB-58673 Use 'styleIncludePaths' from angular library "ng-package.json" to resolve SASS include paths.
Read more >
creating a library that supports Angular Material theming is ...
This means using scss-bundle is no longer necessary. ... in a library edit ng-package.json and a styleIncludePaths setting as shown below.
Read more >
ng-packagr - npm
Start using ng-packagr in your project by running `npm i ng-packagr`. ... paths may be configured through the styleIncludePaths option.
Read more >
Angular library styleIncludePaths not working - Bountysource
I'm developing two projects in one angular application. One is angular library, in ng-package.json for this library I set styleIncludePaths, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found