S
S
sverhvova2019-08-31 11:28:36
webpack
sverhvova, 2019-08-31 11:28:36

Why do webpack import paths always start with './'?

Explain the nuances:

import greet from './greeter.js';
import greet from 'greeter.js';

2 will not work. My knowledge of paths is either wrong or incomplete, but ./ is the current directory. If ./ is omitted, it will also be the current directory. Couldn't find a clear answer on google

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2019-08-31
@sverhvova

If ./ is omitted it will also be the current directory

If ./ is omitted, then the search will be in node_modules, and this file will not be there))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question