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-developer-kit

v1.0.0

Published

Super Light Dev Kit for Webpack Developers

Downloads

2

Readme

webpack Developer Kit

Super lightweight boilerplate tailored to help developers understand how to create custom loaders and plugins.

Requirements

  • Node 6.3 or higher (for native node --inspect)

Usage

Fork and clone this repo and then run npm install

NPM Scripts

There are two scripts that are setup already:

  • npm run dev

    • will run the same configuration instead with webpack-dev-server for live reload
  • npm run build

    • will simply execute a webpack build in the repo
  • npm run debug

    • will run the same build with node debugger.
    • paste provided link in Chrome (or Canary), and you will have the super incredible ChromeDevTools to step through your code for learning, exploration, and debugging.

Whats in the config?

You will notice two things that are setup already for you that should assist in learning to rapidly write custom plugins and loaders:

  • An inline webpack plugin already defined. You can use an anon. function inside of the plugins array which will then allow you to plugin to the compiler instance (which is this):
  plugins: [
    // This function is the `apply` function if you were to create an external plugin
    // Having it inline provides some nice conviences for debugging and development
    function() {
      var compiler = this;
      compiler.plugin("compilation", function(compilation) {
        compilation.plugin("after-optimize-modules", function(modules) {
          // debugger;
        });
        compilation.plugin("after-optimize-chunks", function(chunks) {
          // debugger;
        })
      });
    }
  ]
  • A custom-loader in the project root, and configuration for resolving it so you can use. Loaders by default automatically resolve from node_modules and therefore the resolveLoader property on the config allows you to have an alias'd resolve for that loader so you can work on it right in your project. (Much easier than creating a npm module, npm link and npm link module-name):
module.exports = loader;

function loader(source) {
  console.log(source);
  debugger; 
  return source;
}

Helpful resources:

Questions, issues, comments?

Sean, I have a great suggestion for this repo, or notice a bug

Submit an issue or a pull request for the feature. If I don't respond in a few days, tag me @TheLarkInn or tweet me at the same name (I'm terrible with email notifications).

Sean, I want to know how to do this, or that with a loader or plugin

Please submit an issue to the webpack core repository. Most times, if you are trying to write a custom loader or plugin, one of the contributors or @Sokra, or myself will be able to provide you with guidance. Plus, if it is an undocumented, or poorly documented feature, then we will tag it as documentation and move a copy of it over to our new docs page (Or even better if you find out you can submit a PR to our doc page.)

Recognition

I came up with this idea after forking blacksonics babel-treeshaking test repo. As I was debugging it, I found that "Hey, this would be pretty useful for people who want to write their own stuff". Thus you will see in initial git history, his mark on files like the readme.