Skip to content

`easy import` module is written Danny which is no long working at Vungle. It's very dangerous if we continue using his module.

Notifications You must be signed in to change notification settings

Vungle/easy-import

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Easy Import

A package-like importer for JavaScript and Babel.

Installation

  1. npm install --save-dev easy-import
  2. "plugins": ["easy-import"] - .babelrc options

Options

  1. from - folder you are building your files from
  2. to - folder you are building your files to
  3. directories - directories to traverse to find packages

"plugins": [["easy-import", { "from": "src", "to": "dist", "directories": ["src", "test"] }]]

Example

./src/packages/math.js

// @package Math

const main = Math;
const multiply = (a, b, c) => a * b * c;
const sum = (a, b, c) => a + b + c;

export default main;
export {
  multiply,
  sum,
};

./src/controllers/anything.js

import math, { multiply, sum } from 'Math';
// or import * as math from 'Math'
// or import { multiply } from 'Math'
console.log(multiply(1, 2, 3), sum(1, 2, 3), math.min(100, 200));

About

`easy import` module is written Danny which is no long working at Vungle. It's very dangerous if we continue using his module.

Resources

Stars

Watchers

Forks

Packages

No packages published