<commit_before>[![Travis Status][trav_img]][trav_site]

RequirePack
===========

[Webpack][webpack] + [RequireJS][requirejs] shared library interoperability!

Webpack and RequireJS both have facilities for sharing libraries across entry
points. Unfortunately, if loading **both** RequireJS and Webpack entry points
on the same page, the applications cannot natively use the **same** shared
library.

RequirePack bridges this gap by providing an interopability layer to allow a
Webpack-generated shared library to be consumaed by RequireJS entry points.

### Getting Started

```sh
$ npm install --save requirepack
```

### Shared Libraries Deep Dive

Going a little deeper, let's create a very simple example using AMD:

```js
// foo.js
define([], function () {
  return "I am foo!";
});

// lib.js
define(["./foo"], function () {});

// app1.js
define(["./foo"], function (foo) {
  console.log("app1", foo);
});

// app2.js
define(["./foo"], function (foo) {
  console.log("app2", foo);
});
```

We want to build our JS such that our bundles look like:

* `lib.js`: Contains `lib.js` and `foo.js` (the shared components).
* `app1.js`: Contains **only** `app1.js`
* `app2.js`: Contains **only** `app2.js`
<commit_msg>More introduction<commit_after>[![Travis Status][trav_img]][trav_site]

RequirePack
===========

[Webpack][webpack] + [RequireJS][requirejs] shared library interoperability!

Webpack and RequireJS both can consume AMD code straight up. Which means if you
are in a transitional / complex scenario where you want _some_ code to load
with Webpack and _other_ code to load with RequireJS from the same code base
you can!

And, Webpack and RequireJS both have facilities for sharing libraries across
entry points. Unfortunately, if loading both RequireJS and Webpack entry points
on the same page, the applications cannot natively use the **same** shared
library.

RequirePack bridges this gap by providing an interopability layer to allow a
Webpack-generated shared library to be consumaed by RequireJS entry points.

### Getting Started

Install:

```sh
$ npm install --save requirepack
```

Configure:

**TODO: DOCUMENT**

### Shared Libraries Deep Dive

Going a little deeper, let's create a very simple example using AMD:

```js
// foo.js
define([], function () {
  return "I am foo!";
});

// lib.js
define(["./foo"], function () {});

// app1.js
define(["./foo"], function (foo) {
  console.log("app1", foo);
});

// app2.js
define(["./foo"], function (foo) {
  console.log("app2", foo);
});
```

We want to build our JS such that our bundles look like:

* `lib.js`: Contains `lib.js` and `foo.js` (the shared components).
* `app1.js`: Contains **only** `app1.js`
* `app2.js`: Contains **only** `app2.js`

{'fraction_non_alphanumeric': 0.14353891336270191, 'fraction_numerical': 0.005873715124816446, 'mean_word_length': 4.595482546201232, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '435716', 'n_tokens_mistral': 869, 'n_tokens_neox': 830, 'n_words': 327}