whatisgithub

What is webpack-sources?

gaearon/webpack-sources — explained in plain English

Analysis updated 2026-07-17 · repo last pushed 2016-12-08

3JavaScriptAudience · developerComplexity · 4/5DormantSetup · moderate

In one sentence

A toolkit for build tools like webpack to wrap, combine, and track source code alongside its source maps during bundling.

Mindmap

mindmap
  root((repo))
    What it does
      Wraps code fragments
      Tracks source maps
      Reports size and hash
    Tech stack
      JavaScript
      Source class design
    Use cases
      Build bundler tools
      Concatenate files
      Preserve debug info
    Audience
      Build tool developers
      Webpack contributors
    Source types
      RawSource
      OriginalSource
      SourceMapSource
      CachedSource

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Combine multiple JavaScript files into one bundle while preserving source map debug info.

USE CASE 2

Cache expensive source transformations so a build tool doesn't redo the same work.

USE CASE 3

Track whether a piece of code came from an original file or was generated during a build.

USE CASE 4

Add prefixes or replace sections of code while keeping accurate line-mapping for errors.

What is it built with?

JavaScript

How does it compare?

gaearon/webpack-sourcesamarjitjim/browserpilotandershaig/cssess
Stars333
LanguageJavaScriptJavaScriptJavaScript
Last pushed2016-12-082011-08-19
MaintenanceDormantDormant
Setup difficultymoderatemoderateeasy
Complexity4/53/51/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Intended for use inside build tool code, not a standalone CLI or app.

Copy-paste prompts

Prompt 1
Show me how to use ConcatSource to merge several JavaScript files while keeping their source maps.
Prompt 2
Explain how to write a custom Source subclass for a new type of build-time code transformation.
Prompt 3
Help me use CachedSource to avoid recomputing a source map on every build.
Prompt 4
Walk me through how webpack-sources helps a bundler point runtime errors back to original files.

Frequently asked questions

What is webpack-sources?

A toolkit for build tools like webpack to wrap, combine, and track source code alongside its source maps during bundling.

What language is webpack-sources written in?

Mainly JavaScript. The stack also includes JavaScript.

Is webpack-sources actively maintained?

Dormant — no commits in 2+ years (last push 2016-12-08).

How hard is webpack-sources to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is webpack-sources for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.