Babel plugin to add the opportunity to use import and require with root-based paths. Install with your package manager of choice. Add it to your plugins array in your babel config. For recent react-native versions, add it as a plugin in babel.config.js. You can configure this plugin by changing the string plugin name to a two-item array. Note that this array is nested inside the plugins array. By default, the import will be relative to the working directory of the process running babel. Typically this means you'll have import paths like ~/src/foo.js. You can change the prefix of "./" to e.g. "src" or "src/js" with this config option. By default everything is resolved relative to the current working directory. You can change this with the root config option. To use it effectively, you'll need to configure babel with one of the JavaScript config file variants, rather than JSON.

Features

  • Install with your package manager of choice
  • Use import and require with root based paths
  • Supportstemplate literals in dynamic import/require
  • Add it to your plugins array in your babel config
  • Transform paths for custom functions
  • By default everything is resolved relative to the current working directory

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow Babel Plugin Root Import

Babel Plugin Root Import Web Site

You Might Also Like
RMM Software | Remote Monitoring Platform and Tools Icon
RMM Software | Remote Monitoring Platform and Tools

Best-in-class automation, scalability, and single-pane IT management.

Don’t settle when it comes to managing your clients’ IT infrastructure. Exceed their expectations with ConnectWise RMM, our MSP RMM software that provides proactive tools and NOC services—regardless of device environment. With the number of new vulnerabilities rising each year, smart patching procedures have never been more important. We automatically test and deploy patches when they are viable and restrict patches that are harmful. Get better protection for clients while you spend less time managing endpoints and more time growing your business. It’s tough to locate, afford, and retain quality talent. In fact, 81% of IT leaders say it’s hard to find the recruits they need. Add ConnectWise RMM, NOC services and get the expertise and problem resolution you need to become the advisor your clients demand—without adding headcount.
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Babel Plugin Root Import!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Browser Extensions and Plugins

Registered

2022-04-07