git-lfs-loader
v1.0.0
Published
A Webpack loader to prevent accidentally importing Git LFS pointer files
Downloads
62
Readme
git-lfs-loader
A Webpack loader to prevent accidentally importing Git LFS pointer files.
Installation
npm install --save-dev git-lfs-loader
Usage
// webpack.config.js
module.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:
npm ci
npm run make
embedme
is used for code examples in the readme.