PhaserEditor2D-v3 icon indicating copy to clipboard operation
PhaserEditor2D-v3 copied to clipboard

Using aliases with Auto Importer

Open robinheidrich opened this issue 4 years ago • 4 comments

I use aliases for my imports and it would be a nice addition if Auto Import used them as well, if possible.

robinheidrich avatar Apr 02 '22 22:04 robinheidrich

Please, can you be more specific?

PhaserEditor2D avatar Apr 04 '22 03:04 PhaserEditor2D

I am talking about import aliases that you configure in webpack and jsconfig.

robinheidrich avatar Apr 04 '22 13:04 robinheidrich

It looks like something complicated to do.

Why are you using aliases in your project? I want to understand more about the problem.

PhaserEditor2D avatar Apr 04 '22 14:04 PhaserEditor2D

I use it because the imports look better in the code. As an example:

import Example from '../../../scenes/Example'

would look like this with the alias @scenes:

import Example from '@scenes/Example'

It would make the generated code look a bit better if that were possible.

But I understand if the implementation is difficult.

robinheidrich avatar Apr 04 '22 15:04 robinheidrich

Yes, it complicates code generation. It is complicated to parse the typescript config file and it requires extra effort to create a specific configuration for the editor. Thanks!

PhaserEditor2D avatar Apr 25 '23 05:04 PhaserEditor2D