looker/webpack

Name: webpack

Owner: looker

Description: A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows to load parts for the application on demand. Through "loaders," modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.

Forked from: webpack/webpack

Created: 2017-09-26 16:12:49.0

Updated: 2017-09-26 19:20:34.0

Pushed: 2017-09-27 22:41:20.0

Homepage: https://webpack.js.org

Size: 8551

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

<img width="200" heigth="200" src="https://webpack.js.org/assets/icon-square-big.svg">



npm

node deps tests builds coverage licenses


<a href="https://npmjs.com/package/webpack">
    <img src="https://img.shields.io/npm/dm/webpack.svg">
</a>
<a href="https://opencollective.com/webpack#backer">
    <img src="https://opencollective.com/webpack/backers/badge.svg">
</a>
<a href="https://opencollective.com/webpack#sponsors">
    <img src="https://opencollective.com/webpack/sponsors/badge.svg">
</a>
<a href="https://gitter.im/webpack/webpack">
    <img src="https://badges.gitter.im/webpack/webpack.svg">
</a>

webpack

webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.

Install

Install with npm:

install --save-dev webpack

Install with yarn:

 add webpack --dev

Introduction

This README reflects Webpack v2.x and v3.x. The Webpack v1.x documentation can be found here.

webpack is a bundler for modules. The main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.

TL;DR

Get Started

Check out webpack's quick Get Started guide and the other guides.

Concepts

Plugins

webpack has a rich plugin interface. Most of the features within webpack itself use this plugin interface. This makes webpack very flexible.

|Name|Status|Description| |:–:|:—-:|:———-| |common-chunks-webpack-plugin|common-npm|Generates chunks of common modules shared between entry points and splits them into separate bundles (e.g vendor.bundle.js && app.bundle.js)| |extract-text-webpack-plugin|extract-npm|Extracts Text (CSS) from your bundles into a separate file (app.bundle.css)| |compression-webpack-plugin|compression-npm|Prepare compressed versions of assets to serve them with Content-Encoding| |i18n-webpack-plugin|i18n-npm|Adds i18n support to your bundles| |html-webpack-plugin|html-plugin-npm| Simplifies creation of HTML files (index.html) to serve your bundles|

Loaders

webpack enables use of loaders to preprocess files. This allows you to bundle any static resource way beyond JavaScript. You can easily write your own loaders using Node.js.

Loaders are activated by using loadername! prefixes in require() statements, or are automatically applied via regex from your webpack configuration.

Files

|Name|Status|Description| |:–:|:—-:|:———-| |raw-loader|raw-npm|Loads raw content of a file (utf-8)| |val-loader|val-npm|Executes code as module and consider exports as JS code| |url-loader|url-npm|Works like the file loader, but can return a Data Url if the file is smaller than a limit| |file-loader|file-npm|Emits the file into the output folder and returns the (relative) url|

JSON

|Name|Status|Description| |:–:|:—-:|:———-| ||json-npm|Loads a JSON file (included by default)| ||json5-npm|Loads and transpiles a JSON 5 file| ||cson-npm|Loads and transpiles a CSON file|

Transpiling

|Name|Status|Description| |:–:|:—-:|:———-| |<script>|script-npm|Executes a JavaScript file once in global context (like in script tag), requires are not parsed| ||babel-npm|Loads ES2015+ code and transpiles to ES5 using Babel| ||traceur-npm|Loads ES2015+ code and transpiles to ES5 using Traceur| ||type-npm|Loads TypeScript like JavaScript| ||coffee-npm|Loads CoffeeScript like JavaScript|

Templating

|Name|Status|Description| |:–:|:—-:|:———-| ||html-npm|Exports HTML as string, require references to static resources| ||pug-npm|Loads Pug templates and returns a function| ||jade-npm|Loads Jade templates and returns a function| ||md-npm|Compiles Markdown to HTML| ||posthtml-npm|Loads and transforms a HTML file using PostHTML| ||hbs-npm| Compiles Handlebars to HTML|

Styling

|Name|Status|Description| |:–:|:—-:|:———-| |<style>|style-npm|Add exports of a module as style to DOM| ||css-npm|Loads CSS file with resolved imports and returns CSS code| ||less-npm|Loads and compiles a LESS file| ||sass-npm|Loads and compiles a SASS/SCSS file| ||stylus-npm|Loads and compiles a Stylus file| ||postcss-npm|Loads and transforms a CSS/SSS file using PostCSS|

Linting & Testing

|Name|Status|Description| |:–:|:—-:|:———-| ||mocha-npm|Tests with mocha (Browser/NodeJS)| ||eslint-npm|PreLoader for linting code using ESLint| ||jshint-npm|PreLoader for linting code using JSHint|

Frameworks

|Name|Status|Description| |:–:|:—-:|:———-| ||vue-npm|Loads and compiles Vue Components| ||polymer-npm|Process HTML & CSS with preprocessor of choice and require() Web Components like first-class modules| ||angular-npm| Loads and compiles Angular 2 Components| ||riot-npm| Riot official webpack loader|

Performance

webpack uses async I/O and has multiple caching levels. This makes webpack fast and incredibly fast on incremental compilations.

Module Formats

webpack supports ES2015+, CommonJS and AMD modules out of the box. It performs clever static analysis on the AST of your code. It even has an evaluation engine to evaluate simple expressions. This allows you to support most existing libraries out of the box.

Code Splitting

