• Stars
    star
    237
  • Rank 169,265 (Top 4 %)
  • Language
    JavaScript
  • License
    Mozilla Public Li...
  • Created almost 6 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A teensy, squeaky 🐤 clean Webpack CLI
webpack-nano

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)

More Repositories

1

webpack-manifest-plugin

webpack plugin for generating asset manifests
JavaScript
1,433
star
2

jsx-email

Build emails with a delightful DX
TypeScript
924
star
3

koa-webpack

Development and Hot Reload Middleware for Koa2
JavaScript
441
star
4

webpack-plugin-serve

A Development Server in a Webpack Plugin
JavaScript
337
star
5

gmail-classic

CSS for reverting Gmail to the Classic Theme
CSS
216
star
6

postcss-less

PostCSS Syntax for parsing LESS
JavaScript
123
star
7

webpack-plugin-ramdisk

🐏 A webpack plugin for blazing fast builds on a RAM disk / drive
JavaScript
118
star
8

Gmail-Notifier-Plus

Gmail Notifier Plus
C#
89
star
9

prettier-plugin-package

An opinionated package.json formatter plugin for Prettier
JavaScript
81
star
10

mocha-chrome

☕ Run Mocha tests using headless Google Chrome
JavaScript
72
star
11

apollo-log

A logging extension for the Apollo GraphQL Server
TypeScript
66
star
12

postcss-values-parser

A CSS property value parser for PostCSS
JavaScript
58
star
13

webpack-serve

A CLI for webpack-plugin-serve, providing a premier webpack development server
JavaScript
51
star
14

loglevelnext

A modern logging library for Node.js that provides log level mapping to the console
TypeScript
38
star
15

OctoGerrit

A modern, clean, and usable theme for Gerrit
CSS
29
star
16

koa-ws

Empower your koa.js application with realtime
JavaScript
26
star
17

nanoid-cli

A tiny cli wrapper for nanoid
JavaScript
24
star
18

LiberaManifesto

A Manifesto for Open Source Software and Free Services
HTML
20
star
19

webpack-log

A logger for the Webpack ecosystem
JavaScript
18
star
20

doiuse-email

Lint HTML and CSS for email support against the `Can I email?` database.
TypeScript
14
star
21

Snarf

Snarf is an NFS server implementation written in C# with .NET 4.5.
C#
13
star
22

Brew

Brew is an open source library of interface components for ASP.NET which utilitizes jQuery and jQuery UI.
JavaScript
10
star
23

github-notifications-classic

A CSS project that restores the classic Github Notifications appearance.
CSS
9
star
24

Shellscape.Common

A .NET Library I use in a lot of my projects. Written in C#
C#
7
star
25

harmonica

A module that allows use of Node.js --harmony flags, programmatically.
JavaScript
7
star
26

webpack-hot-client

A client for enabling, and interacting with, webpack Hot Module Replacement
JavaScript
7
star
27

bundler-serve

A Platform for Bundler Development Servers
JavaScript
6
star
28

fwv

A ⚡️ crazy fast streaming ⚡️ Fixed Width Value Parser
JavaScript
5
star
29

gulp-scan

A Gulp plugin to scan a file for a particular string or expression
JavaScript
5
star
30

piilist

A list of Personally Identifiable Information keys / words / phrases used for redaction or removal
JavaScript
3
star
31

thank-you

A place for me to thank the outstanding people who support my work
3
star
32

Lumen

Everything that Start should have been.
C#
3
star
33

dot

Tools for monorepos, serverless, and more
TypeScript
2
star
34

shellscape.github.io

The codebase for shellscape.org
HTML
2
star
35

Gcal-Notifier-Plus

A Google Calendar Notifier for Windows 7
C#
2
star
36

gulp-assist

Display helpful information for your Gulp tasks
JavaScript
2
star
37

babel-plugin-async-to-plain-generator

Transform async functions into non-wrapped ES2015 generators
JavaScript
2
star
38

npm-version-tree

Fetch a dependency version tree for a package
JavaScript
2
star
39

Nubs

Fancy Tabs for the Windows Desktop
C#
1
star
40

travis-target

A Node.js module to determine the file or directory targets of a Travis CI build.
JavaScript
1
star
41

gulp-mocha-chrome

☕ Run Mocha tests using Google Chrome via Gulp
JavaScript
1
star
42

prettier-tree

Prettier directory trees
1
star
43

Rumshot

1
star
44

eslint-config-shellscape

ESLint shareable config for my projects
JavaScript
1
star
45

gulp-version-conflicts

Check for and report on module version conflicts for a package
JavaScript
1
star