1.0.0 • Published 3 years ago

git-lfs-loader v1.0.0

Weekly downloads
48
License
MIT
Repository
github
Last release
3 years ago

git-lfs-loader

NPM Version Downloads Stats

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.