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

@ramster/webpack-tools

v2.0.0

Published

Webpack build and dev tools, part of the ramster open-source software toolkit.

Readme

npm node pipeline Coverage Status npm npm @ramster/webpack-tools

Webpack build and dev tools, part of the ramster open-source software toolkit. This module provides a small toolkit for building and running bundles with webpack. It has both a javascript API and a CLI.

API

The javascript API contains 5 methods - build, buildFromFile, watch, watchFromFile and injectPluginsInConfig. All examples below use the following config file.

build

This method takes a webpack configuration object and generates a webpack bundle for it.

Example:

// main.js
const
	configData = require('./config'),
	{build} = require('@ramster/webpack-tools')

build(configData.webpackConfig).then(
	(res) => console.log('Build completed successfully with result:', res),
	(err) => console.error(err)
)

buildFromFile

This method takes a path to a file containing a webpack configuration object and executes webpack(config) for it, returning a promise.

The file should be in the format

{
	profileWebpackPlugins?: { [profileName: string]: Webpack.Plugin[] },
	webpackConfig: Webpack.Configuration
}

Example:

// main.js
const
	{buildFromFile} = require('@ramster/webpack-tools'),
	path = require('path')

buildFromFile(path.join(__dirname, 'webpackConfig.js'), 'development').then(
	(res) => console.log('Build completed successfully with result:', res),
	(err) => console.error(err)
)

watch

This method takes a webpack configuration object and starts a webpack devserver for it.

Example:

// main.js
const
	configData = require('./config'),
	{watch} = require('@ramster/webpack-tools')

watch(configData.webpackConfig, configData.devserverConfig).then(
	(res) => console.log('Build completed successfully with result:', res),
	(err) => console.error(err)
)

watchFromFile

This method takes a path to a file containing a webpack configuration object and starts a webpack devserver for it.

The file should be in the format

{
	devserverConfig: { hostName: string, port: number },
	profileWebpackPlugins?: { [profileName: string]: Webpack.Plugin[] },
	webpackConfig: Webpack.Configuration
}

Example:

// main.js
const
	{buildFromFile} = require('@ramster/webpack-tools'),
	path = require('path')

buildFromFile(path.join(__dirname, 'webpackConfig.js'), 'development').then(
	(res) => console.log('Build completed successfully with result:', res),
	(err) => console.error(err)
)

injectPluginsInConfig

Takes a webpack config and injects plugins into its "plugins" array. If the object doesn't have a "plugins" array, it will be created automatically.

Example:

// main.js
const
	configData = require('./config'),
	{build, injectPluginsInConfig} = require('@ramster/webpack-tools')

configData.webpackConfig = injectPluginsInConfig(configData.webpackConfig, configData.profileWebpackPlugins, 'development')
build(configData.webpackConfig).then(
	(res) => console.log('Build completed successfully with result:', res),
	(err) => console.error(err)
)

exampleConfigFile

// config.js
const
	BellOnBundlerErrorPlugin = require('bell-on-bundler-error-plugin'),
	path = require('path'),
	ProgressBarPlugin = require('progress-bar-webpack-plugin'),
	webpack = require('webpack')

module.exports = {
	devserverConfig: { hostName: '127.0.0.1', port: 9999 },
	profileWebpackPlugins: {
		development: [
			new BellOnBundlerErrorPlugin()
		]
	},
	webpackConfig: {
		devtool: 'source-map',
		entry: [
			path.join(__dirname, 'src/index.ts')
		],
		output: {
			path: path.join(__dirname, 'dist'),
			filename: '[name].js',
			chunkFilename: '[id].chunk.js',
			publicPath: '/dist/'
		},
		resolve: {
			extensions: ['.ts', '.js'],
			modules: ['node_modules']
		},
		module: {
			rules: [
				{
					test: /\.ts$/,
					include: path.join(__dirname, 'src'),
					exclude: [],
					use: ['awesome-typescript-loader']
				}
			]
		},
		stats: 'verbose',
		plugins: [
			new ProgressBarPlugin({
				format: '  build [:bar] (:percent) - (:elapsed seconds)',
				clear: false,
				complete: '#',
				summary: 'true'
			})
		]
	}
}

CLI

The CLI allows you to use the buildFromFile and watchFromFile methods using from the command line. Running ramster-webpack --help will display the full usage information that you can see below: Usage: ramster-webpack [options]        ramster-webpack -c config/webpack.js -p production        ramster-webpack --configFilePath=config/webpack.js --pluginProfileName=production Options:   -b, --build                                signals the script to build the bundles for the provided config files and exit   -w, --watch                              signals the script to build and watch the bundles for the provided config files by running a devserver   -c, --configFilePath                 required; specifies the config file to use for the run; if provided multiple times, multiple files will be built   -p, --pluginProfileName        optional; specifies the plugins profile for the config file to use for the run; if provided multiple times, each one will be matched to a single --configFilePath in the order provided   -h, --help                                 display this menu

Security issues

Please report any security issues privately at [email protected].