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 🙏

© 2026 – Pkg Stats / Ryan Hefner

atomic-webpack-plugin

v0.0.3

Published

A webpack plugin for use with the intention to build the index file for components based on the Atomic Design methodology.

Readme

:warning: STILL IN DEVELOPMENT


npm node tests cover size

atomic-webpack-plugin

A webpack plugin for use with the intention to build the index file for components based on the Atomic Design methodology.

Why?

Originally started by the ARc template. Using the 'Dont worry' index file has some issues, esspecially if you are running in typescript. More info here

// https://github.com/diegohaz/arc/wiki/Atomic-Design#do-not-worry
const req = require.context(".", true, /\.\/[^/]+\/[^/]+\/index\.js$/);

req.keys().forEach((key) => {
  const componentName = key.replace(/^.+\/([^/]+)\/index\.js/, "$1");
  module.exports[componentName] = req(key).default;
});

Atomic Design should be a solution, not another problem. If you want to create a component and don't know where to put it (atoms, molecules, organisms etc.), do not worry, do not think too much, just put it anywhere. After you realize what it is, just move the component folder to the right place. Everything else should work. source

The solution is to leverage the building process that most projects already use. atomic-webpack-plugin wa born.

Getting Started

To begin, you'll need to install atomic-webpack-plugin:

npm install atomic-webpack-plugin--save-dev

or

yarn add -D atomic-webpack-plugin

Then add the plugin to your webpack config. For example:

webpack.config.js

const AtomicPlugin = require("atomic-webpack-plugin");

module.exports = {
  plugins: [
    new AtomicPlugin({
      base: "./app/components",
      regularExpression: /\.?\/.+\/index\.tsx$/,
    }),
  ],
};

Setup

You will need to add the aliases to get the intended module import style.

Example

import { Button } from "components";

tsconfig.json

{
  "compilerOptions": {
    "paths": {
      "components": ["./app/components"]
    }
  }
}

webpack.config.jj

const AtomicPlugin = require("atomic-webpack-plugin");

module.exports = {
  plugins: [
    new AtomicPlugin({
      base: "./app/components",
      regularExpression: /\.?\/.+\/index\.tsx$/,
    }),
  ],
  resolve: {
    modules: ["./app/components"],
    alias: {
      components: path.resolve(__dirname, "app/components"),
    },
  },
};

Folder structure

src/
  components/
    atoms/
      Button/
        index.tsx
        text.spec.ts
        index.stories.ts
    molecules/
    organisms/
    pages/
      LandingPage/
        index.tsx
        text.spec.ts
        index.stories.ts
    templates/
      layouts/
      containers/
      menus/
      transitions/

Options

| Prop | Default | Description | | --------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | | base (string) | ./src/components | The folder location of your components folder | | output (string) | index.ts | The filename that will be generated at base | | header (string) | // @generated\n// This file is automatically generated and should not be edited.\n\n | The test at the top of the output file | | regularExpression (regularExpression) | /\.?\/.+\/index\.tsx$/ | The expression used to find the files of the components. If you are using foldered components like Atom/Button/index.tsx then the default will work for you. |

License

MIT