Skip to content

gy-chen/webpack-image-placeholder-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webpack-image-placeholder-plugin

In JavaScript, import "<width in pixel>x<height in pixel>.png"

import placeholder from "200x300.png";

const element = document.createElement("img");
element.src = placeholder;
document.body.appendChild(element);

This will generate image with specific width and height automatically.

image

Install

  npm i --save-dev webpack-image-placeholder-plugin

Webpack configuration

const ImagePlaceholderPlugin = require("webpack-image-placeholder-plugin");

module.exports = {
  // ...
  plugins: [new ImagePlaceholderPlugin()]
};

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published