-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Labels
area: @angular-devkit/build-angularfeatureIssue that requests a new featureIssue that requests a new feature
Milestone
Description
So the issue is that the paths
setting from the tsconfig.app.json
is 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.json
using:
...
"paths": {
"@core/*": [
"./core/*"
]
}
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.0
Since angular-cli@1.3.0 the styles import of this kind is not working.
Simple reproducible example:
nnixaa/cli-scss-alias-issue@40c33c8
Versions
tested and reproducible on cli 1.3.0, 1.6.2, 1.6.3
tested and works fine on cli 1.2.6, 1.2.7
Repro steps
- clone the project https://github.com/nnixaa/cli-scss-alias-issue
- run
npm start
Observed behavior
ERROR in ./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader/lib?{"ident":"postcss","sourceMap":false}!./node_modules/sass-loader/lib/loader.js?{"sourceMap":false,"precision":8,"includePaths":[]}!./src/styles.scss
Module build failed:
@import '~@core/module/styles'; // this fails since 1.3.0
^
File to import not found or unreadable: ~@core/module/styles.
Parent style sheet: stdin
in /Users/nixa/Development/Sandbox/scss-alias-tsconfig/src/styles.scss (line 2, column 1)
Error:
@import '~@core/module/styles'; // this fails since 1.3.0
^
File to import not found or unreadable: ~@core/module/styles.
Parent style sheet: stdin
in /Users/nixa/Development/Sandbox/scss-alias-tsconfig/src/styles.scss (line 2, column 1)
at options.error (/Users/nixa/Development/Sandbox/scss-alias-tsconfig/node_modules/node-sass/lib/index.js:291:26)
@ ./src/styles.scss 4:14-191
@ multi ./src/styles.scss
Desired behavior
Should import styles correctly as per configured paths
setting.
Possibly related
crysislinux, joeskeen, nnixaa, jonathansant, PsyGik and 19 more
Metadata
Metadata
Assignees
Labels
area: @angular-devkit/build-angularfeatureIssue that requests a new featureIssue that requests a new feature