[v4.0.0-rc0] scss paths and ngc issues
See original GitHub issueType of Issue
[x] Bug Report
[ ] Feature Request
Description
I prepared a branch to show what I have issues with since v4.0.0-rc0
.
Local scss paths I think we have an unintended problem with scss paths since this PR https://github.com/dherges/ng-packagr/commit/2655defd9bce751955acc41212355544195ed452
It’s not possible anymore to import local scss files without explicitly declare the local folder as a source for styles via styleIncludePaths
. In the existing scss-paths sample I had to add this line
https://github.com/georgiee/ng-packagr/commit/a8e41dee3749997f0517d96c826024f1ddb59ceb#diff-b869ab5af02a430f807c7463151e280aR15
in order to load the local scss file local-mixins.scss
. In my real world project I have to add an even short path to some of my secondary entry points:
"styleIncludePaths": ["./"]
Is this effect intended? I appreciate the alignment with Angular CLI but I think currently it’s missing to look up the local folder of each entry point by default.
TS error I have als included a little TS snippet.
export function someOtherFoo(value: any) {
return typeof value === 'string';
}
This will cause the sample to fail with this error message.
BUILD ERROR
Cannot read property 'text' of undefined
TypeError: Cannot read property 'text' of undefined
at TokenObject.TokenOrIdentifierObject.getText (
This was working before so it might be related to some changes in the tsconfig/aot compiler. When replaced with a more simple return statement it’s working (see how to reproduce for details). So it’s related to this issue here: https://github.com/UltimateAngular/aot-loader/issues/14
How To Reproduce
I updated the scss-paths sample and included it in the launch.json so you can just easily run it.
It will fail with the getText error due issues with the someOtherFoo
function. Replace with this:
export function someOtherFoo(value: any) {
return true;
}
It’s working then. Now remove the ./bar
path in the package.json of the sample
//before
"styleIncludePaths": ["../assets", "./assets", "./bar"]
//after
"styleIncludePaths": ["../assets", "./assets"]
It will fail with the message:
Error: File to import not found or unreadable: ./local-mixins.scss.
Well because the folder is not part of the lookup array.
Version Information
Example is based on latest ng-packagr master. Here my ng -v
Angular CLI: 6.0.3
Node: 8.9.4
OS: darwin x64
Angular: 6.0.0
... common, compiler, compiler-cli, core, http, language-service
... platform-browser
Package Version
------------------------------------------------------
@angular-devkit/architect 0.6.3 (cli-only)
@angular-devkit/core 0.6.0
@angular-devkit/schematics 0.6.3 (cli-only)
@angular/cdk 6.2.0
@angular/router 6.0.1
@ngtools/json-schema 1.1.0
@schematics/angular 0.6.3 (cli-only)
@schematics/update 0.6.3 (cli-only)
rxjs 6.1.0
typescript 2.7.2
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (6 by maintainers)
Top GitHub Comments
I just tested 4.0.0-rc3 and it works great.
v4.0.0-rc.3
and run the scss-paths sample. Works ✅👌3.x
withv4.0.0-rc.3
in our UI library and added theenableResourceInlining
option. It’s building and also the integration test based on the built artefacts are working ✅. Awesome work. Thank you very much!I consider this issue closed 🙏
Hey @alan-agius4, thanks a lot for your response. I’m also sorry that I created only one issue for this matter- this bad idea rose from the single repository I used to showcase the problems.
I will give your linked PR a try (that linked commit looks like a proof already) and also test the incremental build functionality. This looks like a fantastic piece of work just by looking at the changes 👏