Skip to content
This repository has been archived by the owner on Feb 8, 2021. It is now read-only.
/ babler Public archive

The perfectly simple version of Babel configured for packing your packages

License

Notifications You must be signed in to change notification settings

oneislandearth/babler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


The perfectly simple version of Babel configured for packing your packages

Installation

Babler is available through the npm registry:

$ npm install @oneisland/babler

Usage

The Babler configuration can be extended from within the .babelrc.js in your project directory by passing any Babel options to the babelConfig function.

.babelrc.js (example)
// Import the babel config
const { babelConfig } = require('@oneisland/babler');

// Export the babel config (passing some options)
module.exports = babelConfig({

  // Set the presets to stage-0
  presets: ['@babel/preset-stage-0']

  // Allow comments
  comments: true,

  // Prevent minification of codes
  minified: false
});

The Babler CLI can be executed from within any npm script.

When installing Babler, a prepublishOnly script will be added to your package.json (if one does not already exist).

package.json (example)
{
  "name": "babler-test",
  "version": "0.0.1",
  "description": "A test package using Babler",
  "main": "dist/index.js",
  "scripts": {
    "prepublishOnly": "oneisland-babler dist"
  }
}

The argument dist passed to the Babler CLI represents the output folder for the code after it has been run through Babler.

Babler supports path alias resolving similar to Webpack.

On execution, Babler will resolve path aliases using the baseUrl and paths in your jsconfig.json.

Babler will also add a git pre-commit hook if possible which will run your prepublishOnly script.

License

MIT

Copyright (c) 2019-present, OneIsland Limited

About

The perfectly simple version of Babel configured for packing your packages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published