R
R
ravshan selimov2021-01-08 18:22:52
Node.js
ravshan selimov, 2021-01-08 18:22:52

How to use aliases for imports in create-react-app?

Hello.
How to use aliases for imports in create-react-app without doing eject
How do I replace ../../../../../file.jsfor example with @/components/file.js.
The option with module-alias didn't work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Israfil22, 2021-01-08
@ravshan01

Without eject, everything will not be ice.
craco-alias (customize-cra, etc.) is the only type of variant, as I understand it (plugins on top of cra). However, it will remain without IDE support (statistical analyzer, syntax highlights) WebStorm, for example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question