Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
How to access root folder using module-resolver

I would like to access my package json on my react

on my babel, I have this config

  [
    'module-resolver',
    {
      root: ['.'],
      extensions: ['.js', '.json', '.png'],
      alias: {
        '@@': './',
        '@': './src'
      },
      
    },
  ]

But I'm having an error while importing the package

import { version } from '@@/package.json'

Cannot find module '@@/package.json'

Thanks!

Update: I tried to declare the exact path. It is working

alias: {
        '@@': './package.json',
        '@': './src'
      }

and I tried this one import { version } from '@@'

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!