[ ] Bug Report
[ ] Feature Request
[ x ] Question
Hi! I'm new with all of theses technologies and I'm facing with one problem:
...
"styles": [
"../node_modules/styles/dist/styles.scss"
],
"stylePreprocessorOptions": {
"includePaths": [
"../node_modules/styles/dist"
]
},
...
With this, I'm importing the styles on my component like:
file: foo.components.scss
@import "styles"
.foo{
...
}
This works but when I'm trying to package my code, it throws an error related to that import:
console output:
Building Angular library
Generating bundle for test
Cleaning bundle build directory
Processing assets
BUILD ERROR
File to import not found or unreadable: styles.
Error: File to import not found or unreadable: styles.
So I think that I need to specify to packagr where can find that file as I'm doing with my angular-cli.json...
Is there any way to do that? or maybe I'm wrong with my configurations?
This is my ng-package.json:
{
"$schema": "./node_modules/ng-packagr/ng-package.schema.json",
"lib": {
"cssUrl": "inline"
],
"entryFile": "index.ts",
}
}
ng-packagr: 1.6.0
@angular/*: 5.0.0
typescript: 2.6.1
rxjs: 5.5.2
node: 8.9.1
npm: 5.2.0
@alankyn I believe your question is already addressed in issue #282. I have had the same issue. Currently there is not support for additional SASS include paths, but I have opened pull request #494 that should hopefully add support for this feature.
@alankyn Actually, I believe support for loading styles from node_modules is already supported using the ~ operator. You may be able to change your import to @import '~styles/dist/styles' to reference that path.
Hi @mwootendev !!
Thanks for your reply. I will try it.
Really, thank you so much!
Hi @mwootendev!
I tried using ~ operator and its working!
Thanks for your help!
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
_This action has been performed automatically by a bot._
Most helpful comment
Hi @mwootendev!
I tried using
~operator and its working!Thanks for your help!