webpack allows you to split your codebase into multiple chunks. Chunks are loaded asynchronously at runtime. This reduces the initial loading time.

Optimizations

webpack can do many optimizations to reduce the output size of your JavaScript by deduplicating frequently used modules, minifying, and giving you full control of what is loaded initially and what is loaded at runtime through code splitting. It can also make your code chunks cache friendly by using hashes.

Contributing

We want contributing to webpack to be fun, enjoyable, and educational for anyone, and everyone. We have a vibrant ecosystem that spans beyond this single repo. We welcome you to check out any of the repositories in our organization or webpack-contrib organization which houses all of our loaders and plugins.

Contributions go far beyond pull requests and commits. Although we love giving you the opportunity to put your stamp on webpack, we also are thrilled to receive a variety of other contributions including:

If you are worried or don't know where to start, you can always reach out to Sean Larkin (@TheLarkInn) on Twitter or simply submit an issue and a maintainer can help give you guidance!

We have also started a series on our Medium Publication called The Contributor's Guide to webpack. We welcome you to read it and post any questions or responses if you still need help.

Looking to speak about webpack? We'd love to review your talk abstract/CFP! You can email it to webpack [at] opencollective [dot] com and we can give pointers or tips!!!

Creating your own plugins and loaders

If you create a loader or plugin, we would <3 for you to open source it, and put it on npm. We follow the x-loader, x-webpack-plugin naming convention.

Support

We consider webpack to be a low-level tool used not only individually but also layered beneath other awesome tools. Because of it's flexibility, webpack isn't always the easiest entry-level solution, however we do believe it is the most powerful. That said, we're always looking for ways improve and simplify the tool without compromising functionality. If you have any ideas on ways to accomplish this, we're all ears!

If you're just getting started, take a look at our new docs and concepts page. This has a high level overview that is great for beginners!!

If you want to discuss something or just need help, here is our Gitter room where there are always individuals looking to help out!

If you are still having difficulty, we would love for you to post a question to StackOverflow with the webpack tag. It is much easier to answer questions that include your webpack.config.js and relevant files! So if you can provide them, we'd be extremely grateful (and more likely to help you find the answer!)

If you are twitter savvy you can tweet #webpack with your question and someone should be able to reach out and help also.

If you have discovered a ? or have a feature suggestion, feel free to create an issue on Github.

License

FOSSA Status

Core Team

<tr>
  <td align="center" valign="top">
    <img width="150" height="150" src="https://github.com/sokra.png?s=150">
    <br>
    <a href="https://github.com/sokra">Tobias Koppers</a>
    <p>Core</p>
    <br>
    <p>Founder of webpack</p>
  </td>
  <td align="center" valign="top">
    <img width="150" height="150" src="https://github.com/jhnns.png?s=150">
    <br>
    <a href="https://github.com/jhnns">Johannes Ewald</a>
    <p>Loaders &amp; Plugins</p>
    <br>
    <p>Early adopter of webpack</p>
  </td>
  <td align="center" width="20%" valign="top">
    <img width="150" height="150" src="https://github.com/TheLarkInn.png?s=150">
    <br>
    <a href="https://github.com/TheLarkInn">Sean T. Larkin</a>
    <p>Public Relations</p>
    <br>
    <p>Founder of the core team</p>
  </td>
  <td align="center" valign="top">
    <img width="150" height="150" src="https://github.com/bebraw.png?s=150">
    <br>
    <a href="https://github.com/bebraw">Juho Vepsäläinen</a>
    <p>Documentation</p>
    <br>
    <p>Author</p>
    <a href="https://leanpub.com/survivejs-webpack">
      <img height="15" src="https://cloud.githubusercontent.com/assets/1365881/20286923/93e325c0-aac9-11e6-964d-cabe218c584c.png">
    </a>
    <br>
  </td>
  <td align="center" valign="top">
    <img width="150" height="150" src="https://github.com/spacek33z.png?s=150">
    <br>
    <a href="https://github.com/spacek33z">Kees Kluskens</a>
    <p>Development</p>
    <br>
    <p>Sponsor<p>
    <a href="https://codeyellow.nl/">
      <img height="15px" src="https://cloud.githubusercontent.com/assets/1365881/20286583/ad62eb04-aac7-11e6-9c14-a0fef35b9b56.png">
    </a>
    <br>
  </td>
 </tr>

Sponsoring

Most of the core team members, webpack contributors and contributors in the ecosystem do this open source work in their free time. If you use webpack for a serious task, and you'd like us to invest more time on it, please donate. This project increases your income/productivity too. It makes development and applications faster and it reduces the required bandwidth.

This is how we use the donations:

Premium Partners

Other Backers and Sponsors

Before we started using OpenCollective, donations were made anonymously. Now that we have made the switch, we would like to acknowledge these sponsors (and the ones who continue to donate using OpenCollective). If we've missed someone, please send us a PR, and we'll add you to this list.

[Google Angular Team](https://angular.io/), [Architects.io](http://architects.io/), MoonMail MONEI

Gold Sponsors

Become a gold sponsor and get your logo on our README on Github with a link to your site.

Silver Sponsors

Become a sliver sponsor and get your logo on our README on Github with a link to your site.

Bronze Sponsors

Become a bronze sponsor and get your logo on our README on Github with a link to your site.

Backers

Become a backer and get your image on our README on Github with a link to your site.

Thanks to

(In chronological order)


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.