Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

Fixed problem with tsconfig.json baseUrl and paths #223

Merged
merged 1 commit into from
Jan 15, 2018

Conversation

diabelb
Copy link
Contributor

@diabelb diabelb commented Jan 13, 2018

This solves: #203
Add sample config to tsconfig.json:

"baseUrl": ".", "paths": { "@App/*": [ "src/*" ] },

You can use now:
import { something } from '@App/somemodule'
in your typescript code ;)

@DorianGrey
Copy link
Collaborator

I'll have a closer look into this tomorrow - had some problems in the past with this plugin not picking up all paths correctly, need to check if this is still the case.

@DorianGrey
Copy link
Collaborator

Checked the current version of this plugin on a couple of projects, and the previously faced issues are absent now.

LGTM, thanks!

@DorianGrey DorianGrey merged commit 6b94639 into wmonk:master Jan 15, 2018
@diabelb
Copy link
Contributor Author

diabelb commented Jan 15, 2018

Great! ;)

@wmonk
Copy link
Owner

wmonk commented Jan 22, 2018

Released in 2.13.0

@mikew
Copy link

mikew commented Mar 20, 2018

Should this have also included changes to the template's tsconfig files?

I'm seeing the same errors mentioned in #250:

Failed to load tsconfig.json: Missing baseUrl in compilerOptions
...
Found no baseUrl in tsconfig.json, not applying tsconfig-paths-webpack-plugin
Found no baseUrl in tsconfig.json, not applying tsconfig-paths-webpack-plugin

@DorianGrey
Copy link
Collaborator

Technically, this message is not problematic as long as you are not using any path mappings. Those require a baseUrl, that's why the plugin complains if it's missing. However, if there aren't any, the plugin is not required at all, thus it's perfectly valid that it does not apply itself.

@mikew
Copy link

mikew commented Mar 21, 2018

Thanks for the explanation. That first failure message is unnerving though.

@MOZGIII
Copy link

MOZGIII commented Apr 3, 2018

Please remove this message if there are no path mappings. It has no use and is just distracting if one's not using path mappings, and that should not be happening by default.

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

Successfully merging this pull request may close these issues.

5 participants