Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for paths configured in tsconfig.json #220

Closed
baumblatt opened this issue Dec 20, 2017 · 30 comments · Fixed by X-oss-byte/core#3 · 4 remaining pull requests
Closed

Support for paths configured in tsconfig.json #220

baumblatt opened this issue Dec 20, 2017 · 30 comments · Fixed by X-oss-byte/core#3 · 4 remaining pull requests

Comments

@baumblatt
Copy link

Hello Stackblitz,

First of all, congratulations for the spectacular platform.

As a good practice to skip from '../../..' hell, I make use of tsconfig.json compilerOptions/paths feature like above:

{
  "compilerOptions": {
    .....
    "baseUrl": "src",
    "paths": {
      "@app/*": ["app/*"],
      "@env/*": ["environments/*"]
    }
  }
}

In this way, I can import my home component from core module like:
import {HomeComponent} from '@app/core/pages/home/home.component';

Do you have plans to support this feature?

Sample Project:
angular-xzddx4

Edit line 8 and 9 of /app/app.module.ts

Best Regards,
Bernardo Baumblatt.

@EricSimons
Copy link
Member

@baumblatt thanks for the kind words! And yes for sure, we're working to open up tsconfig for folks to modify — will make custom paths makes it in :)

@dieison-depra
Copy link

dieison-depra commented Mar 24, 2018

@EricSimons any news about that´s? thanks in advance!

@changhuixu
Copy link

Any updates on this issue?
Thanks.

@EigenTheory
Copy link

Is this in the works? This is somewhat a crippling feature.

@Disane87
Copy link

+1

@oleersoy
Copy link

Any progress?

@TjeuKayim
Copy link

I would like to enable strick type checking in tsconfig.json.

@santoshsas
Copy link

Any update ?

@prakashslm
Copy link

+1

esanzgar added a commit to esanzgar/fitness that referenced this issue Mar 1, 2019
@julianobrasil
Copy link

news?

@merkuriy
Copy link

merkuriy commented Sep 8, 2019

+1
That would be very helpful to fix.

Example project github/Angular-RU/angular-ngrx-starter

@RemiLelaidier
Copy link

No news ?

@ldex
Copy link

ldex commented Jan 14, 2020

Having tsconfig.json path aliases support would be great!

@onebrother21
Copy link

onebrother21 commented Feb 19, 2020

Open since 2017 and still no deals? Man, yikes. My laptop was stolen and I was really excited to find this platform to use over the phone in the interim. Looks like my first day on it will be consumed w manually replacing each alias reference in every file of my project. Ouch

@amrayoub
Copy link

I was hoping this feature would have been done, since 2017 and still didn't yet :(

@hadnet
Copy link

hadnet commented Apr 11, 2020

Just unbelievable..

@m8xp0w3r
Copy link

Any plans for this issue?

@EricSimons
Copy link
Member

Hey all- hoping to have this out in the next month or two! Have added to our internal tracker and will circle back here once it's online 👍

@BenRacicot
Copy link

@EricSimons Just wondering if this is not available? The stackblitz I'm trying it with will not load when this is used:

      "paths": {
      "@common": [
        "./common"
      ]
    }

@purplem1lk
Copy link
Contributor

Thank you all for your patience - We are launching new core technology into beta next month that should resolve this issue so this will be closed accordingly. If this issue persists, feel free to tag me or ask to reopen this issue with screenshots of the error. Thank you! :)

@PerryCodes
Copy link

I don't see where this is now working... Anyone else either able to enable strictNullChecks in compilerOptions or seeing the functionality enabled by default?

@janstadt
Copy link

janstadt commented Dec 9, 2021

Is this functionality in place yet?

@otatar
Copy link

otatar commented May 24, 2022

This is not working...

@rsorrt
Copy link

rsorrt commented Nov 2, 2022

Thank you all for your patience - We are launching new core technology into beta next month that should resolve this issue so this will be closed accordingly. If this issue persists, feel free to tag me or ask to reopen this issue with screenshots of the error. Thank you! :)

Hello... still not working

@dhutaryan
Copy link

This issue is still reproducing

@Lonli-Lokli
Copy link

It's working with WebContainer's version, https://stackblitz.com/edit/angular-standalone-webcontainer?file=README.md

@rsorrt
Copy link

rsorrt commented May 7, 2023

any news on path support ?
in tsconfig.json i added "paths":

{
  "compileOnSave": false,
  "compilerOptions": {
   "paths": {
      "@appServices/*": ["./src/app/services/*"],
    },
    "strict": false,
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "module": "esnext",
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "typeRoots": ["node_modules/@types"],
    "lib": ["es2018", "dom"]
  },
  "angularCompilerOptions": {
    "strictTemplates": true,
    "strictInjectionParameters": true
  }
}

the project compile and, in a component, i have this:
import { MessageService } from "@appServices/messages/message.service";
that's corresponding to the right path in my project:
stackblitz:/src/app/services/messages/message.service"

app is not showing but I have this error:
Error in src/app/components/messages/messages.component.ts (5:32)
Cannot find module '@appServices/messages/message.service' or its corresponding type declarations.

@ambi-s
Copy link

ambi-s commented Sep 16, 2023

why is this still not working, its been 5 years

@flaviocopes
Copy link

Would be nice if this was possible

@rsorrt
Copy link

rsorrt commented Sep 29, 2024

Hello.. any news for using paths ?
bye

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment