Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-config-adambrgmn

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-config-adambrgmn

Personal babel settings

  • 0.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

babel-config-adambrgmn

My basic setup for Babel. To make it work flawless run the following code:

$ npm install --save-dev babel-cli babel-config-adambrgmn babel-preset-{es2015,react,react-hmre,stage-0} babel-plugin-transform-runtime

Then create a new .stylelintrc-file in your projects root folder, and add the following:

{
  "extends": "babel-config-adambrgmn/.babelrc"
}

To be able to use all of the ES6 awsomeness when writing Node applications (or web applications for that matter) a basic setup for an index file would look something like this:

const fs = require('fs');
const path = require('path');

const babelrc = fs.readFileSync(path.join(process.cwd(), '.babelrc')); // Read the .babelrc file in your projects root
let config;

try {
  config = JSON.parse(babelrc); // Try to parse that JSON, if there is something wrong all hell will brak loose
} catch (err) {
  console.error('Error parsing .babelrc');
  console.error(err);
}

require('babel-register')(config); // Initialize Babel with your config
require('babel-polyfill'); // Include the polygill for all the good stuff
require('./src/index'); // And finally start your engines (in here you can do all kinds of cool stuff e.g. import x from 'x' and const hey = await hello())

If you like this kind of setup you also have to run the following:

$ npm install --save babel-{register,polyfill}

Keywords

FAQs

Package last updated on 06 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc