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

Other Useful Business Software
Fax.Cloud delivers encrypted, point-to-point faxing with guaranteed delivery and built-in audit trails Icon
Fax.Cloud delivers encrypted, point-to-point faxing with guaranteed delivery and built-in audit trails

For organizations in regulated industries needing a solution to replace traditional fax infrastructure and integrate with email or online portals

Unlike email or file-sharing tools, Fax.Cloud doesn’t bounce around the internet, exposed and vulnerable. It’s direct, encrypted, and verified. You get delivery confirmation, audit trails, and peace of mind, without the spam filters, metadata leaks, or cyber threats.
Learn More
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