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-nano

v1.1.1

Published

A teensy, squeaky ๐Ÿค clean Webpack CLI

Downloads

47,438

Readme

webpack-nano tests cover size libera manifesto

A teensy, squeaky ๐Ÿค clean Webpack CLI

webpack-nano operates on the premise that all options for configuring a webpack build are set via a config file.

Install

Using npm:

npm install webpack-nano --save-dev

Requirements

webpack-nano is an evergreen module. ๐ŸŒฒ This module requires an Active LTS Node version (v10.0.0+).

Benefits

  • Holy bananas ๐ŸŒ it's itsy bitsy
  • Doesn't hit you over the head with an avalanche of flags and options
  • Allows any number of user-defined flags
  • It does one thing: tells webpack to start a build
  • ~90% smaller than webpack-cli and webpack-command

Usage

$ npx wp --help

  Usage
    $ wp [...options]

  Options
    --config          A path to a webpack config file
    --config.{name}   A path to a webpack config file, and the config name to run
    --json            Emit bundle information as JSON
    --help            Displays this message
    --silent          Instruct the CLI to produce no console output
    --version         Displays webpack-nano and webpack versions

  Examples
    $ wp
    $ wp --help
    $ wp --config webpack.config.js
    $ wp --config.serve webpack.config.js

Custom Flags

With webpack-cli users are limited as to the flags they can use on with the $ webpack binary, and are instructed to use the --env flag for custom data. Well that's just ๐ŸŒ๐ŸŒ. With webpack-nano users can specify an unlimited number of custom flags, without restriction.

Say you have a bundle which can be built to use different asset locations from cloud data sources, like Amazon S3 or Google Cloud Storage. And in this scenario you prefer to specify that location using a command-line flag. If you were using webpack-cli, you'd have to use the --env.source flag (or you'd get a big 'ol error) and use a function for your webpack.config.js export. Using webpack-nano:

$ wp --config webpack.config.js --source s3
// webpack.config.js
const argv = require('webpack-nano/argv');

const { source } = argv;

module.exports = {
  ...
}

โœจ Magic. The webpack-nano/argv export provides quick and easy access to parsed command-line arguments, allowing the user to define the CLI experience as they want to.

Special Configuration File Types

Webpack configuration files can be written using a variety of module loaders. e.g. Babel or TypeScript. webpack-nano allows users to use file types like webpack.config.babel.js, webpack.config.es6, webpack.config.mjs, and webpack.config.ts. Users are responsible for installing a compatible module loader when using these special file types. The table below represents the supported file types and their compatible loaders:

| Extension | Compatible Loaders | | ------------| ------------------ | | .babel.js | @babel/register, babel-register, babel-core/register, babel/register | | .babel.ts | @babel/register | | .es6 | @babel/register | | .mjs | @babel/register | | .ts | ts-node/register, typescript-node/register, typescript-register, typescript-require |

Build Stats

This project attempts not to make assumptions about how a build should behave, and that includes webpack stats. By default, webpack-nano will apply two stats options: colors (based on supports-color and exclude: ['node_modules']). These can be quickly overridden by including these key/values in your stats configuration.

Meta

CONTRIBUTING

LICENSE (Mozilla Public License)