grunt-ts icon indicating copy to clipboard operation
grunt-ts copied to clipboard

Is it possible to specify which module to import from with Transforms?

Open gCardinal opened this issue 9 years ago • 3 comments

Couldn't find it in the documentation or by digging a bit in the source code; is it possible to specify which file to import when setting up our transforms?

Say I have a Contact file for a controller in app/controller/ and a Contact object for my routing in app/routes. It'd like to be able to tell grunt-ts to import not the controller but the route. Something like ts:ref=routes.Contact.

Is this at all possible?

gCardinal avatar Jun 01 '15 19:06 gCardinal

Is this at all possible?

Not at the moment. File names need to be be unique.

Couldn't find it in the documentation

If someone can doc this it would be great :rose:

basarat avatar Jun 02 '15 05:06 basarat

Alright, thanks for the answer, I'll try and work around it for now.

Knowing that it's not possible though, isn't it something that would be useful? It's far from far-fetched to imagine a scenario where there are multiple files with the same name in different modules.

gCardinal avatar Jun 02 '15 14:06 gCardinal

@gCardinal Hi - sorry this floated out there so long. I am willing to consider a PR once v5 comes out. If you're interested to create this functionality, please let me know. For now, I'll mark this as jump in.

nycdotnet avatar Aug 31 '15 19:08 nycdotnet