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

Different tsconfig.json for ionic? #273

Closed
studds opened this issue Oct 13, 2017 · 4 comments
Closed

Different tsconfig.json for ionic? #273

studds opened this issue Oct 13, 2017 · 4 comments

Comments

@studds
Copy link

studds commented Oct 13, 2017

This is more of a question / clarification... the instructions here http://lathonez.com/2017/ionic-2-e2e-testing/ recommend adding "exclude": ["node_modules", "src/test.ts", "e2e"], to tsconfig.json. This makes sense, but it means that vscode, which using tsconfig.json, won't report errors in test files. (Or at least, it won't report errors that require type checking. I'm also using https://github.com/angelozerr/tslint-language-service and so linting isn't available in excluded files.

Is there a recommended approach here? Is there a way to direct ionic to use a different tsconfig.json, similar to how ng cli has a tsconfig per-task? Alternatively, does it actually matter if these files aren't excluded?

@lathonez
Copy link
Owner

it means that vscode, which using tsconfig.json, won't report errors in test files

I have the same issue in webstorm, when I last looked there wasn't a way to direct the editor to use a specific config file. Unfortunately the best way I've found to work around this is to comment out the exclude when I'm not running the app.

I'm also using https://github.com/angelozerr/tslint-language-service and so linting isn't available in excluded files.

Sorry I don't know about tslint-language-service.

Is there a way to direct ionic to use a different tsconfig.json, similar to how ng cli has a tsconfig per-task?

Not to my knowledge, least not the last time I checked. Ionic are constantly improving their scripts, so this may have changed.

Alternatively, does it actually matter if these files aren't excluded?

There's a lot of history here.. #159 #167 #170 #174 #236

Here's the relevant comment where we finally added it back: #236 (comment)

So, it seems they are only there for ionic build --prod. I have run that locally and it works OK, so am going to remove them and see what breaks in CI / who complains about it.

@lathonez
Copy link
Owner

So yea, it breaks on windows: https://ci.appveyor.com/project/lathonez/clicker/build/1.0.147

@lathonez
Copy link
Owner

Added the Jasmine types back in, which fixed it previously on Windows

@lathonez
Copy link
Owner

looks good.

So basically - you no longer need the excludes. If you are running windows you need to add jasmine types. Have never been able to figure out why these are not needed on linux based distro.

See recent commits, will update the blog.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants