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

Map directly to a file? #3

Closed
theogravity opened this issue Feb 12, 2018 · 2 comments
Closed

Map directly to a file? #3

theogravity opened this issue Feb 12, 2018 · 2 comments

Comments

@theogravity
Copy link

theogravity commented Feb 12, 2018

I'm trying to do the following, but it does not seem to work:

    "paths": {
      "leaflet": ["./node_modules/leaflet/dist/leaflet.js"]
    }

The leaflet package does not use a minified file as its entry point. I use the standard

import 'leaflet' vs import 'leaflet/dist/leaflet.js'

in my typescript files so I can still get type support.

I have a separate tsconfig.prod.json with the above definition so that on build, it can remap leaflet references to that.

Is there a way to do this kind of mapping?

@duffman
Copy link
Owner

duffman commented Apr 8, 2018

Hi there mr Gravity :)
First of all, sorry for the late answer, I have been having some health issues and have been
off the grid for some time now.

To answer your question, tspath in its current release is not able to handle single files like
you describe, the upcoming version might :) I can actually see a few use cases.

//Patrik

@duffman
Copy link
Owner

duffman commented Sep 13, 2018

After some consideration, although this feature could be "handy" at times but altogether I think it would be more confusing than useful, what this utility does is that it translates paths, what you are describing is something more of a macro-style thing and is nothing that will be implemented in the main branch!
But don´t let that stop you from forking it and having a got at it yourself!

@duffman duffman closed this as completed Sep 13, 2018
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