# import-glob

> ES6 import with glob patterns (preloader for Webpack)

Latest version **1.5.0** (published 2016-10-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install import-glob
pnpm add import-glob
yarn add import-glob
bun add import-glob
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.0 |
| Published | 2016-10-03 |
| First published | 2015-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 58 |
| Author | Terpil Jenya |
| Maintainers | terpiljenya |
| Keywords | webpack, loader, glob, es6 |

## Links

- npm: https://www.npmjs.com/package/import-glob
- Repository: https://github.com/terpiljenya/import-glob
- Homepage: https://github.com/terpiljenya/import-glob#readme
- Issues: https://github.com/terpiljenya/import-glob/issues
- npm.io page: https://npm.io/package/import-glob

## Dependencies (1)

- [glob](https://npm.io/package/glob.md) ^5.0.13

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 1.5.0 (latest) — 2016-10-03
- 1.4.0 — 2015-12-20
- 1.3.0 — 2015-11-20
- 1.2.0 — 2015-11-13
- 1.1.0 — 2015-11-12
- 1.0.0 — 2015-09-07

## README

[![Build Status](https://travis-ci.org/terpiljenya/import-glob.svg)](https://travis-ci.org/terpiljenya/import-glob)
[![npm version](https://badge.fury.io/js/import-glob.svg)](https://badge.fury.io/js/import-glob)
# import-glob
ES6 import with glob patterns (preloader for Webpack)

Expands globbing patterns for ES6 `import` statements.

---
```js
import modules from "./foo/**/*.js";
```
Expands into
```js
import * as module0 from "./foo/1.js";
import * as module1 from "./foo/bar/2.js";
import * as module2 from "./foo/bar/3.js";

modules = [module0, module1, module2]
```
---
__For side effects:__

```js
import "./foo/**/*.scss";
```
Expands into
```js
import "./foo/1.scss";
import "./foo/bar/2.scss";
```
---
__For sass:__

```scss
@import "./foo/**/*.scss";
```
Expands into
```scss
@import "./foo/1.scss";
@import "./foo/bar/2.scss";
```

---

## Install
```sh
npm install import-glob --save-dev
```

## Usage
You can use it one of two ways, the recommended way is to use it as a preloader

```js
{
  module: {
    preloaders: [{
      test: /\.js/,
      loader: 'import-glob'
    },
    {
      test: /\.scss/,
      loader: 'import-glob'
    }
    ]
  }
}
```

Alternatively you can use it as a chained loader
```js
require('!import-glob!foo/bar.js')
```

---
_Source: https://npm.io/package/import-glob · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
