Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

babel-plugin-glob-imports

1.0.0-beta.1 • Public • Published

babel-plugin-glob-imports

Build Status

A babel plugin which allows you to import modules from glob expressions.

Example

Before:

import myModule from './src/**/*.js';

After:

import * as one from './src/subdir/one.js';
import * as two from './src/subdir/otherdir/two.js';
const myModule = {
  one: one,
  two: two
}

Limitations

This module is a bit opinionated:

  • All files resolved by the glob must have unique names
  • You can only use the global import with globs (Forbidden: import {something} from "./glob/*.js")

Keywords

Install

npm i babel-plugin-glob-imports

DownloadsWeekly Downloads

4

Version

1.0.0-beta.1

License

ISC

Last publish

Collaborators

  • avatar