# shell-loader

> A Webpack loader that runs an arbitrary script on matching files

Latest version **1.2.1** (published 2020-03-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install shell-loader
pnpm add shell-loader
yarn add shell-loader
bun add shell-loader
```

## 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.2.1 |
| Published | 2020-03-19 |
| First published | 2017-09-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 1.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Author | josiah.sprague@gmail.com |
| Maintainers | josiahsprague |
| Keywords | webpack, webpack-loader, loader, bash, bash-script, shell, shell-script |

## Links

- npm: https://www.npmjs.com/package/shell-loader
- Repository: https://github.com/localjo/shell-loader
- Homepage: https://github.com/localjo/shell-loader#readme
- Issues: https://github.com/localjo/shell-loader/issues
- npm.io page: https://npm.io/package/shell-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

- 1.2.1 (latest) — 2020-03-19
- 1.2.0 — 2020-02-11
- 1.1.2 — 2018-01-13
- 1.1.1 — 2017-09-04
- 1.1.0 — 2017-09-04
- 1.0.1 — 2017-09-04
- 1.0.0 — 2017-09-04

## README

[![NPM Status](https://img.shields.io/npm/v/shell-loader.svg?style=flat)](https://www.npmjs.com/package/shell-loader)

<div align="center">
  <a href="https://github.com/webpack/webpack">
    <img width="200" height="200" src="https://webpack.js.org/assets/icon-square-big.svg">
  </a>
  <h1>Shell Loader</h1>
</div>

A [Webpack](https://github.com/webpack/webpack) loader for running arbitrary shell scripts when loading files.

## Install

```bash
npm install --save-dev shell-loader
```

## Usage

[Documentation: Using loaders](https://webpack.js.org/loaders/)

Add shell-loader your Webpack configuration object, setting `options.script` to the shell script you want to run on each file. Example;

```javascript
module: {
  rules: [
    {
      test: /.*\.css$/,
      use: [ 'css-loader', { loader: 'shell-loader', options: {
        script: 'postcss --use autoprefixer'
      }} ]
    }
  ]
}
```

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