git-lfs-loader

1.0.0 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i git-lfs-loader

Weekly Downloads

4

Version

1.0.0

License

MIT

Unpacked Size

10.5 kB

Total Files

7

Last publish

Collaborators

  • alling