Using @ for import in React.js
P粉682987577
P粉682987577 2023-09-17 16:40:20
0
1
656

I'm trying to adapt a Next.js template to start a new project. However, I have seen this type of import in previous projects.

import config from "@config/config.json";
import theme from "@config/theme.json";

I would like to know how to do this type of import using @. Which term should I search in the documentation to achieve this?

I would appreciate any explanation.

P粉682987577
P粉682987577

reply all(1)
P粉401527045

Create a jsconfig.json file in the root of your directory and

 {
 "compilerOptions": {
   "baseUrl": ".",
   "paths": {
     "@ClientApp/*": ["./ClientApp/*"]
   }
 }
}

Enjoy it

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!