Socket
Socket
Sign inDemoInstall

nextjs-image-loader-stub

Package Overview
Dependencies
2
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

nextjs-image-loader-stub

A webpack image loader library for creating Next.js image loader stubs.


Version published
Weekly downloads
12
increased by1100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

nextjs-image-loader-stub

A webpack image loader library for creating Next.js image loader stubs.

Install

$ npm install nextjs-image-loader-stub --save-dev

Usage

import image from './images/foobar.png';

export const Foobar = () => {
  return <img src={image.src} width={image.width} height={image.height} />;
};

Configure for storybook

// .storybook/main.js

module.exports = {
  webpackFinal: async (config) => {
    return {
      ...config,
      module: {
        ...config.module,
        rules: [
          ...config.module.rules,
          {
            test: /\.(bmp|png|jpe?g|gif|webp|avif)$/,
            use: 'nextjs-image-loader-stub',
            type: 'javascript/auto',
          }
        ]
      }
    };
  },
};

FAQs

Package last updated on 15 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc