Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/localjo/shell-loader

A Webpack loader that runs an arbitrary script on matching files
https://github.com/localjo/shell-loader

bash bash-script build-tool loader shell shell-script shell-scripts webpack

Last synced: 2 months ago
JSON representation

A Webpack loader that runs an arbitrary script on matching files

Awesome Lists containing this project

README

        

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





Shell Loader


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'
}} ]
}
]
}
```