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")

Readme

Keywords

Package Sidebar

Install

npm i babel-plugin-glob-imports

Weekly Downloads

0

Version

1.0.0-beta.1

License

ISC

Last publish

Collaborators

  • geowarin