Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simonalling/git-lfs-loader
A Webpack loader to prevent accidentally importing Git LFS pointer files
https://github.com/simonalling/git-lfs-loader
Last synced: 1 day ago
JSON representation
A Webpack loader to prevent accidentally importing Git LFS pointer files
- Host: GitHub
- URL: https://github.com/simonalling/git-lfs-loader
- Owner: SimonAlling
- License: mit
- Created: 2021-02-22T16:43:04.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-02-22T16:54:47.000Z (almost 4 years ago)
- Last Synced: 2024-12-28T10:09:06.458Z (about 1 month ago)
- Language: TypeScript
- Size: 1.13 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git-lfs-loader
[![NPM Version][shield-npm]][npm-url]
[![Downloads Stats][shield-downloads]][npm-url][npm-url]: https://npmjs.org/package/git-lfs-loader
[shield-npm]: https://img.shields.io/npm/v/git-lfs-loader.svg
[shield-downloads]: https://img.shields.io/npm/dm/git-lfs-loader.svgA Webpack loader to prevent accidentally importing Git LFS pointer files.
## Installation
```sh
npm install --save-dev git-lfs-loader
```## Usage
```js
// webpack.config.jsmodule.exports = {
// ...
module: {
rules: [
{
test: /\.(png|jpe?g)$/,
use: [
{
loader: "file-loader",
},
{
loader: "git-lfs-loader",
options: {
errorEncountered: "error",
pointerFileFound: "warning",
},
},
],
},
],
},
}```
### Options
#### `errorEncountered`
You can control what happens if an error is encountered (e.g. if Git LFS is not installed) by setting this option to either `"error"` or `"warning"`.
#### `pointerFileFound`
You can control what happens if a Git LFS pointer file is found by setting this option to either `"error"` or `"warning"`.
## Contribute
Build and test:
```sh
npm ci
npm run make
```[`embedme`](https://github.com/zakhenry/embedme) is used for code examples in the readme.