N
N
Nikolay Matyushkin2020-01-15 20:33:14
React
Nikolay Matyushkin, 2020-01-15 20:33:14

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 || []
      ),

But it didn't work. Tell me what's wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2020-01-16
@iCoderXXI

fpomasch aliases

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question