Answer the question
In order to leave comments, you need to log in
How to properly write alias in webpack?
Hello. I'm trying to set an alias, but there is such a problem: Relative imports outside of src/ are not supported.
Code: '@Components': path.resolve(__dirname, './src/components/'). The bottom line is that the path goes beyond the project and displays such an error. What am I doing wrong? Thanks in advance.
Answer the question
In order to leave comments, you need to log in
Webpack wrote to you what you are doing wrong: "Relative imports outside of src/ are not supported
" it does not support relative import paths outside of a project.
If you are working on a nix system, I can advise you to make a link to the desired folder at the file system level, the link itself should naturally be placed within the project.
Well, i.e.: ln -s desired_dir/components project_dir/components
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question