Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (9.5k points)

See the example below: 

import Component from '@/components/component'

As I notice, it behaves like ../ which goes up one level in the directory relative to the file path. Can anyone tell me what exactly does the symbol @ does?

1 Answer

0 votes
by (19.7k points)

The meaning and structure of the module identifier depend on the module loader or module bundler. You must be having babel-plugin-root-import in your webpack/babel config.

It means that it’s from the root of the project. So you don’t have to write import Component from '../../../../components/component'.

Interested in Java? Check out this Java Certification by Intellipaat.  

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jan 24, 2021 in Java by dante07 (13.1k points)
0 votes
1 answer

Browse Categories

...