Repository navigation
tsconfig paths not respected for styles #9018
Description
Activity
- addedfeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issuesP5The team acknowledges the request but does not plan to address it, it remains open for discussionThe team acknowledges the request but does not plan to address it, it remains open for discussion
on Dec 28, 2017 Any updates/fixes/workaround on this?
Reacted by Ryan Hutchison, Eric BREHAULT, okt-pcournoyer, Michael Norgren, Vitaly Iegorov, Colten Krauter, Krzysztof Miskiewicz and Eros SteinAny updates on this?
Same problem
still valid issue. workaround for this is to add this entry in
.angular-cli.json{ "apps": [{ ... "stylePreprocessorOptions": { "includePaths": [ "./app/global-styles" ] }, ... }] }Reacted by Maarten MensinkReacted by Gus and Lindauson Hazellstill valid issue. workaround for this is to add this entry in
.angular-cli.json{ "apps": [{ ... "stylePreprocessorOptions": { "includePaths": [ "./app/global-styles" ] }, ... }] }Do you know if there is a way to make VS Code go to definition(ctrl/cmd + click) still works?
This can fix the build issue, but I am missing go to definitionReacted by Peter Benko, Bruno João and Kyriakos (Dominick) SidiropoulosAny news on this? The workaround does not work for me.
My tsconfig:
"paths": { "@projx/components": [ "projects/projx/components/src/public_api" ], "@projx/components/*": [ "projects/projx/components/*" ], "~@projx/components/themes/default": [ "projects/projx/components/src/lib/styles/themes/default.scss" ] }
Inside my local SCSS file:
@import '~@projx/components/themes/default';
Still, it doesn't work for the styles, only for the TS files.
Reacted by Denis and cesaric- added and removedP5The team acknowledges the request but does not plan to address it, it remains open for discussionThe team acknowledges the request but does not plan to address it, it remains open for discussion
on Oct 8, 2019 Closing as this is working as intended. TypeScript config paths are meant to work solely for TypeScript.
As suggested above you can use
includePathsto shorten your SCSS import.angular-automatic-lock-bot commented
on Jun 27, 2020 More actionsThis issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
- locked and limited conversation to collaborators
on Jun 27, 2020
So the issue is that the
pathssetting from thetsconfig.app.jsonis not respected for style files imports since the cli 1.3.0.My setup is that I have a module inside of my project, aliased in
tsconfig.app.jsonusing:The module consists of various ts and scss files.
The files are imported as:
import { SomeClass } from '@core/module/file';and for styles as:
@import '~@core/module/styles'; // this fails since 1.3.0Since angular-cli@1.3.0 the styles import of this kind is not working.
Simple reproducible example:
nnixaa/cli-scss-alias-issue@40c33c8
Versions
Repro steps
npm startObserved behavior
Desired behavior
Should import styles correctly as per configured
pathssetting.Possibly related
#8117 (workaround used there fixes the issue)
#8036