# @billykwok/combine-loader

> webpack loader to combine results from multiple loaders into one object

Latest version **0.5.0** (published 2018-12-09) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @billykwok/combine-loader
pnpm add @billykwok/combine-loader
yarn add @billykwok/combine-loader
bun add @billykwok/combine-loader
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2018-12-09 |
| First published | 2018-12-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 273.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Billy Kwok |
| Maintainers | billykwok |
| Keywords | combine, loader, webpack |

## Links

- npm: https://www.npmjs.com/package/@billykwok/combine-loader
- Repository: https://github.com/billykwok/combine-loader
- Homepage: https://github.com/billykwok/combine-loader#readme
- Issues: https://github.com/billykwok/combine-loader/issues
- npm.io page: https://npm.io/package/@billykwok/combine-loader

## Dependencies (1)

- [loader-utils](https://npm.io/package/loader-utils.md) ^1.1.0

## 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

- 0.5.0 (latest) — 2018-12-09

## README

# combine-loader

[![npm version](https://img.shields.io/npm/v/combine-loader.svg)](https://www.npmjs.com/package/combine-loader)
[![Greenkeeper badge](https://badges.greenkeeper.io/elliottsj/combine-loader.svg)](https://greenkeeper.io/)
[![Travis CI Build Status](https://travis-ci.org/elliottsj/combine-loader.svg?branch=master)](https://travis-ci.org/elliottsj/combine-loader)
[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/i2aljhr7inuh9wrf/branch/master?svg=true)](https://ci.appveyor.com/project/elliottsj/combine-loader/branch/master)

webpack loader to combine results from multiple loaders into one object

## Installation

```shell
npm install combine-loader
```

## Usage

In your webpack configuration, pass an object as the options for `combine-loader`. Each key-value pair corresponds to the same key in the exported object, using the provided loader string value to load the file. For example:

```js
module.exports = {
  // ...
  module: {
    // ...
    rules: [
      {
        test: /\.md$/,
        loader: 'combine-loader',
        options: {
          raw: 'raw-loader',
          frontmatter: ['json-loader', 'front-matter-loader?onlyAttributes'],
          content: [
            'html-loader',
            'markdown-it-loader',
            'front-matter-loader?onlyBody',
          ],
        },
      }
    ]
  }
}
```

In the above example, the final exported value for **.md** files is an object with keys `raw`, `frontmatter`, and `content`, with values loaded using the provided loaders. In other words, this...

```js
const example = require('./example.md')
```

...is effectively equivalent to this:

```js
const example = {
  raw: require('!raw-loader!./example.md'),
  frontmatter: require('!json-loader!front-matter-loader?onlyAttributes!./example.md'),
  content: require('!html-loader!markdown-it-loader!front-matter-loader?onlyBody!./example.md')
}
```

[_NOTE: `!` is prepended to override loaders in webpack's config_](https://webpack.js.org/concepts/loaders/#inline)

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