1. babel-load-config
Use exactly the same way babel-core does to load .babelrc
babel-load-config
Package: babel-load-config
Created by: egoist
Last modified: Mon, 13 Jun 2022 04:00:14 GMT
Version: 1.0.0
License: MIT
Downloads: 1,164
Repository: https://github.com/egoist/babel-load-config

Install

npm install babel-load-config
yarn add babel-load-config

babel-load-config

NPM version NPM downloads Build Status donate

Install

 # this requires babel-core as peer dependency
yarn add babel-load-config babel-core

Usage

 const loadConfig = require('babel-load-config')
const buildConfigChain = require('babel-core/lib/transformation/file/options/build-config-chain')

const config = loadConfig(process.cwd(), buildConfigChain)
//=> {loc: '/User/name/dir/.babelrc', options: {presets: []}}

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

babel-load-config © egoist, Released under the MIT License.

Authored and maintained by egoist with help from contributors (list).

egoistian.com · GitHub @egoist · Twitter @rem_rin_rin

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code