npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

webpack-gallery-plugin

v1.1.0

Published

A webpack plugin to provide a global object representing a detailed gallery tree view

Downloads

2

Readme

webpack-gallery-plugin

A webpack plugin to provide a global object representing a detailed gallery tree view.

Getting started

You first need to install webpack-gallery-plugin as a development dependency by running the following command:

npm install webpack-gallery-plugin --save-dev

You can then add the plugin to your webpack config. For example:

// webpack.config.js
const GalleryPlugin = require("webpack-gallery-plugin");

module.exports = {
  plugins: [
    new GalleryPlugin({
      source: '/assets',
    }),
  ],
};

Options

| Name | Type | Required | Default | Description | |----------------------|-------------|--------------|-------------|-----------------------------------------------------------------| | source | {String} | true | undefined | Path to the target folder, relative to the webpack config file. | | publicPath | {String} | false | "/" | Public path of the target folder. | | outputName | {String} | false | "default" | Output name, generated constant will be GALLERY_{outputName}. | | ignoreTypes | {Array} | false | undefined | Ignored file types. | | ignorePatterns | {Array} | false | [".*/"] | Ignore patterns. | | extensions | {Object} | false | undefined | Custom extensions map. | | verbose | {Boolean} | false | false | Verbose mode. |

Supported file types

| Image | Audio | Video | |-------------|-------------|-------------| | .bmp | .mp3 | .mp4 | | .cur | .ogg | .mov | | .dds | .m4a | .wmv | | .gif | .flac | .flv | | .ktx | .wav | .avi | | .png | .wma | .mkv | | .pnm | .aac | | | .pam | | | | .pbm | | | | .pfm | | | | .pgm | | | | .ppm | | | | .psd | | | | .svg | | | | .icon | | | | .jpg | | | | .jpeg | | | | .icns | | | | .tiff | | | | .webp | | |

Custom extensions map

You can extend the default supported file typed by adding your own extension: type entries into the option's extensions parameter.

exemple

// webpack.config.js
const GalleryPlugin = require("webpack-gallery-plugin");

module.exports = {
  plugins: [
    new GalleryPlugin({
      source: '/assets',
      extensions: {
        tiff: 'image',
        mp4: 'audio',
        txt: 'poetry',
      },
    }),
  ],
};

⚠️ If you respecify any of the default supported file types through the extensions parameter, the default type (image/audio/video) will be overwritten.

⚠️ types other than image, audio, video will be preserved but wont provide any relevant data but the path and an id.

Provide additional details

Each sniffed folder can provide a gallery.details.json file which is being parsed to find and concatenate any additional data of your choice (e.g. a simple description or its author). Simply specify the relative file path as a key and its details as an object value.