Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/localjo/shell-loader
- Owner: localjo
- Created: 2017-09-04T16:02:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T05:59:37.000Z (almost 2 years ago)
- Last Synced: 2024-10-16T17:41:39.029Z (3 months ago)
- Topics: bash, bash-script, build-tool, loader, shell, shell-script, shell-scripts, webpack
- Language: JavaScript
- Size: 13.7 KB
- Stars: 21
- Watchers: 2
- Forks: 3
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
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)
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'
}} ]
}
]
}
```