Answer the question
In order to leave comments, you need to log in
How to specify module paths in webpack relative to src folder?
Hello.
When deploying the project, I used the CRA package. Therefore, I use webpack version 4.41.2.
So, when importing components and not only, I want to refer to the src folder, and not the current folder in which the file is located, into which I am importing something.
Following the webpack documentation , I did the following:
modules: ['node_modules', path.resolve(__dirname, 'src')].concat(
modules.additionalModulePaths || []
),
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question