# create-functional-loader

> forked from `simple-functional-loader`, fix some bugs and rewrite by typescript

Latest version **0.1.4** (published 2023-11-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install create-functional-loader
pnpm add create-functional-loader
yarn add create-functional-loader
bun add create-functional-loader
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2023-11-24 |
| First published | 2023-06-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | SonOfMagic |
| Maintainers | icebreaker |
| Keywords | webpack, webpack-loader, simple, functional, simple-functional-loader |

## Links

- npm: https://www.npmjs.com/package/create-functional-loader
- Repository: https://github.com/sonofmagic/utils
- Homepage: https://github.com/sonofmagic/utils/tree/main/packages/create-functional-loader#readme
- Issues: https://github.com/sonofmagic/utils/issues
- npm.io page: https://npm.io/package/create-functional-loader

## Dependencies (2)

- [loader-utils](https://npm.io/package/loader-utils.md) ^2.0.3
- [@types/loader-utils](https://npm.io/package/@types/loader-utils.md) ^2.0.6

## 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.1.4 (latest) — 2023-11-24
- 0.1.3 — 2023-11-24
- 0.1.2 — 2023-11-24
- 0.1.1 — 2023-11-24
- 0.1.0 — 2023-06-15
- 0.0.9 — 2023-06-15
- 0.0.8 — 2023-06-15
- 0.0.7 — 2023-06-15
- 0.0.6 — 2023-06-15
- 0.0.5 — 2023-06-14
- 0.0.4 — 2023-06-14
- 0.0.3 — 2023-06-14
- 0.0.2 — 2023-06-14
- 0.0.1 — 2023-06-14

## README

# create-functional-loader

This is a fork of `simple-functional-loader` but rewrite with `Typescript` for TypeStrong !

> Use function as webpack loader option

## Install

```bash
<npm|yarn|pnpm> i -D create-functional-loader
```

## Usage

```js
// webpack.config.js
const { createLoader } = require('create-functional-loader')
module.exports = {
  //...
  module: {
    rules: [
      {
        test: /\.html$/,
        use: [
          createLoader(function(source, map) { // must be an "ES5" function!
            // use "this" as loaderContext
            return processHTML(source, map) // process source code.
          })
        ]
      }
    ]
  }
}
```

`createLoader` function will return [`UseEntry`](https://webpack.js.org/configuration/module/#useentry) object:

```js
{
  loader: string,
  options: object,
  ident: string
}
```

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