Code Monkey home page Code Monkey logo

babel-root-import's Introduction

Babel Root Import

Babel plugin to add the opportunity to use import with root based paths.
Build Status Codacy Badge Dependency Status devDependency Status https://github.com/michaelzoidl/babel-root-import

Example

// Usually
import SomeExample from '../../../some/example.js';

// With Babel-Root-Importer
import SomeExample from '~/some/example.js';

Install

npm install babel-root-import --save-dev

Use

Add a .babelrc file and write:

{
  "plugins": [
    "babel-root-import"
  ]
}
//or, if all your scripts in 'src/js' folder:
{
  "plugins": [
    ["babel-root-import", {"rootPathSuffix": "src/js"}]
  ]
}

or pass the plugin with the plugins-flag on CLI

babel-node myfile.js --plugins babel-root-import

Motivate

If you like this project just give it a star :) I like stars.

Change Log

3.0.0 - 2015-11-30

  • Updated plugin to new babel6 API
  • Splitted tests and functions into two scopes with single tests
  • Removed the "extra-root" param for the .babelrc since this is no yet supported in babel6

2.0.1 - 2015-11-15

Breaking Change to Babel 5

  • Updated to Babel 6
  • Added integration tests

1.0.1 - 2015-08-07

  • Added / updated tests
  • Implemented ESlint

babel-root-import's People

Contributors

degr avatar fredericheem avatar mastilver avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.