Title: tsconfig paths not respected for styles · Issue #9018 · angular/angular-cli · GitHub
Open Graph Title: tsconfig paths not respected for styles · Issue #9018 · angular/angular-cli
X Title: tsconfig paths not respected for styles · Issue #9018 · angular/angular-cli
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": { "@c...
Open Graph 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 tsc...
X 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 tsc...
Opengraph URL: https://github.com/angular/angular-cli/issues/9018
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"tsconfig paths not respected for styles","articleBody":"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.\r\n\r\nMy setup is that I have a module inside of my project, aliased in `tsconfig.app.json` using:\r\n```\r\n ...\r\n\r\n \"paths\": {\r\n \"@core/*\": [\r\n \"./core/*\"\r\n ]\r\n }\r\n```\r\nThe module consists of various ts and scss files.\r\n\r\nThe files are imported as:\r\n`import { SomeClass } from '@core/module/file';`\r\n\r\nand for styles as:\r\n`@import '~@core/module/styles'; // this fails since 1.3.0`\r\n\r\nSince angular-cli@1.3.0 the styles import of this kind is not working.\r\n\r\nSimple reproducible example:\r\n\r\nhttps://github.com/nnixaa/cli-scss-alias-issue/commit/40c33c8db58ae6f9b6c73670f0a16624428d388a\r\n\r\n### Versions\r\n```\r\ntested and reproducible on cli 1.3.0, 1.6.2, 1.6.3\r\ntested and works fine on cli 1.2.6, 1.2.7\r\n```\r\n\r\n### Repro steps\r\n- clone the project https://github.com/nnixaa/cli-scss-alias-issue\r\n- run `npm start`\r\n\r\n\r\n### Observed behavior\r\n\r\n```\r\nERROR 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\r\nModule build failed:\r\n@import '~@core/module/styles'; // this fails since 1.3.0\r\n^\r\n File to import not found or unreadable: ~@core/module/styles.\r\nParent style sheet: stdin\r\n in /Users/nixa/Development/Sandbox/scss-alias-tsconfig/src/styles.scss (line 2, column 1)\r\nError:\r\n@import '~@core/module/styles'; // this fails since 1.3.0\r\n^\r\n File to import not found or unreadable: ~@core/module/styles.\r\nParent style sheet: stdin\r\n in /Users/nixa/Development/Sandbox/scss-alias-tsconfig/src/styles.scss (line 2, column 1)\r\n at options.error (/Users/nixa/Development/Sandbox/scss-alias-tsconfig/node_modules/node-sass/lib/index.js:291:26)\r\n @ ./src/styles.scss 4:14-191\r\n @ multi ./src/styles.scss\r\n```\r\n\r\n### Desired behavior\r\nShould import styles correctly as per configured `paths` setting.\r\n\r\n\r\n### Possibly related\r\nhttps://github.com/angular/angular-cli/issues/8117 (workaround used there fixes the issue)\r\nhttps://github.com/angular/angular-cli/issues/8036\r\n","author":{"url":"https://github.com/nnixaa","@type":"Person","name":"nnixaa"},"datePublished":"2017-12-28T16:32:09Z","url":"https://github.com/angular/angular-cli/issues/9018"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7c0da601-c0aa-598e-277b-f4d31adca867 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A04A:20AA01:41E533E:5396FE2:6B020F49 |
| html-safe-nonce | f3cf9b7391760f355f96b15b06121197cfb1af658ea13be5a9877495841033bf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDRBOjIwQUEwMTo0MUU1MzNFOjUzOTZGRTI6NkIwMjBGNDkiLCJ2aXNpdG9yX2lkIjoiNzQ4OTcxOTA1OTUzNDE4ODM2MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bfde30b88e1b689db0a90527ab7b1239f7d5eeeb49a22576587223cacf869397 |
| hovercard-subject-tag | issue:284948167 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/9018/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dc1e49d62cbbe1d2f9c77f1c550584fb9eaf0d98582776ad09fe7309dfc4c3a8/angular/angular-cli/issues/9018 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dc1e49d62cbbe1d2f9c77f1c550584fb9eaf0d98582776ad09fe7309dfc4c3a8/angular/angular-cli/issues/9018 |
| og:image:alt | 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 tsc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nnixaa |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width