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

webpack-raw-bundler

v1.3.6

Published

A Webpack plugin to merge your files, unedited, into a single file.

Readme

A Webpack plugin to merge your files, unedited, into a single file.

Installation

npm install webpack-raw-bundler
var RawBundlerPlugin = require('webpack-raw-bundler');

Usage

When you don't have time to make the ordinary require statements, or when your libraries don't support modular exporting, you can use this to bundle them all together so that their globals are actually global.

In other words, from the old:

<script src="js/jquery.js"></script>
<script src="js/silly.js"></script>
<script>
	$(silly()); // Some function in silly.js's global scope
</script>

To the new:

<script src="js/bundle.js"></script>
<script>
	$(silly());
</script>

Installing to the config

Add the following plugin init statement to the same block as your other webpack plugins. Simple shows only the required options, while complete shows all the options.

Simple

module.exports = {
	plugins: [
		new RawBundlerPlugin({
			bundles: [ "vendor.js" ],
			"vendor.js": [ 'js/*.js' ]
		})
	]
}

Complete

module.exports = {
	plugins: [
		new RawBundlerPlugin({
			excludedFilenames: [/angulartics/],
			readEncoding: "utf-8",
			includeFilePathComments: false,
			allowDuplicatesInBundle: false,
			printProgress: false,
			fileEnding: "\n\n",
			commentTags: { Start: "/* ", End: " */" },
			bundles: [
				"vendor.js",
				"styles.css",
				"vendor.lib.js"
			],
			"vendor.js": [
				'js/*.js'
			],
			"vendor.lib.js": [{
				path: "../build/*.js",
				match: /vendor/
			}],
			"styles.css": [
				'css/bootstrap.css',
				'css/edits.css'
			]
		})
	]
}

Example Output

This generates two files with merged js and css content.

<!-- Simple -->
<script src="/vendor.js"></script>

<!-- Complete -->
<script src="/vendor.js"></script>
<script src="/vendor.lib.js"></script>
<link rel="stylesheet" href="/styles.css">

What Actually Happens

Say we have a bundle defined as follows:

"complete.js": [
	"a.js",
	"b.js"
]

And the following file contents:

// a.js
function a_simple() {
	console.log("a_simple called.");
}
var a_global = function () { a_simple(); };
// b.js
function b_simple() {
	console.log("b_simple called.");
}
var b_global = function () { a_global(); b_simple(); };

When webpack is called, the following complete.js will be made:

// complete.js

// a.js
function a_simple() {
	console.log("a_simple called.");
}
var a_global = function () { a_simple(); };

// b.js
function b_simple() {
	console.log("b_simple called.");
}
var b_global = function () { a_global(); b_simple(); };

Note: The filenames will not be appended to the tops of the files unless includeFilePathComments is falgged as true.

Options

bundles

(Required)

The output files to be made. These will be outputted to the same directory as set in module.exports.output.path of your webpack.config

[Files]

(Required)

Must have the same name as a member of bundles. The sub-array are the files to are be included in the bundle. The sub-array has the following format options:

"bundle_name.extension" : [
	"pathtype1.ext",
	"*.ext",
	{
		path: "pathtype2.ext"
		match: /good_file_standard/ /* Overpowerd by the exlusion variable */
	},
	{ path: "*.ext2" }
]

If a path is given a wildcard, it will add all files, including all subdirectories, with the appropiate file extension from that folder on.

excludedFilenames

default: []

An array of regexp expressions that if a dynamically found filename is matched, will not be included.

readEncoding

default: utf-8

The encoding nodejs reads in. Look up the documentation for more information.

includeFilePathComments

default: false

Puts the file path of the added file, surrounded by commentTags, before the bundled file contents.

Note: If reading from an invlaid encoding type, ie: settings are utf-8 but file is encoded in utf-8-BOM, then you may seem some non-rendering characters generated after this.

allowDuplicatesInBundle

default: false

Per individual file bundle, are identical file names allowed to be parsed?

printProgress

default: false

At compile time, prints the current files being bundled to the console. Note: Since this plugin runs with async helpers, this output tends to get messy with multiple bundles.

commentTags

default: { Start: "/* ", End: " */" }

The comment flags that the path to the current bundled file gets wrapped in. Only read if includeFilePathComments is true.

fileEnding

default: \n\n

The string that gets appended to the end of a bundled file. Two new lines are the default for easy reading.

TODO

Add per item support for not walking into subdirectories.
Add support for `useAsLoader`
Add support for file watching
Add per bundle support for exlcusions