Izmjenjena struktura, dodan backand

This commit is contained in:
GotPPay
2017-10-16 11:19:46 +02:00
parent 1ec88afacb
commit 048e32c4aa
37153 changed files with 2975854 additions and 1 deletions

20
web/node_modules/webpack/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,20 @@
Copyright JS Foundation and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

523
web/node_modules/webpack/README.md generated vendored Normal file
View File

@@ -0,0 +1,523 @@
[![npm][npm]][npm-url]
[![node][node]][node-url]
[![deps][deps]][deps-url]
[![tests][tests]][tests-url]
[![builds][builds]][builds-url]
[![coverage][cover]][cover-url]
[![licenses][licenses]][licenses-url]
<div align="center">
<a href="https://github.com/webpack/webpack">
<img width="200" heigth="200" src="https://webpack.js.org/assets/icon-square-big.svg">
</a>
<br>
<br>
<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>
<h1>webpack</h1>
<p>
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.
<p>
</div>
<h2 align="center">Install</h2>
```bash
npm install --save-dev webpack
```
<h2 align="center">Introduction</h2>
> The README reflects webpack v2.x, webpack v1.x [documentation can be found here](https://webpack.github.io/docs/?utm_source=github&utm_medium=readme&utm_campaign=top).
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**
* Bundles [ES Modules](http://www.2ality.com/2014/09/es6-modules-final.html), [CommonJS](http://wiki.commonjs.org/) and [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules (even combined).
* Can create a single bundle or multiple chunks that are asynchronously loaded at runtime (to reduce initial loading time).
* Dependencies are resolved during compilation, reducing the runtime size.
* Loaders can preprocess files while compiling, e.g. TypeScript to JavaScript, Handlebars strings to compiled functions, images to Base64, etc.
* Highly modular plugin system to do whatever else your application requires.
### Get Started
Check out webpack's quick [**Get Started**](https://webpack.js.org/get-started/) guide and the [other guides](https://webpack.js.org/guides/).
<h2 align="center">Concepts</h2>
### [Plugins](https://webpack.js.org/plugins/)
webpack has a [rich plugin
interface](https://webpack.js.org/plugins/). Most of the features
within webpack itself use this plugin interface. This makes webpack very
**flexible**.
|Name|Status|Description|
|:--:|:----:|:----------|
|[common-chunks-webpack-plugin][common]|![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]|![extract-npm]|Extracts Text (CSS) from your bundles into a separate file (app.bundle.css)|
|[component-webpack-plugin][component]|![component-npm]|Use components with webpack|
|[compression-webpack-plugin][compression]|![compression-npm]|Prepare compressed versions of assets to serve them with Content-Encoding|
|[i18n-webpack-plugin][i18n]|![i18n-npm]|Adds i18n support to your bundles|
|[html-webpack-plugin][html-plugin]|![html-plugin-npm]| Simplifies creation of HTML files (`index.html`) to serve your bundles|
[common]: https://github.com/webpack/webpack/blob/master/lib/optimize/CommonsChunkPlugin.js
[common-npm]: https://img.shields.io/npm/v/webpack.svg
[extract]: https://github.com/webpack/extract-text-webpack-plugin
[extract-npm]: https://img.shields.io/npm/v/extract-text-webpack-plugin.svg
[component]: https://github.com/webpack/component-webpack-plugin
[component-npm]: https://img.shields.io/npm/v/component-webpack-plugin.svg
[compression]: https://github.com/webpack/compression-webpack-plugin
[compression-npm]: https://img.shields.io/npm/v/compression-webpack-plugin.svg
[i18n]: https://github.com/webpack/i18n-webpack-plugin
[i18n-npm]: https://img.shields.io/npm/v/i18n-webpack-plugin.svg
[html-plugin]: https://github.com/ampedandwired/html-webpack-plugin
[html-plugin-npm]: https://img.shields.io/npm/v/html-webpack-plugin.svg
### [Loaders](https://webpack.js.org/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](https://webpack.js.org/api/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]|![raw-npm]|Loads raw content of a file (utf-8)|
|[val-loader][val]|![val-npm]|Executes code as module and consider exports as JS code|
|[url-loader][url]|![url-npm]|Works like the file loader, but can return a Data Url if the file is smaller than a limit|
|[file-loader][file]|![file-npm]|Emits the file into the output folder and returns the (relative) url|
[raw]: https://github.com/webpack/raw-loader
[raw-npm]: https://img.shields.io/npm/v/raw-loader.svg
[val]: https://github.com/webpack/val-loader
[val-npm]: https://img.shields.io/npm/v/val-loader.svg
[url]: https://github.com/webpack/url-loader
[url-npm]: https://img.shields.io/npm/v/url-loader.svg
[file]: https://github.com/webpack/file-loader
[file-npm]: https://img.shields.io/npm/v/file-loader.svg
#### JSON
|Name|Status|Description|
|:--:|:----:|:----------|
|<a href="https://github.com/webpack/json-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/json.svg"></a>|![json-npm]|Loads a JSON file (included by default)|
|<a href="https://github.com/webpack/json5-loader"><img width="48" height="48" src="https://cdn.rawgit.com/json5/json5-logo/master/json5-logo.svg"></a>|![json5-npm]|Loads and transpiles a JSON 5 file|
|<a href="https://github.com/awnist/cson-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/coffeescript.svg"></a>|![cson-npm]|Loads and transpiles a CSON file|
[json-npm]: https://img.shields.io/npm/v/json-loader.svg
[json5-npm]: https://img.shields.io/npm/v/json5-loader.svg
[cson-npm]: https://img.shields.io/npm/v/cson-loader.svg
#### Transpiling
|Name|Status|Description|
|:--:|:----:|:----------|
|<a href="https://github.com/webpack/script-loader">`<script>`</a>|![script-npm]|Executes a JavaScript file once in global context (like in script tag), requires are not parsed|
|<a href="https://github.com/babel/babel-loader"><img width="48" height="48" title="babel-loader" src="https://worldvectorlogo.com/logos/babel-10.svg"></a>|![babel-npm]|Loads ES2015+ code and transpiles to ES5 using <a href="https://github.com/babel/babel">Babel</a>|
|<a href="https://github.com/jupl/traceur-loader"><img width="48" height="48" src="https://google.github.com/traceur-compiler/logo/tc.svg"></a>|![traceur-npm]|Loads ES2015+ code and transpiles to ES5 using [Traceur](https://github.com/google/traceur-compiler)|
|<a href="https://github.com/TypeStrong/ts-loader"><img width="48" height="48" src="https://cdn.rawgit.com/Microsoft/TypeScript/master/doc/logo.svg"></a>|![type-npm]|Loads TypeScript like JavaScript|
|<a href="https://github.com/webpack/coffee-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/coffeescript.svg"></a>|![coffee-npm]|Loads CoffeeScript like JavaScript|
[script-npm]: https://img.shields.io/npm/v/script-loader.svg
[babel-npm]: https://img.shields.io/npm/v/babel-loader.svg
[traceur-npm]: https://img.shields.io/npm/v/traceur-loader.svg
[coffee-npm]: https://img.shields.io/npm/v/coffee-loader.svg
[type-npm]: https://img.shields.io/npm/v/ts-loader.svg
#### Templating
|Name|Status|Description|
|:--:|:----:|:----------|
|<a href="https://github.com/webpack/html-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/html5.svg"></a>|![html-npm]|Exports HTML as string, require references to static resources|
|<a href="https://github.com/pugjs/pug-loader"><img width="48" height="48" src="https://cdn.rawgit.com/pugjs/pug-logo/master/SVG/pug-final-logo-_-colour-128.svg"></a>|![pug-npm]|Loads Pug templates and returns a function|
|<a href="https://github.com/webpack/jade-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/jade-3.svg"></a>|![jade-npm]|Loads Jade templates and returns a function|
|<a href="https://github.com/peerigon/markdown-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/markdown.svg"></a>|![md-npm]|Compiles Markdown to HTML|
|<a href="https://github.com/posthtml/posthtml-loader"><img width="48" height="48" src="http://posthtml.github.io/posthtml/logo.svg"></a>|![posthtml-npm]|Loads and transforms a HTML file using [PostHTML](https://github.com/posthtml/posthtml)|
|<a href="https://github.com/altano/handlebars-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/handlebars-1.svg"></a>|![hbs-npm]| Compiles Handlebars to HTML|
[html-npm]: https://img.shields.io/npm/v/html-loader.svg
[pug-npm]: https://img.shields.io/npm/v/pug-loader.svg
[jade-npm]: https://img.shields.io/npm/v/jade-loader.svg
[md-npm]: https://img.shields.io/npm/v/markdown-loader.svg
[posthtml-npm]: https://img.shields.io/npm/v/posthtml-loader.svg
[hbs-npm]: https://img.shields.io/npm/v/handlebars-loader.svg
#### Styling
|Name|Status|Description|
|:--:|:----:|:----------|
|<a href="https://github.com/webpack/style-loader">`<style>`|![style-npm]|Add exports of a module as style to DOM|
|<a href="https://github.com/webpack/css-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/css-3.svg"></a>|![css-npm]|Loads CSS file with resolved imports and returns CSS code|
|<a href="https://github.com/webpack/less-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/less-63.svg"></a>|![less-npm]|Loads and compiles a LESS file|
|<a href="https://github.com/jtangelder/sass-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/sass-1.svg"></a>|![sass-npm]|Loads and compiles a SASS/SCSS file|
|<a href="https://github.com/shama/stylus-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/stylus.svg"></a>|![stylus-npm]|Loads and compiles a Stylus file|
|<a href="https://github.com/postcss/postcss-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/postcss.svg"></a>|![postcss-npm]|Loads and transforms a CSS/SSS file using [PostCSS](http://postcss.org)|
[style-npm]: https://img.shields.io/npm/v/style-loader.svg
[css-npm]: https://img.shields.io/npm/v/css-loader.svg
[less-npm]: https://img.shields.io/npm/v/less-loader.svg
[sass-npm]: https://img.shields.io/npm/v/sass-loader.svg
[stylus-npm]: https://img.shields.io/npm/v/stylus-loader.svg
[postcss-npm]: https://img.shields.io/npm/v/postcss-loader.svg
#### Linting && Testing
|Name|Status|Description|
|:--:|:----:|:----------|
|<a href="https://github.com/webpack/mocha-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/mocha.svg"></a>|![mocha-npm]|Tests with mocha (Browser/NodeJS)|
|<a href="https://github.com/MoOx/eslint-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/eslint.svg"></a>|![eslint-npm]|PreLoader for linting code using ESLint|
|<a href="https://github.com/webpack/jslint-loader"><img width="48" height="48" src="http://jshint.com/res/jshint-dark.png"></a>|![jshint-npm]|PreLoader for linting code using JSHint|
|<a href="https://github.com/unindented/jscs-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/jscs.svg"></a>|![jscs-npm]|PreLoader for code style checking using JSCS|
[mocha-npm]: https://img.shields.io/npm/v/mocha-loader.svg
[eslint-npm]: https://img.shields.io/npm/v/eslint-loader.svg
[jshint-npm]: https://img.shields.io/npm/v/jslint-loader.svg
[jscs-npm]: https://img.shields.io/npm/v/jscs-loader.svg
#### Frameworks
|Name|Status|Description|
|:--:|:----:|:----------|
|<a href="https://github.com/vuejs/vue-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/vue-9.svg"></a>|![vue-npm]|Loads and compiles Vue Components|
|<a href="https://github.com/JonDum/polymer-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/polymer.svg"></a>|![polymer-npm]|Process HTML & CSS with preprocessor of choice and `require()` Web Components like first-class modules|
|<a href="https://github.com/TheLarkInn/angular2-template-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/angular-icon-1.svg"></a>|![angular-npm]| Loads and compiles Angular 2 Components|
|<a href="https://github.com/riot/tag-loader"><img width="48" height="48" src="https://worldvectorlogo.com/logos/riot.svg"></a>|![riot-npm]| Riot official webpack loader|
[vue-npm]: https://img.shields.io/npm/v/vue-loader.svg
[polymer-npm]: https://img.shields.io/npm/v/polymer-loader.svg
[angular-npm]: https://img.shields.io/npm/v/angular2-template-loader.svg
[riot-npm]: https://img.shields.io/npm/v/riot-tag-loader.svg
### 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](https://webpack.js.org/guides/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](https://webpack.js.org/guides/production-build/)
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.
<h2 align="center">Contributing</h2>
Most of the time, if webpack is not working correctly for you it is a simple configuration issue.
If you are still having difficulty after looking over your configuration carefully, please post
a question to [StackOverflow with the webpack tag](https://stackoverflow.com/tags/webpack). Questions
that include your webpack.config.js and relevant files are more likely to receive responses.
If you have discovered a bug or have a feature suggestion, feel free to create an issue on Github.
If you create a loader or plugin, please consider open sourcing it, putting it
on npm and following the `x-loader`, `x-webpack-plugin` convention.
You are also welcome to correct any spelling mistakes or any language issues.
If you want to discuss something or just need help, [here is our Gitter room](https://gitter.im/webpack/webpack).
### License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fwebpack%2Fwebpack.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fwebpack%2Fwebpack?ref=badge_large)
<h2 align="center">Core Team</h2>
<table>
<tbody>
<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>
</tbody>
</table>
<h2 align="center">Sponsoring</h2>
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:
* Allow the core team to work on webpack
* Thank contributors if they invested a large amount of time in contributing
* Support projects in the ecosystem that are of great value for users
* Support projects that are voted most (work in progress)
* Infrastructure cost
* Fees for money handling
<h2 align="center">Premium Partners</h2>
<a href="https://www.ag-grid.com/?utm_source=webpack&utm_medium=banner&utm_campaign=sponsorship" target="_blank"><img align="center" src="https://raw.githubusercontent.com/webpack/media/2b399d58/horiz-banner-ad-ag-grid.png">
</a>
<h2 align="center">Other Backers and Sponsors</h2>
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/),
<a href="https://moonmail.io" target="_blank" title="Email Marketing Software"><img
src="https://static.moonmail.io/moonmail-logo.svg" height="30" alt="MoonMail"></a>
<a href="https://monei.net" target="_blank" title="Best payment gateway rates"><img
src="https://static.monei.net/monei-logo.svg" height="30" alt="MONEI"></a>
<h2 align="center">Sponsors</h2>
[Become a sponsor](https://opencollective.com/webpack#sponsor) and get your logo on our README on Github with a link to your site.
<a href="https://opencollective.com/webpack/sponsor/0/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/0/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/1/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/1/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/2/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/2/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/3/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/3/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/4/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/4/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/5/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/5/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/6/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/6/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/7/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/7/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/8/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/8/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/9/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/9/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/10/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/10/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/11/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/11/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/12/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/12/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/13/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/13/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/14/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/14/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/15/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/15/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/16/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/16/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/17/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/17/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/18/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/18/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/19/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/19/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/20/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/20/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/21/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/21/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/22/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/22/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/23/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/23/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/24/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/24/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/25/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/25/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/26/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/26/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/27/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/27/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/28/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/28/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/sponsor/29/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/sponsor/29/avatar.svg?requireActive=false"></a>
<h2 align="center">Backers</h2>
[Become a backer](https://opencollective.com/webpack#backer) and get your image on our README on Github with a link to your site.
<a href="https://opencollective.com/webpack/backer/0/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/0/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/1/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/1/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/2/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/2/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/3/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/3/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/4/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/4/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/5/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/5/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/6/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/6/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/7/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/7/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/8/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/8/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/9/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/9/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/10/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/10/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/11/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/11/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/12/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/12/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/13/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/13/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/14/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/14/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/15/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/15/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/16/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/16/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/17/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/17/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/18/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/18/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/19/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/19/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/20/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/20/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/21/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/21/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/22/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/22/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/23/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/23/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/24/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/24/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/25/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/25/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/26/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/26/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/27/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/27/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/28/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/28/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/29/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/29/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/30/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/30/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/31/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/31/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/32/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/32/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/33/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/33/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/34/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/34/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/35/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/35/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/36/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/36/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/37/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/37/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/38/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/38/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/39/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/39/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/40/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/40/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/41/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/41/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/42/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/42/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/43/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/43/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/44/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/44/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/45/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/45/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/46/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/46/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/47/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/47/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/48/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/48/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/49/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/49/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/50/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/50/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/51/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/51/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/52/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/52/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/53/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/53/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/54/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/54/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/55/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/55/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/56/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/56/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/57/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/57/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/58/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/58/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/59/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/59/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/60/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/60/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/61/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/61/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/62/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/62/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/63/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/63/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/64/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/64/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/65/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/65/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/66/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/66/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/67/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/67/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/68/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/68/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/69/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/69/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/70/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/70/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/71/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/71/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/72/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/72/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/73/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/73/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/74/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/74/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/75/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/75/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/76/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/76/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/77/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/77/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/78/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/78/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/79/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/79/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/80/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/80/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/81/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/81/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/82/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/82/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/83/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/83/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/84/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/84/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/85/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/85/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/86/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/86/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/87/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/87/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/88/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/88/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/89/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/89/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/90/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/90/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/91/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/91/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/92/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/92/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/93/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/93/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/94/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/94/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/95/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/95/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/96/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/96/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/97/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/97/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/98/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/98/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/99/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/99/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/webpack/backer/100/website?requireActive=false" target="_blank"><img src="https://opencollective.com/webpack/backer/100/avatar.svg?requireActive=false"></a>
<h2 align="center">Thanks to</h2>
<p align="center">(In chronological order)</p>
* @google for [Google Web Toolkit (GWT)](https://code.google.com/archive/p/google-web-toolkit), which aims to compile Java to JavaScript. It features a similar [Code Splitting](http://www.gwtproject.org/doc/latest/DevGuideCodeSplitting.html) as webpack.
* @medikoo for [modules-webmake](https://github.com/medikoo/modules-webmake), which is a similar project. webpack was born because I wanted Code Splitting for modules-webmake. Interestingly the [Code Splitting issue is still open](https://github.com/medikoo/modules-webmake/issues/7) (thanks also to @Phoscur for the discussion).
* @substack for [browserify](http://browserify.org/), which is a similar project and source for many ideas.
* @jrburke for [require.js](http://requirejs.org/), which is a similar project and source for many ideas.
* @defunctzombie for the [browser-field spec](https://gist.github.com/defunctzombie/4339901), which makes modules available for node.js, browserify and webpack.
* Every early webpack user, which contributed to webpack by writing issues or PRs. You influenced the direction...
* @shama, @jhnns and @sokra for maintaining this project
* Everyone who has written a loader for webpack. You are the ecosystem...
* Everyone I forgot to mention here, but also influenced webpack.
[npm]: https://img.shields.io/npm/v/webpack.svg
[npm-url]: https://npmjs.com/package/webpack
[node]: https://img.shields.io/node/v/webpack.svg
[node-url]: https://nodejs.org
[deps]: https://img.shields.io/david/webpack/webpack.svg
[deps-url]: https://david-dm.org/webpack/webpack
[tests]: https://img.shields.io/travis/webpack/webpack/master.svg
[tests-url]: https://travis-ci.org/webpack/webpack
[builds-url]: https://ci.appveyor.com/project/sokra/webpack/branch/master
[builds]: https://ci.appveyor.com/api/projects/status/github/webpack/webpack?svg=true
[licenses-url]: https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fwebpack%2Fwebpack?ref=badge_shield
[licenses]: https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fwebpack%2Fwebpack.svg?type=shield
[cover]: https://img.shields.io/coveralls/webpack/webpack.svg
[cover-url]: https://coveralls.io/r/webpack/webpack/

47
web/node_modules/webpack/bin/config-optimist.js generated vendored Normal file
View File

@@ -0,0 +1,47 @@
module.exports = function(optimist) {
optimist
.boolean("help").alias("help", "h").alias("help", "?").describe("help")
.string("config").describe("config", "Path to the config file")
.string("env").describe("env", "Environment passed to the config, when it is a function")
.string("context").describe("context", "The root directory for resolving entry point and stats")
.string("entry").describe("entry", "The entry point")
.string("module-bind").describe("module-bind", "Bind an extension to a loader")
.string("module-bind-post").describe("module-bind-post")
.string("module-bind-pre").describe("module-bind-pre")
.string("output-path").describe("output-path", "The output path for compilation assets")
.string("output-filename").describe("output-filename", "The output filename of the bundle")
.string("output-chunk-filename").describe("output-chunk-filename", "The output filename for additional chunks")
.string("output-source-map-filename").describe("output-source-map-filename", "The output filename for the SourceMap")
.string("output-public-path").describe("output-public-path", "The public path for the assets")
.string("output-jsonp-function").describe("output-jsonp-function", "The name of the jsonp function used for chunk loading")
.boolean("output-pathinfo").describe("output-pathinfo", "Include a comment with the request for every dependency")
.string("output-library").describe("output-library", "Expose the exports of the entry point as library")
.string("output-library-target").describe("output-library-target", "The type for exposing the exports of the entry point as library")
.string("records-input-path").describe("records-input-path", "Path to the records file (reading)")
.string("records-output-path").describe("records-output-path", "Path to the records file (writing)")
.string("records-path").describe("records-path", "Path to the records file")
.string("define").describe("define", "Define any free var in the bundle")
.string("target").describe("target", "The targeted execution environment")
.boolean("cache").describe("cache", "Enable in memory caching").default("cache", true)
.boolean("watch").alias("watch", "w").describe("watch", "Watch the filesystem for changes")
.boolean("watch-stdin").alias("watch-stdin", "stdin").describe("Exit the process when stdin is closed")
.describe("watch-aggregate-timeout", "Timeout for gathering changes while watching")
.describe("watch-poll", "The polling interval for watching (also enable polling)")
.boolean("hot").describe("hot", "Enables Hot Module Replacement")
.boolean("debug").describe("debug", "Switch loaders to debug mode")
.string("devtool").describe("devtool", "Enable devtool for better debugging experience")
.boolean("progress").describe("progress", "Print compilation progress in percentage")
.string("resolve-alias").describe("resolve-alias", "Setup a module alias for resolving")
.string("resolve-extensions").describe("resolve-extensions", "Setup extensions that should be used to resolve modules")
.string("resolve-loader-alias").describe("resolve-loader-alias", "Setup a loader alias for resolving")
.describe("optimize-max-chunks", "Try to keep the chunk count below a limit")
.describe("optimize-min-chunk-size", "Try to keep the chunk size above a limit")
.boolean("optimize-minimize").describe("optimize-minimize", "Minimize javascript and switches loaders to minimizing")
.string("prefetch").describe("prefetch", "Prefetch this request")
.string("provide").describe("provide", "Provide these modules as free vars in all modules")
.string("plugin").describe("plugin", "Load this plugin")
.boolean("bail").describe("bail", "Abort the compilation on first error")
.boolean("profile").describe("profile", "Profile the compilation and include information in stats")
.boolean("d").describe("d", "shortcut for --debug --devtool eval-check-module-source-map --output-pathinfo")
.boolean("p").describe("p", "shortcut for --optimize-minimize --define process.env.NODE_ENV=\"production\"");
};

266
web/node_modules/webpack/bin/config-yargs.js generated vendored Normal file
View File

@@ -0,0 +1,266 @@
var CONFIG_GROUP = "Config options:";
var BASIC_GROUP = "Basic options:";
var MODULE_GROUP = "Module options:";
var OUTPUT_GROUP = "Output options:";
var ADVANCED_GROUP = "Advanced options:";
var RESOLVE_GROUP = "Resolving options:";
var OPTIMIZE_GROUP = "Optimizing options:";
module.exports = function(yargs) {
yargs
.help("help")
.alias("help", "h", "?")
.version()
.alias("version", "v")
.options({
"config": {
type: "string",
describe: "Path to the config file",
group: CONFIG_GROUP,
defaultDescription: "webpack.config.js or webpackfile.js",
requiresArg: true
},
"env": {
describe: "Environment passed to the config, when it is a function",
group: CONFIG_GROUP
},
"context": {
type: "string",
describe: "The root directory for resolving entry point and stats",
group: BASIC_GROUP,
defaultDescription: "The current directory",
requiresArg: true
},
"entry": {
type: "string",
describe: "The entry point",
group: BASIC_GROUP,
requiresArg: true
},
"module-bind": {
type: "string",
describe: "Bind an extension to a loader",
group: MODULE_GROUP,
requiresArg: true
},
"module-bind-post": {
type: "string",
describe: "",
group: MODULE_GROUP,
requiresArg: true
},
"module-bind-pre": {
type: "string",
describe: "",
group: MODULE_GROUP,
requiresArg: true
},
"output-path": {
type: "string",
describe: "The output path for compilation assets",
group: OUTPUT_GROUP,
defaultDescription: "The current directory",
requiresArg: true
},
"output-filename": {
type: "string",
describe: "The output filename of the bundle",
group: OUTPUT_GROUP,
defaultDescription: "[name].js",
requiresArg: true
},
"output-chunk-filename": {
type: "string",
describe: "The output filename for additional chunks",
group: OUTPUT_GROUP,
defaultDescription: "filename with [id] instead of [name] or [id] prefixed",
requiresArg: true
},
"output-source-map-filename": {
type: "string",
describe: "The output filename for the SourceMap",
group: OUTPUT_GROUP,
requiresArg: true
},
"output-public-path": {
type: "string",
describe: "The public path for the assets",
group: OUTPUT_GROUP,
requiresArg: true
},
"output-jsonp-function": {
type: "string",
describe: "The name of the jsonp function used for chunk loading",
group: OUTPUT_GROUP,
requiresArg: true
},
"output-pathinfo": {
type: "boolean",
describe: "Include a comment with the request for every dependency (require, import, etc.)",
group: OUTPUT_GROUP
},
"output-library": {
type: "string",
describe: "Expose the exports of the entry point as library",
group: OUTPUT_GROUP,
requiresArg: true
},
"output-library-target": {
type: "string",
describe: "The type for exposing the exports of the entry point as library",
group: OUTPUT_GROUP,
requiresArg: true
},
"records-input-path": {
type: "string",
describe: "Path to the records file (reading)",
group: ADVANCED_GROUP,
requiresArg: true
},
"records-output-path": {
type: "string",
describe: "Path to the records file (writing)",
group: ADVANCED_GROUP,
requiresArg: true
},
"records-path": {
type: "string",
describe: "Path to the records file",
group: ADVANCED_GROUP,
requiresArg: true
},
"define": {
type: "string",
describe: "Define any free var in the bundle",
group: ADVANCED_GROUP,
requiresArg: true
},
"target": {
type: "string",
describe: "The targeted execution environment",
group: ADVANCED_GROUP,
requiresArg: true
},
"cache": {
type: "boolean",
describe: "Enable in memory caching",
default: null,
group: ADVANCED_GROUP,
defaultDescription: "It's enabled by default when watching"
},
"watch": {
type: "boolean",
alias: "w",
describe: "Watch the filesystem for changes",
group: BASIC_GROUP
},
"watch-stdin": {
type: "boolean",
alias: "stdin",
describe: "Exit the process when stdin is closed",
group: ADVANCED_GROUP
},
"watch-aggregate-timeout": {
describe: "Timeout for gathering changes while watching",
group: ADVANCED_GROUP,
requiresArg: true
},
"watch-poll": {
type: "boolean",
describe: "The polling interval for watching (also enable polling)",
group: ADVANCED_GROUP
},
"hot": {
type: "boolean",
describe: "Enables Hot Module Replacement",
group: ADVANCED_GROUP
},
"debug": {
type: "boolean",
describe: "Switch loaders to debug mode",
group: BASIC_GROUP
},
"devtool": {
type: "string",
describe: "Enable devtool for better debugging experience (Example: --devtool eval-cheap-module-source-map)",
group: BASIC_GROUP,
requiresArg: true
},
"resolve-alias": {
type: "string",
describe: "Setup a module alias for resolving (Example: jquery-plugin=jquery.plugin)",
group: RESOLVE_GROUP,
requiresArg: true
},
"resolve-extensions": {
"type": "array",
describe: "Setup extensions that should be used to resolve modules (Example: --resolve-extensions .es6 .js)",
group: RESOLVE_GROUP,
requiresArg: true
},
"resolve-loader-alias": {
type: "string",
describe: "Setup a loader alias for resolving",
group: RESOLVE_GROUP,
requiresArg: true
},
"optimize-max-chunks": {
describe: "Try to keep the chunk count below a limit",
group: OPTIMIZE_GROUP,
requiresArg: true
},
"optimize-min-chunk-size": {
describe: "Try to keep the chunk size above a limit",
group: OPTIMIZE_GROUP,
requiresArg: true
},
"optimize-minimize": {
type: "boolean",
describe: "Minimize javascript and switches loaders to minimizing",
group: OPTIMIZE_GROUP
},
"prefetch": {
type: "string",
describe: "Prefetch this request (Example: --prefetch ./file.js)",
group: ADVANCED_GROUP,
requiresArg: true
},
"provide": {
type: "string",
describe: "Provide these modules as free vars in all modules (Example: --provide jQuery=jquery)",
group: ADVANCED_GROUP,
requiresArg: true
},
"labeled-modules": {
type: "boolean",
describe: "Enables labeled modules",
group: ADVANCED_GROUP
},
"plugin": {
type: "string",
describe: "Load this plugin",
group: ADVANCED_GROUP,
requiresArg: true
},
"bail": {
type: "boolean",
describe: "Abort the compilation on first error",
group: ADVANCED_GROUP
},
"profile": {
type: "boolean",
describe: "Profile the compilation and include information in stats",
group: ADVANCED_GROUP
},
"d": {
type: "boolean",
describe: "shortcut for --debug --devtool eval-cheap-module-source-map --output-pathinfo",
group: BASIC_GROUP
},
"p": {
type: "boolean",
describe: "shortcut for --optimize-minimize --define process.env.NODE_ENV=\"production\"",
group: BASIC_GROUP
}
}).strict();
};

547
web/node_modules/webpack/bin/convert-argv.js generated vendored Normal file
View File

@@ -0,0 +1,547 @@
var path = require("path");
var fs = require("fs");
fs.existsSync = fs.existsSync || path.existsSync;
var interpret = require("interpret");
module.exports = function(yargs, argv, convertOptions) {
var options = [];
// Shortcuts
if(argv.d) {
argv.debug = true;
argv["output-pathinfo"] = true;
if(!argv.devtool) {
argv.devtool = "eval-cheap-module-source-map";
}
}
if(argv.p) {
argv["optimize-minimize"] = true;
argv["define"] = [].concat(argv["define"] || []).concat("process.env.NODE_ENV=\"production\"");
}
var configFileLoaded = false;
var configFiles = [];
var extensions = Object.keys(interpret.extensions).sort(function(a, b) {
return a === ".js" ? -1 : b === ".js" ? 1 : a.length - b.length;
});
var defaultConfigFiles = ["webpack.config", "webpackfile"].map(function(filename) {
return extensions.map(function(ext) {
return {
path: path.resolve(filename + ext),
ext: ext
};
});
}).reduce(function(a, i) {
return a.concat(i);
}, []);
var i;
if(argv.config) {
var getConfigExtension = function getConfigExtension(configPath) {
for(i = extensions.length - 1; i >= 0; i--) {
var tmpExt = extensions[i];
if(configPath.indexOf(tmpExt, configPath.length - tmpExt.length) > -1) {
return tmpExt;
}
}
return path.extname(configPath);
};
var mapConfigArg = function mapConfigArg(configArg) {
var resolvedPath = path.resolve(configArg);
var extension = getConfigExtension(resolvedPath);
return {
path: resolvedPath,
ext: extension
};
};
var configArgList = Array.isArray(argv.config) ? argv.config : [argv.config];
configFiles = configArgList.map(mapConfigArg);
} else {
for(i = 0; i < defaultConfigFiles.length; i++) {
var webpackConfig = defaultConfigFiles[i].path;
if(fs.existsSync(webpackConfig)) {
configFiles.push({
path: webpackConfig,
ext: defaultConfigFiles[i].ext
});
break;
}
}
}
if(configFiles.length > 0) {
var registerCompiler = function registerCompiler(moduleDescriptor) {
if(moduleDescriptor) {
if(typeof moduleDescriptor === "string") {
require(moduleDescriptor);
} else if(!Array.isArray(moduleDescriptor)) {
moduleDescriptor.register(require(moduleDescriptor.module));
} else {
for(var i = 0; i < moduleDescriptor.length; i++) {
try {
registerCompiler(moduleDescriptor[i]);
break;
} catch(e) {
// do nothing
}
}
}
}
};
var requireConfig = function requireConfig(configPath) {
var options = require(configPath);
var isES6DefaultExportedFunc = (
typeof options === "object" && options !== null && typeof options.default === "function"
);
if(typeof options === "function" || isES6DefaultExportedFunc) {
options = isES6DefaultExportedFunc ? options.default : options;
options = options(argv.env, argv);
}
return options;
};
configFiles.forEach(function(file) {
registerCompiler(interpret.extensions[file.ext]);
options.push(requireConfig(file.path));
});
configFileLoaded = true;
}
if(!configFileLoaded) {
return processConfiguredOptions({});
} else if(options.length === 1) {
return processConfiguredOptions(options[0]);
} else {
return processConfiguredOptions(options);
}
function processConfiguredOptions(options) {
if(options === null || typeof options !== "object") {
console.error("Config did not export an object or a function returning an object.");
process.exit(-1); // eslint-disable-line
}
// process Promise
if(typeof options.then === "function") {
return options.then(processConfiguredOptions);
}
// process ES6 default
if(typeof options === "object" && typeof options.default === "object") {
return processConfiguredOptions(options.default);
}
if(Array.isArray(options)) {
options.forEach(processOptions);
} else {
processOptions(options);
}
if(argv.context) {
options.context = path.resolve(argv.context);
}
if(!options.context) {
options.context = process.cwd();
}
if(argv.watch) {
options.watch = true;
}
if(argv["watch-aggregate-timeout"]) {
options.watchOptions = options.watchOptions || {};
options.watchOptions.aggregateTimeout = +argv["watch-aggregate-timeout"];
}
if(argv["watch-poll"]) {
options.watchOptions = options.watchOptions || {};
if(typeof argv["watch-poll"] !== "boolean")
options.watchOptions.poll = +argv["watch-poll"];
else
options.watchOptions.poll = true;
}
if(argv["watch-stdin"]) {
options.watchOptions = options.watchOptions || {};
options.watchOptions.stdin = true;
options.watch = true;
}
return options;
}
function processOptions(options) {
var noOutputFilenameDefined = !options.output || !options.output.filename;
function ifArg(name, fn, init, finalize) {
if(Array.isArray(argv[name])) {
if(init) {
init();
}
argv[name].forEach(fn);
if(finalize) {
finalize();
}
} else if(typeof argv[name] !== "undefined" && argv[name] !== null) {
if(init) {
init();
}
fn(argv[name], -1);
if(finalize) {
finalize();
}
}
}
function ifArgPair(name, fn, init, finalize) {
ifArg(name, function(content, idx) {
var i = content.indexOf("=");
if(i < 0) {
return fn(null, content, idx);
} else {
return fn(content.substr(0, i), content.substr(i + 1), idx);
}
}, init, finalize);
}
function ifBooleanArg(name, fn) {
ifArg(name, function(bool) {
if(bool) {
fn();
}
});
}
function mapArgToBoolean(name, optionName) {
ifArg(name, function(bool) {
if(bool === true)
options[optionName || name] = true;
else if(bool === false)
options[optionName || name] = false;
});
}
function loadPlugin(name) {
var loadUtils = require("loader-utils");
var args;
try {
var p = name && name.indexOf("?");
if(p > -1) {
args = loadUtils.parseQuery(name.substring(p));
name = name.substring(0, p);
}
} catch(e) {
console.log("Invalid plugin arguments " + name + " (" + e + ").");
process.exit(-1); // eslint-disable-line
}
var path;
try {
var resolve = require("enhanced-resolve");
path = resolve.sync(process.cwd(), name);
} catch(e) {
console.log("Cannot resolve plugin " + name + ".");
process.exit(-1); // eslint-disable-line
}
var Plugin;
try {
Plugin = require(path);
} catch(e) {
console.log("Cannot load plugin " + name + ". (" + path + ")");
throw e;
}
try {
return new Plugin(args);
} catch(e) {
console.log("Cannot instantiate plugin " + name + ". (" + path + ")");
throw e;
}
}
function ensureObject(parent, name) {
if(typeof parent[name] !== "object" || parent[name] === null) {
parent[name] = {};
}
}
function ensureArray(parent, name) {
if(!Array.isArray(parent[name])) {
parent[name] = [];
}
}
ifArgPair("entry", function(name, entry) {
if(typeof options.entry[name] !== "undefined" && options.entry[name] !== null) {
options.entry[name] = [].concat(options.entry[name]).concat(entry);
} else {
options.entry[name] = entry;
}
}, function() {
ensureObject(options, "entry");
});
function bindLoaders(arg, collection) {
ifArgPair(arg, function(name, binding) {
if(name === null) {
name = binding;
binding += "-loader";
}
options.module[collection].push({
test: new RegExp("\\." + name.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&") + "$"),
loader: binding
});
}, function() {
ensureObject(options, "module");
ensureArray(options.module, collection);
});
}
bindLoaders("module-bind", "loaders");
bindLoaders("module-bind-pre", "preLoaders");
bindLoaders("module-bind-post", "postLoaders");
var defineObject;
ifArgPair("define", function(name, value) {
if(name === null) {
name = value;
value = true;
}
defineObject[name] = value;
}, function() {
defineObject = {};
}, function() {
ensureArray(options, "plugins");
var DefinePlugin = require("../lib/DefinePlugin");
options.plugins.push(new DefinePlugin(defineObject));
});
ifArg("output-path", function(value) {
ensureObject(options, "output");
options.output.path = path.resolve(value);
});
ifArg("output-filename", function(value) {
ensureObject(options, "output");
options.output.filename = value;
noOutputFilenameDefined = false;
});
ifArg("output-chunk-filename", function(value) {
ensureObject(options, "output");
options.output.chunkFilename = value;
});
ifArg("output-source-map-filename", function(value) {
ensureObject(options, "output");
options.output.sourceMapFilename = value;
});
ifArg("output-public-path", function(value) {
ensureObject(options, "output");
options.output.publicPath = value;
});
ifArg("output-jsonp-function", function(value) {
ensureObject(options, "output");
options.output.jsonpFunction = value;
});
ifBooleanArg("output-pathinfo", function() {
ensureObject(options, "output");
options.output.pathinfo = true;
});
ifArg("output-library", function(value) {
ensureObject(options, "output");
options.output.library = value;
});
ifArg("output-library-target", function(value) {
ensureObject(options, "output");
options.output.libraryTarget = value;
});
ifArg("records-input-path", function(value) {
options.recordsInputPath = path.resolve(value);
});
ifArg("records-output-path", function(value) {
options.recordsOutputPath = path.resolve(value);
});
ifArg("records-path", function(value) {
options.recordsPath = path.resolve(value);
});
ifArg("target", function(value) {
options.target = value;
});
mapArgToBoolean("cache");
ifBooleanArg("hot", function() {
ensureArray(options, "plugins");
var HotModuleReplacementPlugin = require("../lib/HotModuleReplacementPlugin");
options.plugins.push(new HotModuleReplacementPlugin());
});
ifBooleanArg("debug", function() {
ensureArray(options, "plugins");
var LoaderOptionsPlugin = require("../lib/LoaderOptionsPlugin");
options.plugins.push(new LoaderOptionsPlugin({
debug: true
}));
});
ifArg("devtool", function(value) {
options.devtool = value;
});
function processResolveAlias(arg, key) {
ifArgPair(arg, function(name, value) {
if(!name) {
throw new Error("--" + arg + " <string>=<string>");
}
ensureObject(options, key);
ensureObject(options[key], "alias");
options[key].alias[name] = value;
});
}
processResolveAlias("resolve-alias", "resolve");
processResolveAlias("resolve-loader-alias", "resolveLoader");
ifArg("resolve-extensions", function(value) {
ensureObject(options, "resolve");
if(Array.isArray(value)) {
options.resolve.extensions = value;
} else {
options.resolve.extensions = value.split(/,\s*/);
}
});
ifArg("optimize-max-chunks", function(value) {
ensureArray(options, "plugins");
var LimitChunkCountPlugin = require("../lib/optimize/LimitChunkCountPlugin");
options.plugins.push(new LimitChunkCountPlugin({
maxChunks: parseInt(value, 10)
}));
});
ifArg("optimize-min-chunk-size", function(value) {
ensureArray(options, "plugins");
var MinChunkSizePlugin = require("../lib/optimize/MinChunkSizePlugin");
options.plugins.push(new MinChunkSizePlugin({
minChunkSize: parseInt(value, 10)
}));
});
ifBooleanArg("optimize-minimize", function() {
ensureArray(options, "plugins");
var UglifyJsPlugin = require("../lib/optimize/UglifyJsPlugin");
var LoaderOptionsPlugin = require("../lib/LoaderOptionsPlugin");
options.plugins.push(new UglifyJsPlugin({
sourceMap: options.devtool && (options.devtool.indexOf("sourcemap") >= 0 || options.devtool.indexOf("source-map") >= 0)
}));
options.plugins.push(new LoaderOptionsPlugin({
minimize: true
}));
});
ifArg("prefetch", function(request) {
ensureArray(options, "plugins");
var PrefetchPlugin = require("../lib/PrefetchPlugin");
options.plugins.push(new PrefetchPlugin(request));
});
ifArg("provide", function(value) {
ensureArray(options, "plugins");
var idx = value.indexOf("=");
var name;
if(idx >= 0) {
name = value.substr(0, idx);
value = value.substr(idx + 1);
} else {
name = value;
}
var ProvidePlugin = require("../lib/ProvidePlugin");
options.plugins.push(new ProvidePlugin(name, value));
});
ifArg("plugin", function(value) {
ensureArray(options, "plugins");
options.plugins.push(loadPlugin(value));
});
mapArgToBoolean("bail");
mapArgToBoolean("profile");
if(noOutputFilenameDefined) {
ensureObject(options, "output");
if(convertOptions && convertOptions.outputFilename) {
options.output.path = path.resolve(path.dirname(convertOptions.outputFilename));
options.output.filename = path.basename(convertOptions.outputFilename);
} else if(argv._.length > 0) {
options.output.filename = argv._.pop();
options.output.path = path.resolve(path.dirname(options.output.filename));
options.output.filename = path.basename(options.output.filename);
} else if(configFileLoaded) {
throw new Error("'output.filename' is required, either in config file or as --output-filename");
} else {
console.error("No configuration file found and no output filename configured via CLI option.");
console.error("A configuration file could be named 'webpack.config.js' in the current directory.");
console.error("Use --help to display the CLI options.");
process.exit(-1); // eslint-disable-line
}
}
if(argv._.length > 0) {
if(Array.isArray(options.entry) || typeof options.entry === "string") {
options.entry = {
main: options.entry
};
}
ensureObject(options, "entry");
var addTo = function addTo(name, entry) {
if(options.entry[name]) {
if(!Array.isArray(options.entry[name])) {
options.entry[name] = [options.entry[name]];
}
options.entry[name].push(entry);
} else {
options.entry[name] = entry;
}
};
argv._.forEach(function(content) {
var i = content.indexOf("=");
var j = content.indexOf("?");
if(i < 0 || (j >= 0 && j < i)) {
var resolved = path.resolve(content);
if(fs.existsSync(resolved)) {
addTo("main", resolved);
} else {
addTo("main", content);
}
} else {
addTo(content.substr(0, i), content.substr(i + 1));
}
});
}
if(!options.entry) {
if(configFileLoaded) {
console.error("Configuration file found but no entry configured.");
} else {
console.error("No configuration file found and no entry configured via CLI option.");
console.error("When using the CLI you need to provide at least two arguments: entry and output.");
console.error("A configuration file could be named 'webpack.config.js' in the current directory.");
}
console.error("Use --help to display the CLI options.");
process.exit(-1); // eslint-disable-line
}
}
};

363
web/node_modules/webpack/bin/webpack.js generated vendored Executable file
View File

@@ -0,0 +1,363 @@
#!/usr/bin/env node
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
var path = require("path");
// Local version replace global one
try {
var localWebpack = require.resolve(path.join(process.cwd(), "node_modules", "webpack", "bin", "webpack.js"));
if(__filename !== localWebpack) {
return require(localWebpack);
}
} catch(e) {}
var yargs = require("yargs")
.usage("webpack " + require("../package.json").version + "\n" +
"Usage: https://webpack.js.org/api/cli/\n" +
"Usage without config file: webpack <entry> [<entry>] <output>\n" +
"Usage with config file: webpack");
require("./config-yargs")(yargs);
var DISPLAY_GROUP = "Stats options:";
var BASIC_GROUP = "Basic options:";
yargs.options({
"json": {
type: "boolean",
alias: "j",
describe: "Prints the result as JSON."
},
"progress": {
type: "boolean",
describe: "Print compilation progress in percentage",
group: BASIC_GROUP
},
"color": {
type: "boolean",
alias: "colors",
default: function supportsColor() {
return require("supports-color");
},
group: DISPLAY_GROUP,
describe: "Enables/Disables colors on the console"
},
"sort-modules-by": {
type: "string",
group: DISPLAY_GROUP,
describe: "Sorts the modules list by property in module"
},
"sort-chunks-by": {
type: "string",
group: DISPLAY_GROUP,
describe: "Sorts the chunks list by property in chunk"
},
"sort-assets-by": {
type: "string",
group: DISPLAY_GROUP,
describe: "Sorts the assets list by property in asset"
},
"hide-modules": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Hides info about modules"
},
"display-exclude": {
type: "string",
group: DISPLAY_GROUP,
describe: "Exclude modules in the output"
},
"display-modules": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display even excluded modules in the output"
},
"display-max-modules": {
type: "number",
group: DISPLAY_GROUP,
describe: "Sets the maximum number of visible modules in output"
},
"display-chunks": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display chunks in the output"
},
"display-entrypoints": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display entry points in the output"
},
"display-origins": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display origins of chunks in the output"
},
"display-cached": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display also cached modules in the output"
},
"display-cached-assets": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display also cached assets in the output"
},
"display-reasons": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display reasons about module inclusion in the output"
},
"display-depth": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display distance from entry point for each module"
},
"display-used-exports": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display information about used exports in modules (Tree Shaking)"
},
"display-provided-exports": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display information about exports provided from modules"
},
"display-error-details": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Display details about errors"
},
"verbose": {
type: "boolean",
group: DISPLAY_GROUP,
describe: "Show more details"
}
});
var argv = yargs.argv;
if(argv.verbose) {
argv["display-reasons"] = true;
argv["display-depth"] = true;
argv["display-entrypoints"] = true;
argv["display-used-exports"] = true;
argv["display-provided-exports"] = true;
argv["display-error-details"] = true;
argv["display-modules"] = true;
argv["display-cached"] = true;
argv["display-cached-assets"] = true;
}
var options = require("./convert-argv")(yargs, argv);
function ifArg(name, fn, init) {
if(Array.isArray(argv[name])) {
if(init) init();
argv[name].forEach(fn);
} else if(typeof argv[name] !== "undefined") {
if(init) init();
fn(argv[name], -1);
}
}
function processOptions(options) {
// process Promise
if(typeof options.then === "function") {
options.then(processOptions).catch(function(err) {
console.error(err.stack || err);
process.exit(1); // eslint-disable-line
});
return;
}
var firstOptions = [].concat(options)[0];
var statsPresetToOptions = require("../lib/Stats.js").presetToOptions;
var outputOptions = options.stats;
if(typeof outputOptions === "boolean" || typeof outputOptions === "string") {
outputOptions = statsPresetToOptions(outputOptions);
} else if(!outputOptions) {
outputOptions = {};
}
outputOptions = Object.create(outputOptions);
if(Array.isArray(options) && !outputOptions.children) {
outputOptions.children = options.map(o => o.stats);
}
if(typeof outputOptions.context === "undefined")
outputOptions.context = firstOptions.context;
ifArg("json", function(bool) {
if(bool)
outputOptions.json = bool;
});
if(typeof outputOptions.colors === "undefined")
outputOptions.colors = require("supports-color");
ifArg("sort-modules-by", function(value) {
outputOptions.modulesSort = value;
});
ifArg("sort-chunks-by", function(value) {
outputOptions.chunksSort = value;
});
ifArg("sort-assets-by", function(value) {
outputOptions.assetsSort = value;
});
ifArg("display-exclude", function(value) {
outputOptions.exclude = value;
});
if(!outputOptions.json) {
if(typeof outputOptions.cached === "undefined")
outputOptions.cached = false;
if(typeof outputOptions.cachedAssets === "undefined")
outputOptions.cachedAssets = false;
ifArg("display-chunks", function(bool) {
outputOptions.modules = !bool;
outputOptions.chunks = bool;
});
ifArg("display-entrypoints", function(bool) {
outputOptions.entrypoints = bool;
});
ifArg("display-reasons", function(bool) {
outputOptions.reasons = bool;
});
ifArg("display-depth", function(bool) {
outputOptions.depth = bool;
});
ifArg("display-used-exports", function(bool) {
outputOptions.usedExports = bool;
});
ifArg("display-provided-exports", function(bool) {
outputOptions.providedExports = bool;
});
ifArg("display-error-details", function(bool) {
outputOptions.errorDetails = bool;
});
ifArg("display-origins", function(bool) {
outputOptions.chunkOrigins = bool;
});
ifArg("display-max-modules", function(value) {
outputOptions.maxModules = value;
});
ifArg("display-cached", function(bool) {
if(bool)
outputOptions.cached = true;
});
ifArg("display-cached-assets", function(bool) {
if(bool)
outputOptions.cachedAssets = true;
});
if(!outputOptions.exclude)
outputOptions.exclude = ["node_modules", "bower_components", "components"];
if(argv["display-modules"]) {
outputOptions.maxModules = Infinity;
outputOptions.exclude = undefined;
}
} else {
if(typeof outputOptions.chunks === "undefined")
outputOptions.chunks = true;
if(typeof outputOptions.entrypoints === "undefined")
outputOptions.entrypoints = true;
if(typeof outputOptions.modules === "undefined")
outputOptions.modules = true;
if(typeof outputOptions.chunkModules === "undefined")
outputOptions.chunkModules = true;
if(typeof outputOptions.reasons === "undefined")
outputOptions.reasons = true;
if(typeof outputOptions.cached === "undefined")
outputOptions.cached = true;
if(typeof outputOptions.cachedAssets === "undefined")
outputOptions.cachedAssets = true;
}
ifArg("hide-modules", function(bool) {
if(bool) {
outputOptions.modules = false;
outputOptions.chunkModules = false;
}
});
var webpack = require("../lib/webpack.js");
Error.stackTraceLimit = 30;
var lastHash = null;
var compiler;
try {
compiler = webpack(options);
} catch(e) {
var WebpackOptionsValidationError = require("../lib/WebpackOptionsValidationError");
if(e instanceof WebpackOptionsValidationError) {
if(argv.color)
console.error("\u001b[1m\u001b[31m" + e.message + "\u001b[39m\u001b[22m");
else
console.error(e.message);
process.exit(1); // eslint-disable-line no-process-exit
}
throw e;
}
if(argv.progress) {
var ProgressPlugin = require("../lib/ProgressPlugin");
compiler.apply(new ProgressPlugin({
profile: argv.profile
}));
}
function compilerCallback(err, stats) {
if(!options.watch || err) {
// Do not keep cache anymore
compiler.purgeInputFileSystem();
}
if(err) {
lastHash = null;
console.error(err.stack || err);
if(err.details) console.error(err.details);
process.exit(1); // eslint-disable-line
}
if(outputOptions.json) {
process.stdout.write(JSON.stringify(stats.toJson(outputOptions), null, 2) + "\n");
} else if(stats.hash !== lastHash) {
lastHash = stats.hash;
process.stdout.write(stats.toString(outputOptions) + "\n");
}
if(!options.watch && stats.hasErrors()) {
process.on("exit", function() {
process.exit(2); // eslint-disable-line
});
}
}
if(firstOptions.watch || options.watch) {
var watchOptions = firstOptions.watchOptions || firstOptions.watch || options.watch || {};
if(watchOptions.stdin) {
process.stdin.on("end", function() {
process.exit(0); // eslint-disable-line
});
process.stdin.resume();
}
compiler.watch(watchOptions, compilerCallback);
console.log("\nWebpack is watching the files…\n");
} else
compiler.run(compilerCallback);
}
processOptions(options);

7
web/node_modules/webpack/buildin/.eslintrc generated vendored Normal file
View File

@@ -0,0 +1,7 @@
{
"env": {
"node": true,
"es6": false,
"browser": true
}
}

3
web/node_modules/webpack/buildin/amd-define.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
module.exports = function() {
throw new Error("define cannot be used indirect");
};

2
web/node_modules/webpack/buildin/amd-options.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
/* globals __webpack_amd_options__ */
module.exports = __webpack_amd_options__;

21
web/node_modules/webpack/buildin/global.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || Function("return this")() || (1,eval)("this");
} catch(e) {
// This works if the window reference is available
if(typeof window === "object")
g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;

24
web/node_modules/webpack/buildin/harmony-module.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
module.exports = function(originalModule) {
if(!originalModule.webpackPolyfill) {
var module = Object.create(originalModule);
// module.parent = undefined by default
if(!module.children) module.children = [];
Object.defineProperty(module, "loaded", {
enumerable: true,
get: function() {
return module.l;
}
});
Object.defineProperty(module, "id", {
enumerable: true,
get: function() {
return module.i;
}
});
Object.defineProperty(module, "exports", {
enumerable: true,
});
module.webpackPolyfill = 1;
}
return module;
};

22
web/node_modules/webpack/buildin/module.js generated vendored Normal file
View File

@@ -0,0 +1,22 @@
module.exports = function(module) {
if(!module.webpackPolyfill) {
module.deprecate = function() {};
module.paths = [];
// module.parent = undefined by default
if(!module.children) module.children = [];
Object.defineProperty(module, "loaded", {
enumerable: true,
get: function() {
return module.l;
}
});
Object.defineProperty(module, "id", {
enumerable: true,
get: function() {
return module.i;
}
});
module.webpackPolyfill = 1;
}
return module;
};

7
web/node_modules/webpack/buildin/system.js generated vendored Normal file
View File

@@ -0,0 +1,7 @@
// Provide a "System" global.
module.exports = {
// Make sure import is only used as "System.import"
import: function() {
throw new Error("System.import cannot be used indirectly");
}
};

9
web/node_modules/webpack/hot/.eslintrc generated vendored Normal file
View File

@@ -0,0 +1,9 @@
{
"env": {
"node": true
},
"rules": {
"node/exports-style": ["off"]
}
}

52
web/node_modules/webpack/hot/dev-server.js generated vendored Normal file
View File

@@ -0,0 +1,52 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
/*globals window __webpack_hash__ */
if(module.hot) {
var lastHash;
var upToDate = function upToDate() {
return lastHash.indexOf(__webpack_hash__) >= 0;
};
var check = function check() {
module.hot.check(true).then(function(updatedModules) {
if(!updatedModules) {
console.warn("[HMR] Cannot find update. Need to do a full reload!");
console.warn("[HMR] (Probably because of restarting the webpack-dev-server)");
window.location.reload();
return;
}
if(!upToDate()) {
check();
}
require("./log-apply-result")(updatedModules, updatedModules);
if(upToDate()) {
console.log("[HMR] App is up to date.");
}
}).catch(function(err) {
var status = module.hot.status();
if(["abort", "fail"].indexOf(status) >= 0) {
console.warn("[HMR] Cannot apply update. Need to do a full reload!");
console.warn("[HMR] " + err.stack || err.message);
window.location.reload();
} else {
console.warn("[HMR] Update failed: " + err.stack || err.message);
}
});
};
var hotEmitter = require("./emitter");
hotEmitter.on("webpackHotUpdate", function(currentHash) {
lastHash = currentHash;
if(!upToDate() && module.hot.status() === "idle") {
console.log("[HMR] Checking for updates on the server...");
check();
}
});
console.log("[HMR] Waiting for update signal from WDS...");
} else {
throw new Error("[HMR] Hot Module Replacement is disabled.");
}

2
web/node_modules/webpack/hot/emitter.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
var EventEmitter = require("events");
module.exports = new EventEmitter();

30
web/node_modules/webpack/hot/log-apply-result.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
module.exports = function(updatedModules, renewedModules) {
var unacceptedModules = updatedModules.filter(function(moduleId) {
return renewedModules && renewedModules.indexOf(moduleId) < 0;
});
if(unacceptedModules.length > 0) {
console.warn("[HMR] The following modules couldn't be hot updated: (They would need a full reload!)");
unacceptedModules.forEach(function(moduleId) {
console.warn("[HMR] - " + moduleId);
});
}
if(!renewedModules || renewedModules.length === 0) {
console.log("[HMR] Nothing hot updated.");
} else {
console.log("[HMR] Updated modules:");
renewedModules.forEach(function(moduleId) {
console.log("[HMR] - " + moduleId);
});
var numberIds = renewedModules.every(function(moduleId) {
return typeof moduleId === "number";
});
if(numberIds)
console.log("[HMR] Consider using the NamedModulesPlugin for module names.");
}
};

69
web/node_modules/webpack/hot/only-dev-server.js generated vendored Normal file
View File

@@ -0,0 +1,69 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
/*globals __webpack_hash__ */
if(module.hot) {
var lastHash;
var upToDate = function upToDate() {
return lastHash.indexOf(__webpack_hash__) >= 0;
};
var check = function check() {
module.hot.check().then(function(updatedModules) {
if(!updatedModules) {
console.warn("[HMR] Cannot find update. Need to do a full reload!");
console.warn("[HMR] (Probably because of restarting the webpack-dev-server)");
return;
}
return module.hot.apply({
ignoreUnaccepted: true,
ignoreDeclined: true,
ignoreErrored: true,
onUnaccepted: function(data) {
console.warn("Ignored an update to unaccepted module " + data.chain.join(" -> "));
},
onDeclined: function(data) {
console.warn("Ignored an update to declined module " + data.chain.join(" -> "));
},
onErrored: function(data) {
console.warn("Ignored an error while updating module " + data.moduleId + " (" + data.type + ")");
}
}).then(function(renewedModules) {
if(!upToDate()) {
check();
}
require("./log-apply-result")(updatedModules, renewedModules);
if(upToDate()) {
console.log("[HMR] App is up to date.");
}
});
}).catch(function(err) {
var status = module.hot.status();
if(["abort", "fail"].indexOf(status) >= 0) {
console.warn("[HMR] Cannot check for update. Need to do a full reload!");
console.warn("[HMR] " + err.stack || err.message);
} else {
console.warn("[HMR] Update check failed: " + err.stack || err.message);
}
});
};
var hotEmitter = require("./emitter");
hotEmitter.on("webpackHotUpdate", function(currentHash) {
lastHash = currentHash;
if(!upToDate()) {
var status = module.hot.status();
if(status === "idle") {
console.log("[HMR] Checking for updates on the server...");
check();
} else if(["abort", "fail"].indexOf(status) >= 0) {
console.warn("[HMR] Cannot apply update as a previous update " + status + "ed. Need to do a full reload!");
}
}
});
console.log("[HMR] Waiting for update signal from WDS...");
} else {
throw new Error("[HMR] Hot Module Replacement is disabled.");
}

33
web/node_modules/webpack/hot/poll.js generated vendored Normal file
View File

@@ -0,0 +1,33 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
/*globals __resourceQuery */
if(module.hot) {
var hotPollInterval = +(__resourceQuery.substr(1)) || (10 * 60 * 1000);
var checkForUpdate = function checkForUpdate(fromUpdate) {
if(module.hot.status() === "idle") {
module.hot.check(true).then(function(updatedModules) {
if(!updatedModules) {
if(fromUpdate) console.log("[HMR] Update applied.");
return;
}
require("./log-apply-result")(updatedModules, updatedModules);
checkForUpdate(true);
}).catch(function(err) {
var status = module.hot.status();
if(["abort", "fail"].indexOf(status) >= 0) {
console.warn("[HMR] Cannot apply update.");
console.warn("[HMR] " + err.stack || err.message);
console.warn("[HMR] You need to restart the application!");
} else {
console.warn("[HMR] Update failed: " + err.stack || err.message);
}
});
}
};
setInterval(checkForUpdate, hotPollInterval);
} else {
throw new Error("[HMR] Hot Module Replacement is disabled.");
}

50
web/node_modules/webpack/hot/signal.js generated vendored Normal file
View File

@@ -0,0 +1,50 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
/*globals __resourceQuery */
if(module.hot) {
var checkForUpdate = function checkForUpdate(fromUpdate) {
module.hot.check().then(function(updatedModules) {
if(!updatedModules) {
if(fromUpdate)
console.log("[HMR] Update applied.");
else
console.warn("[HMR] Cannot find update.");
return;
}
return module.hot.apply({
ignoreUnaccepted: true,
onUnaccepted: function(data) {
console.warn("Ignored an update to unaccepted module " + data.chain.join(" -> "));
},
}).then(function(renewedModules) {
require("./log-apply-result")(updatedModules, renewedModules);
checkForUpdate(true);
});
}).catch(function(err) {
var status = module.hot.status();
if(["abort", "fail"].indexOf(status) >= 0) {
console.warn("[HMR] Cannot apply update.");
console.warn("[HMR] " + err.stack || err.message);
console.warn("[HMR] You need to restart the application!");
} else {
console.warn("[HMR] Update failed: " + err.stack || err.message);
}
});
};
process.on(__resourceQuery.substr(1) || "SIGUSR2", function() {
if(module.hot.status() !== "idle") {
console.warn("[HMR] Got signal but currently in " + module.hot.status() + " state.");
console.warn("[HMR] Need to be in idle state to start hot update.");
return;
}
checkForUpdate();
});
} else {
throw new Error("[HMR] Hot Module Replacement is disabled.");
}

45
web/node_modules/webpack/lib/APIPlugin.js generated vendored Normal file
View File

@@ -0,0 +1,45 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ConstDependency = require("./dependencies/ConstDependency");
const ParserHelpers = require("./ParserHelpers");
const NullFactory = require("./NullFactory");
const REPLACEMENTS = {
__webpack_require__: "__webpack_require__", // eslint-disable-line camelcase
__webpack_public_path__: "__webpack_require__.p", // eslint-disable-line camelcase
__webpack_modules__: "__webpack_require__.m", // eslint-disable-line camelcase
__webpack_chunk_load__: "__webpack_require__.e", // eslint-disable-line camelcase
__non_webpack_require__: "require", // eslint-disable-line camelcase
__webpack_nonce__: "__webpack_require__.nc", // eslint-disable-line camelcase
"require.onError": "__webpack_require__.oe" // eslint-disable-line camelcase
};
const REPLACEMENT_TYPES = {
__webpack_public_path__: "string", // eslint-disable-line camelcase
__webpack_require__: "function", // eslint-disable-line camelcase
__webpack_modules__: "object", // eslint-disable-line camelcase
__webpack_chunk_load__: "function", // eslint-disable-line camelcase
__webpack_nonce__: "string" // eslint-disable-line camelcase
};
class APIPlugin {
apply(compiler) {
compiler.plugin("compilation", (compilation, params) => {
compilation.dependencyFactories.set(ConstDependency, new NullFactory());
compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());
params.normalModuleFactory.plugin("parser", parser => {
Object.keys(REPLACEMENTS).forEach(key => {
parser.plugin(`expression ${key}`, ParserHelpers.toConstantDependency(REPLACEMENTS[key]));
parser.plugin(`evaluate typeof ${key}`, ParserHelpers.evaluateToString(REPLACEMENT_TYPES[key]));
});
});
});
}
}
module.exports = APIPlugin;

56
web/node_modules/webpack/lib/AmdMainTemplatePlugin.js generated vendored Normal file
View File

@@ -0,0 +1,56 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ConcatSource = require("webpack-sources").ConcatSource;
const Template = require("./Template");
class AmdMainTemplatePlugin {
constructor(name) {
this.name = name;
}
apply(compilation) {
const mainTemplate = compilation.mainTemplate;
compilation.templatesPlugin("render-with-entry", (source, chunk, hash) => {
const externals = chunk.modules.filter((m) => m.external);
const externalsDepsArray = JSON.stringify(externals.map((m) =>
typeof m.request === "object" ? m.request.amd : m.request
));
const externalsArguments = externals.map((m) =>
Template.toIdentifier(`__WEBPACK_EXTERNAL_MODULE_${m.id}__`)
).join(", ");
if(this.name) {
const name = mainTemplate.applyPluginsWaterfall("asset-path", this.name, {
hash,
chunk
});
return new ConcatSource(
`define(${JSON.stringify(name)}, ${externalsDepsArray}, function(${externalsArguments}) { return `, source, "});"
);
} else if(externalsArguments) {
return new ConcatSource(`define(${externalsDepsArray}, function(${externalsArguments}) { return `, source, "});");
} else {
return new ConcatSource("define(function() { return ", source, "});");
}
});
mainTemplate.plugin("global-hash-paths", (paths) => {
if(this.name) paths.push(this.name);
return paths;
});
mainTemplate.plugin("hash", (hash) => {
hash.update("exports amd");
hash.update(this.name);
});
}
}
module.exports = AmdMainTemplatePlugin;

53
web/node_modules/webpack/lib/AsyncDependenciesBlock.js generated vendored Normal file
View File

@@ -0,0 +1,53 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const DependenciesBlock = require("./DependenciesBlock");
module.exports = class AsyncDependenciesBlock extends DependenciesBlock {
constructor(name, module, loc) {
super();
this.chunkName = name;
this.chunks = null;
this.module = module;
this.loc = loc;
}
get chunk() {
throw new Error("`chunk` was been renamed to `chunks` and is now an array");
}
set chunk(chunk) {
throw new Error("`chunk` was been renamed to `chunks` and is now an array");
}
updateHash(hash) {
hash.update(this.chunkName || "");
hash.update(this.chunks && this.chunks.map((chunk) => {
return chunk.id !== null ? chunk.id : "";
}).join(",") || "");
super.updateHash(hash);
}
disconnect() {
this.chunks = null;
super.disconnect();
}
unseal() {
this.chunks = null;
super.unseal();
}
sortItems() {
super.sortItems();
if(this.chunks) {
this.chunks.sort((a, b) => {
let i = 0;
while(true) { // eslint-disable-line no-constant-condition
if(!a.modules[i] && !b.modules[i]) return 0;
if(!a.modules[i]) return -1;
if(!b.modules[i]) return 1;
if(a.modules[i].id > b.modules[i].id) return 1;
if(a.modules[i].id < b.modules[i].id) return -1;
i++;
}
});
}
}
};

View File

@@ -0,0 +1,36 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const asyncLib = require("async");
const PrefetchDependency = require("./dependencies/PrefetchDependency");
const NormalModule = require("./NormalModule");
class AutomaticPrefetchPlugin {
apply(compiler) {
compiler.plugin("compilation", (compilation, params) => {
const normalModuleFactory = params.normalModuleFactory;
compilation.dependencyFactories.set(PrefetchDependency, normalModuleFactory);
});
let lastModules = null;
compiler.plugin("after-compile", (compilation, callback) => {
lastModules = compilation.modules
.filter(m => m instanceof NormalModule)
.map(m => ({
context: m.context,
request: m.request
}));
callback();
});
compiler.plugin("make", (compilation, callback) => {
if(!lastModules) return callback();
asyncLib.forEach(lastModules, (m, callback) => {
compilation.prefetch(m.context || compiler.context, new PrefetchDependency(m.request), callback);
}, callback);
});
}
}
module.exports = AutomaticPrefetchPlugin;

73
web/node_modules/webpack/lib/BannerPlugin.js generated vendored Normal file
View File

@@ -0,0 +1,73 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ConcatSource = require("webpack-sources").ConcatSource;
const ModuleFilenameHelpers = require("./ModuleFilenameHelpers");
const wrapComment = (str) => {
if(!str.includes("\n")) return `/*! ${str} */`;
return `/*!\n * ${str.split("\n").join("\n * ")}\n */`;
};
class BannerPlugin {
constructor(options) {
if(arguments.length > 1)
throw new Error("BannerPlugin only takes one argument (pass an options object)");
if(typeof options === "string")
options = {
banner: options
};
this.options = options || {};
this.banner = this.options.raw ? options.banner : wrapComment(options.banner);
}
apply(compiler) {
const options = this.options;
const banner = this.banner;
compiler.plugin("compilation", (compilation) => {
compilation.plugin("optimize-chunk-assets", (chunks, callback) => {
chunks.forEach((chunk) => {
if(options.entryOnly && !chunk.isInitial()) return;
chunk.files
.filter(ModuleFilenameHelpers.matchObject.bind(undefined, options))
.forEach((file) => {
let basename;
let query = "";
let filename = file;
const hash = compilation.hash;
const querySplit = filename.indexOf("?");
if(querySplit >= 0) {
query = filename.substr(querySplit);
filename = filename.substr(0, querySplit);
}
if(filename.indexOf("/") < 0) {
basename = filename;
} else {
basename = filename.substr(filename.lastIndexOf("/") + 1);
}
const comment = compilation.getPath(banner, {
hash,
chunk,
filename,
basename,
query,
});
return compilation.assets[file] = new ConcatSource(comment, "\n", compilation.assets[file]);
});
});
callback();
});
});
}
}
module.exports = BannerPlugin;

View File

@@ -0,0 +1,181 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
class BasicEvaluatedExpression {
constructor() {
this.range = null;
}
isNull() {
return !!this.null;
}
isString() {
return Object.prototype.hasOwnProperty.call(this, "string");
}
isNumber() {
return Object.prototype.hasOwnProperty.call(this, "number");
}
isBoolean() {
return Object.prototype.hasOwnProperty.call(this, "bool");
}
isRegExp() {
return Object.prototype.hasOwnProperty.call(this, "regExp");
}
isConditional() {
return Object.prototype.hasOwnProperty.call(this, "options");
}
isArray() {
return Object.prototype.hasOwnProperty.call(this, "items");
}
isConstArray() {
return Object.prototype.hasOwnProperty.call(this, "array");
}
isIdentifier() {
return Object.prototype.hasOwnProperty.call(this, "identifier");
}
isWrapped() {
return Object.prototype.hasOwnProperty.call(this, "prefix") || Object.prototype.hasOwnProperty.call(this, "postfix");
}
isTemplateString() {
return Object.prototype.hasOwnProperty.call(this, "quasis");
}
asBool() {
if(this.isBoolean()) return this.bool;
else if(this.isNull()) return false;
else if(this.isString()) return !!this.string;
else if(this.isNumber()) return !!this.number;
else if(this.isRegExp()) return true;
else if(this.isArray()) return true;
else if(this.isConstArray()) return true;
else if(this.isWrapped()) return this.prefix && this.prefix.asBool() || this.postfix && this.postfix.asBool() ? true : undefined;
else if(this.isTemplateString()) {
if(this.quasis.length === 1) return this.quasis[0].asBool();
for(let i = 0; i < this.quasis.length; i++) {
if(this.quasis[i].asBool()) return true;
}
// can't tell if string will be empty without executing
}
return undefined;
}
setString(str) {
if(str === null)
delete this.string;
else
this.string = str;
return this;
}
setNull() {
this.null = true;
return this;
}
setNumber(num) {
if(num === null)
delete this.number;
else
this.number = num;
return this;
}
setBoolean(bool) {
if(bool === null)
delete this.bool;
else
this.bool = bool;
return this;
}
setRegExp(regExp) {
if(regExp === null)
delete this.regExp;
else
this.regExp = regExp;
return this;
}
setIdentifier(identifier) {
if(identifier === null)
delete this.identifier;
else
this.identifier = identifier;
return this;
}
setWrapped(prefix, postfix) {
this.prefix = prefix;
this.postfix = postfix;
return this;
}
unsetWrapped() {
delete this.prefix;
delete this.postfix;
return this;
}
setOptions(options) {
if(options === null)
delete this.options;
else
this.options = options;
return this;
}
setItems(items) {
if(items === null)
delete this.items;
else
this.items = items;
return this;
}
setArray(array) {
if(array === null)
delete this.array;
else
this.array = array;
return this;
}
setTemplateString(quasis) {
if(quasis === null)
delete this.quasis;
else
this.quasis = quasis;
return this;
}
addOptions(options) {
if(!this.options) this.options = [];
options.forEach(item => {
this.options.push(item);
}, this);
return this;
}
setRange(range) {
this.range = range;
return this;
}
}
module.exports = BasicEvaluatedExpression;

79
web/node_modules/webpack/lib/CachePlugin.js generated vendored Normal file
View File

@@ -0,0 +1,79 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const asyncLib = require("async");
class CachePlugin {
constructor(cache) {
this.cache = cache || {};
this.FS_ACCURENCY = 2000;
}
apply(compiler) {
if(Array.isArray(compiler.compilers)) {
compiler.compilers.forEach((c, idx) => {
c.apply(new CachePlugin(this.cache[idx] = this.cache[idx] || {}));
});
} else {
compiler.plugin("compilation", compilation => {
if(!compilation.notCacheable) {
compilation.cache = this.cache;
} else if(this.watching) {
compilation.warnings.push(
new Error(`CachePlugin - Cache cannot be used because of: ${compilation.notCacheable}`)
);
}
});
compiler.plugin("watch-run", (compiler, callback) => {
this.watching = true;
callback();
});
compiler.plugin("run", (compiler, callback) => {
if(!compiler._lastCompilationFileDependencies) return callback();
const fs = compiler.inputFileSystem;
const fileTs = compiler.fileTimestamps = {};
asyncLib.forEach(compiler._lastCompilationFileDependencies, (file, callback) => {
fs.stat(file, (err, stat) => {
if(err) {
if(err.code === "ENOENT") return callback();
return callback(err);
}
if(stat.mtime)
this.applyMtime(+stat.mtime);
fileTs[file] = +stat.mtime || Infinity;
callback();
});
}, err => {
if(err) return callback(err);
Object.keys(fileTs).forEach(key => {
fileTs[key] += this.FS_ACCURENCY;
});
callback();
});
});
compiler.plugin("after-compile", function(compilation, callback) {
compilation.compiler._lastCompilationFileDependencies = compilation.fileDependencies;
compilation.compiler._lastCompilationContextDependencies = compilation.contextDependencies;
callback();
});
}
}
/* istanbul ignore next */
applyMtime(mtime) {
if(this.FS_ACCURENCY > 1 && mtime % 2 !== 0)
this.FS_ACCURENCY = 1;
else if(this.FS_ACCURENCY > 10 && mtime % 20 !== 0)
this.FS_ACCURENCY = 10;
else if(this.FS_ACCURENCY > 100 && mtime % 200 !== 0)
this.FS_ACCURENCY = 100;
else if(this.FS_ACCURENCY > 1000 && mtime % 2000 !== 0)
this.FS_ACCURENCY = 1000;
}
}
module.exports = CachePlugin;

View File

@@ -0,0 +1,49 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const WebpackError = require("./WebpackError");
module.exports = class CaseSensitiveModulesWarning extends WebpackError {
constructor(modules) {
super();
this.name = "CaseSensitiveModulesWarning";
const sortedModules = this._sort(modules);
const modulesList = this._moduleMessages(sortedModules);
this.message = "There are multiple modules with names that only differ in casing.\n" +
"This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.\n" +
`Use equal casing. Compare these module identifiers:\n${modulesList}`;
this.origin = this.module = sortedModules[0];
Error.captureStackTrace(this, this.constructor);
}
_sort(modules) {
return modules.slice().sort((a, b) => {
a = a.identifier();
b = b.identifier();
/* istanbul ignore next */
if(a < b) return -1;
/* istanbul ignore next */
if(a > b) return 1;
/* istanbul ignore next */
return 0;
});
}
_moduleMessages(modules) {
return modules.map((m) => {
let message = `* ${m.identifier()}`;
const validReasons = m.reasons.filter((reason) => reason.module);
if(validReasons.length > 0) {
message += `\n Used by ${validReasons.length} module(s), i. e.`;
message += `\n ${validReasons[0].module.identifier()}`;
}
return message;
}).join("\n");
}
};

396
web/node_modules/webpack/lib/Chunk.js generated vendored Normal file
View File

@@ -0,0 +1,396 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const compareLocations = require("./compareLocations");
let debugId = 1000;
const byId = (a, b) => {
if(a.id < b.id) return -1;
if(b.id < a.id) return 1;
return 0;
};
class Chunk {
constructor(name, module, loc) {
this.id = null;
this.ids = null;
this.debugId = debugId++;
this.name = name;
this.modules = [];
this.entrypoints = [];
this.chunks = [];
this.parents = [];
this.blocks = [];
this.origins = [];
this.files = [];
this.rendered = false;
if(module) {
this.origins.push({
module,
loc,
name
});
}
}
get entry() {
throw new Error("Chunk.entry was removed. Use hasRuntime()");
}
set entry(data) {
throw new Error("Chunk.entry was removed. Use hasRuntime()");
}
get initial() {
throw new Error("Chunk.initial was removed. Use isInitial()");
}
set initial(data) {
throw new Error("Chunk.initial was removed. Use isInitial()");
}
hasRuntime() {
if(this.entrypoints.length === 0) return false;
return this.entrypoints[0].chunks[0] === this;
}
isInitial() {
return this.entrypoints.length > 0;
}
hasEntryModule() {
return !!this.entryModule;
}
addToCollection(collection, item) {
if(item === this) {
return false;
}
if(collection.indexOf(item) > -1) {
return false;
}
collection.push(item);
return true;
}
addChunk(chunk) {
return this.addToCollection(this.chunks, chunk);
}
addParent(parentChunk) {
return this.addToCollection(this.parents, parentChunk);
}
addModule(module) {
return this.addToCollection(this.modules, module);
}
addBlock(block) {
return this.addToCollection(this.blocks, block);
}
removeModule(module) {
const idx = this.modules.indexOf(module);
if(idx >= 0) {
this.modules.splice(idx, 1);
module.removeChunk(this);
return true;
}
return false;
}
removeChunk(chunk) {
const idx = this.chunks.indexOf(chunk);
if(idx >= 0) {
this.chunks.splice(idx, 1);
chunk.removeParent(this);
return true;
}
return false;
}
removeParent(chunk) {
const idx = this.parents.indexOf(chunk);
if(idx >= 0) {
this.parents.splice(idx, 1);
chunk.removeChunk(this);
return true;
}
return false;
}
addOrigin(module, loc) {
this.origins.push({
module,
loc,
name: this.name
});
}
remove(reason) {
// cleanup modules
this.modules.slice().forEach(module => {
module.removeChunk(this);
});
// cleanup parents
this.parents.forEach(parentChunk => {
// remove this chunk from its parents
const idx = parentChunk.chunks.indexOf(this);
if(idx >= 0) {
parentChunk.chunks.splice(idx, 1);
}
// cleanup "sub chunks"
this.chunks.forEach(chunk => {
/**
* remove this chunk as "intermediary" and connect
* it "sub chunks" and parents directly
*/
// add parent to each "sub chunk"
chunk.addParent(parentChunk);
// add "sub chunk" to parent
parentChunk.addChunk(chunk);
});
});
/**
* we need to iterate again over the chunks
* to remove this from the chunks parents.
* This can not be done in the above loop
* as it is not garuanteed that `this.parents` contains anything.
*/
this.chunks.forEach(chunk => {
// remove this as parent of every "sub chunk"
const idx = chunk.parents.indexOf(this);
if(idx >= 0) {
chunk.parents.splice(idx, 1);
}
});
// cleanup blocks
this.blocks.forEach(block => {
const idx = block.chunks.indexOf(this);
if(idx >= 0) {
block.chunks.splice(idx, 1);
if(block.chunks.length === 0) {
block.chunks = null;
block.chunkReason = reason;
}
}
});
}
moveModule(module, otherChunk) {
module.removeChunk(this);
module.addChunk(otherChunk);
otherChunk.addModule(module);
module.rewriteChunkInReasons(this, [otherChunk]);
}
replaceChunk(oldChunk, newChunk) {
const idx = this.chunks.indexOf(oldChunk);
if(idx >= 0) {
this.chunks.splice(idx, 1);
}
if(this !== newChunk && newChunk.addParent(this)) {
this.addChunk(newChunk);
}
}
replaceParentChunk(oldParentChunk, newParentChunk) {
const idx = this.parents.indexOf(oldParentChunk);
if(idx >= 0) {
this.parents.splice(idx, 1);
}
if(this !== newParentChunk && newParentChunk.addChunk(this)) {
this.addParent(newParentChunk);
}
}
integrate(otherChunk, reason) {
if(!this.canBeIntegrated(otherChunk)) {
return false;
}
const otherChunkModules = otherChunk.modules.slice();
otherChunkModules.forEach(module => otherChunk.moveModule(module, this));
otherChunk.modules.length = 0;
otherChunk.parents.forEach(parentChunk => parentChunk.replaceChunk(otherChunk, this));
otherChunk.parents.length = 0;
otherChunk.chunks.forEach(chunk => chunk.replaceParentChunk(otherChunk, this));
otherChunk.chunks.length = 0;
otherChunk.blocks.forEach(b => {
b.chunks = b.chunks ? b.chunks.map(c => {
return c === otherChunk ? this : c;
}) : [this];
b.chunkReason = reason;
this.addBlock(b);
});
otherChunk.blocks.length = 0;
otherChunk.origins.forEach(origin => {
this.origins.push(origin);
});
this.origins.forEach(origin => {
if(!origin.reasons) {
origin.reasons = [reason];
} else if(origin.reasons[0] !== reason) {
origin.reasons.unshift(reason);
}
});
this.chunks = this.chunks.filter(chunk => {
return chunk !== otherChunk && chunk !== this;
});
this.parents = this.parents.filter(parentChunk => {
return parentChunk !== otherChunk && parentChunk !== this;
});
return true;
}
split(newChunk) {
this.blocks.forEach(block => {
newChunk.blocks.push(block);
block.chunks.push(newChunk);
});
this.chunks.forEach(chunk => {
newChunk.chunks.push(chunk);
chunk.parents.push(newChunk);
});
this.parents.forEach(parentChunk => {
parentChunk.chunks.push(newChunk);
newChunk.parents.push(parentChunk);
});
this.entrypoints.forEach(entrypoint => {
entrypoint.insertChunk(newChunk, this);
});
}
isEmpty() {
return this.modules.length === 0;
}
updateHash(hash) {
hash.update(`${this.id} `);
hash.update(this.ids ? this.ids.join(",") : "");
hash.update(`${this.name || ""} `);
this.modules.forEach(m => m.updateHash(hash));
}
canBeIntegrated(otherChunk) {
if(otherChunk.isInitial()) {
return false;
}
if(this.isInitial()) {
if(otherChunk.parents.length !== 1 || otherChunk.parents[0] !== this) {
return false;
}
}
return true;
}
addMultiplierAndOverhead(size, options) {
const overhead = typeof options.chunkOverhead === "number" ? options.chunkOverhead : 10000;
const multiplicator = this.isInitial() ? (options.entryChunkMultiplicator || 10) : 1;
return size * multiplicator + overhead;
}
modulesSize() {
let count = 0;
for(let i = 0; i < this.modules.length; i++) {
count += this.modules[i].size();
}
return count;
}
size(options) {
return this.addMultiplierAndOverhead(this.modulesSize(), options);
}
integratedSize(otherChunk, options) {
// Chunk if it's possible to integrate this chunk
if(!this.canBeIntegrated(otherChunk)) {
return false;
}
let integratedModulesSize = this.modulesSize();
// only count modules that do not exist in this chunk!
for(let i = 0; i < otherChunk.modules.length; i++) {
const otherModule = otherChunk.modules[i];
if(this.modules.indexOf(otherModule) === -1) {
integratedModulesSize += otherModule.size();
}
}
return this.addMultiplierAndOverhead(integratedModulesSize, options);
}
getChunkMaps(includeEntries, realHash) {
const chunksProcessed = [];
const chunkHashMap = {};
const chunkNameMap = {};
(function addChunk(chunk) {
if(chunksProcessed.indexOf(chunk) >= 0) return;
chunksProcessed.push(chunk);
if(!chunk.hasRuntime() || includeEntries) {
chunkHashMap[chunk.id] = realHash ? chunk.hash : chunk.renderedHash;
if(chunk.name)
chunkNameMap[chunk.id] = chunk.name;
}
chunk.chunks.forEach(addChunk);
}(this));
return {
hash: chunkHashMap,
name: chunkNameMap
};
}
sortItems() {
this.modules.sort(byId);
this.origins.sort((a, b) => {
const aIdent = a.module.identifier();
const bIdent = b.module.identifier();
if(aIdent < bIdent) return -1;
if(aIdent > bIdent) return 1;
return compareLocations(a.loc, b.loc);
});
this.origins.forEach(origin => {
if(origin.reasons)
origin.reasons.sort();
});
this.parents.sort(byId);
this.chunks.sort(byId);
}
toString() {
return `Chunk[${this.modules.join()}]`;
}
checkConstraints() {
const chunk = this;
chunk.chunks.forEach((child, idx) => {
if(chunk.chunks.indexOf(child) !== idx)
throw new Error(`checkConstraints: duplicate child in chunk ${chunk.debugId} ${child.debugId}`);
if(child.parents.indexOf(chunk) < 0)
throw new Error(`checkConstraints: child missing parent ${chunk.debugId} -> ${child.debugId}`);
});
chunk.parents.forEach((parentChunk, idx) => {
if(chunk.parents.indexOf(parentChunk) !== idx)
throw new Error(`checkConstraints: duplicate parent in chunk ${chunk.debugId} ${parentChunk.debugId}`);
if(parentChunk.chunks.indexOf(chunk) < 0)
throw new Error(`checkConstraints: parent missing child ${parentChunk.debugId} <- ${chunk.debugId}`);
});
}
}
module.exports = Chunk;

24
web/node_modules/webpack/lib/ChunkRenderError.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const WebpackError = require("./WebpackError");
class ChunkRenderError extends WebpackError {
constructor(chunk, file, error) {
super();
this.name = "ChunkRenderError";
this.error = error;
this.message = error.message;
this.details = error.stack;
this.file = file;
this.chunk = chunk;
Error.captureStackTrace(this, this.constructor);
}
}
module.exports = ChunkRenderError;

36
web/node_modules/webpack/lib/ChunkTemplate.js generated vendored Normal file
View File

@@ -0,0 +1,36 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ConcatSource = require("webpack-sources").ConcatSource;
const Template = require("./Template");
module.exports = class ChunkTemplate extends Template {
constructor(outputOptions) {
super(outputOptions);
}
render(chunk, moduleTemplate, dependencyTemplates) {
const moduleSources = this.renderChunkModules(chunk, moduleTemplate, dependencyTemplates);
const core = this.applyPluginsWaterfall("modules", moduleSources, chunk, moduleTemplate, dependencyTemplates);
let source = this.applyPluginsWaterfall("render", core, chunk, moduleTemplate, dependencyTemplates);
if(chunk.hasEntryModule()) {
source = this.applyPluginsWaterfall("render-with-entry", source, chunk);
}
chunk.rendered = true;
return new ConcatSource(source, ";");
}
updateHash(hash) {
hash.update("ChunkTemplate");
hash.update("2");
this.applyPlugins("hash", hash);
}
updateHashForChunk(hash, chunk) {
this.updateHash(hash);
this.applyPlugins("hash-for-chunk", hash, chunk);
}
};

57
web/node_modules/webpack/lib/CompatibilityPlugin.js generated vendored Normal file
View File

@@ -0,0 +1,57 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ConstDependency = require("./dependencies/ConstDependency");
const NullFactory = require("./NullFactory");
const jsonLoaderPath = require.resolve("json-loader");
const matchJson = /\.json$/i;
class CompatibilityPlugin {
apply(compiler) {
compiler.plugin("compilation", (compilation, params) => {
compilation.dependencyFactories.set(ConstDependency, new NullFactory());
compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());
params.normalModuleFactory.plugin("parser", (parser, parserOptions) => {
if(typeof parserOptions.browserify !== "undefined" && !parserOptions.browserify)
return;
parser.plugin("call require", (expr) => {
// support for browserify style require delegator: "require(o, !0)"
if(expr.arguments.length !== 2) return;
const second = parser.evaluateExpression(expr.arguments[1]);
if(!second.isBoolean()) return;
if(second.asBool() !== true) return;
const dep = new ConstDependency("require", expr.callee.range);
dep.loc = expr.loc;
if(parser.state.current.dependencies.length > 1) {
const last = parser.state.current.dependencies[parser.state.current.dependencies.length - 1];
if(last.critical && last.request === "." && last.userRequest === "." && last.recursive)
parser.state.current.dependencies.pop();
}
parser.state.current.addDependency(dep);
return true;
});
});
params.normalModuleFactory.plugin("after-resolve", (data, done) => {
// if this is a json file and there are no loaders active, we use the json-loader in order to avoid parse errors
// @see https://github.com/webpack/webpack/issues/3363
if(matchJson.test(data.request) && data.loaders.length === 0) {
data.loaders.push({
loader: jsonLoaderPath
});
}
done(null, data);
});
});
}
}
module.exports = CompatibilityPlugin;

1247
web/node_modules/webpack/lib/Compilation.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

504
web/node_modules/webpack/lib/Compiler.js generated vendored Normal file
View File

@@ -0,0 +1,504 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
var path = require("path");
var Tapable = require("tapable");
var Compilation = require("./Compilation");
var Stats = require("./Stats");
var NormalModuleFactory = require("./NormalModuleFactory");
var ContextModuleFactory = require("./ContextModuleFactory");
function Watching(compiler, watchOptions, handler) {
this.startTime = null;
this.invalid = false;
this.handler = handler;
this.closed = false;
if(typeof watchOptions === "number") {
this.watchOptions = {
aggregateTimeout: watchOptions
};
} else if(watchOptions && typeof watchOptions === "object") {
this.watchOptions = Object.assign({}, watchOptions);
} else {
this.watchOptions = {};
}
this.watchOptions.aggregateTimeout = this.watchOptions.aggregateTimeout || 200;
this.compiler = compiler;
this.running = true;
this.compiler.readRecords(function(err) {
if(err) return this._done(err);
this._go();
}.bind(this));
}
Watching.prototype._go = function() {
var self = this;
self.startTime = Date.now();
self.running = true;
self.invalid = false;
self.compiler.applyPluginsAsync("watch-run", self, function(err) {
if(err) return self._done(err);
self.compiler.compile(function onCompiled(err, compilation) {
if(err) return self._done(err);
if(self.invalid) return self._done();
if(self.compiler.applyPluginsBailResult("should-emit", compilation) === false) {
return self._done(null, compilation);
}
self.compiler.emitAssets(compilation, function(err) {
if(err) return self._done(err);
if(self.invalid) return self._done();
self.compiler.emitRecords(function(err) {
if(err) return self._done(err);
if(compilation.applyPluginsBailResult("need-additional-pass")) {
compilation.needAdditionalPass = true;
var stats = new Stats(compilation);
stats.startTime = self.startTime;
stats.endTime = Date.now();
self.compiler.applyPlugins("done", stats);
self.compiler.applyPluginsAsync("additional-pass", function(err) {
if(err) return self._done(err);
self.compiler.compile(onCompiled);
});
return;
}
return self._done(null, compilation);
});
});
});
});
};
Watching.prototype._getStats = function(compilation) {
var stats = new Stats(compilation);
stats.startTime = this.startTime;
stats.endTime = Date.now();
return stats;
};
Watching.prototype._done = function(err, compilation) {
this.running = false;
if(this.invalid) return this._go();
var stats = compilation ? this._getStats(compilation) : null;
if(err) {
this.compiler.applyPlugins("failed", err);
this.handler(err, stats);
return;
}
this.compiler.applyPlugins("done", stats);
this.handler(null, stats);
if(!this.closed) {
this.watch(compilation.fileDependencies, compilation.contextDependencies, compilation.missingDependencies);
}
};
Watching.prototype.watch = function(files, dirs, missing) {
this.pausedWatcher = null;
this.watcher = this.compiler.watchFileSystem.watch(files, dirs, missing, this.startTime, this.watchOptions, function(err, filesModified, contextModified, missingModified, fileTimestamps, contextTimestamps) {
this.pausedWatcher = this.watcher;
this.watcher = null;
if(err) return this.handler(err);
this.compiler.fileTimestamps = fileTimestamps;
this.compiler.contextTimestamps = contextTimestamps;
this.invalidate();
}.bind(this), function(fileName, changeTime) {
this.compiler.applyPlugins("invalid", fileName, changeTime);
}.bind(this));
};
Watching.prototype.invalidate = function() {
if(this.watcher) {
this.pausedWatcher = this.watcher;
this.watcher.pause();
this.watcher = null;
}
if(this.running) {
this.invalid = true;
return false;
} else {
this._go();
}
};
Watching.prototype.close = function(callback) {
if(callback === undefined) callback = function() {};
this.closed = true;
if(this.watcher) {
this.watcher.close();
this.watcher = null;
}
if(this.pausedWatcher) {
this.pausedWatcher.close();
this.pausedWatcher = null;
}
if(this.running) {
this.invalid = true;
this._done = () => {
this.compiler.applyPlugins("watch-close");
callback();
};
} else {
this.compiler.applyPlugins("watch-close");
callback();
}
};
function Compiler() {
Tapable.call(this);
this.outputPath = "";
this.outputFileSystem = null;
this.inputFileSystem = null;
this.recordsInputPath = null;
this.recordsOutputPath = null;
this.records = {};
this.fileTimestamps = {};
this.contextTimestamps = {};
this.resolvers = {
normal: null,
loader: null,
context: null
};
var deprecationReported = false;
this.parser = {
plugin: function(hook, fn) {
if(!deprecationReported) {
console.warn("webpack: Using compiler.parser is deprecated.\n" +
"Use compiler.plugin(\"compilation\", function(compilation, data) {\n data.normalModuleFactory.plugin(\"parser\", function(parser, options) { parser.plugin(/* ... */); });\n}); instead. " +
"It was called " + new Error().stack.split("\n")[2].trim() + ".");
deprecationReported = true;
}
this.plugin("compilation", function(compilation, data) {
data.normalModuleFactory.plugin("parser", function(parser) {
parser.plugin(hook, fn);
});
});
}.bind(this),
apply: function() {
var args = arguments;
if(!deprecationReported) {
console.warn("webpack: Using compiler.parser is deprecated.\n" +
"Use compiler.plugin(\"compilation\", function(compilation, data) {\n data.normalModuleFactory.plugin(\"parser\", function(parser, options) { parser.apply(/* ... */); });\n}); instead. " +
"It was called " + new Error().stack.split("\n")[2].trim() + ".");
deprecationReported = true;
}
this.plugin("compilation", function(compilation, data) {
data.normalModuleFactory.plugin("parser", function(parser) {
parser.apply.apply(parser, args);
});
});
}.bind(this)
};
this.options = {};
}
module.exports = Compiler;
Compiler.prototype = Object.create(Tapable.prototype);
Compiler.prototype.constructor = Compiler;
Compiler.Watching = Watching;
Compiler.prototype.watch = function(watchOptions, handler) {
this.fileTimestamps = {};
this.contextTimestamps = {};
var watching = new Watching(this, watchOptions, handler);
return watching;
};
Compiler.prototype.run = function(callback) {
var self = this;
var startTime = Date.now();
self.applyPluginsAsync("before-run", self, function(err) {
if(err) return callback(err);
self.applyPluginsAsync("run", self, function(err) {
if(err) return callback(err);
self.readRecords(function(err) {
if(err) return callback(err);
self.compile(function onCompiled(err, compilation) {
if(err) return callback(err);
if(self.applyPluginsBailResult("should-emit", compilation) === false) {
var stats = new Stats(compilation);
stats.startTime = startTime;
stats.endTime = Date.now();
self.applyPlugins("done", stats);
return callback(null, stats);
}
self.emitAssets(compilation, function(err) {
if(err) return callback(err);
if(compilation.applyPluginsBailResult("need-additional-pass")) {
compilation.needAdditionalPass = true;
var stats = new Stats(compilation);
stats.startTime = startTime;
stats.endTime = Date.now();
self.applyPlugins("done", stats);
self.applyPluginsAsync("additional-pass", function(err) {
if(err) return callback(err);
self.compile(onCompiled);
});
return;
}
self.emitRecords(function(err) {
if(err) return callback(err);
var stats = new Stats(compilation);
stats.startTime = startTime;
stats.endTime = Date.now();
self.applyPlugins("done", stats);
return callback(null, stats);
});
});
});
});
});
});
};
Compiler.prototype.runAsChild = function(callback) {
this.compile(function(err, compilation) {
if(err) return callback(err);
this.parentCompilation.children.push(compilation);
Object.keys(compilation.assets).forEach(function(name) {
this.parentCompilation.assets[name] = compilation.assets[name];
}.bind(this));
var entries = Object.keys(compilation.entrypoints).map(function(name) {
return compilation.entrypoints[name].chunks;
}).reduce(function(array, chunks) {
return array.concat(chunks);
}, []);
return callback(null, entries, compilation);
}.bind(this));
};
Compiler.prototype.purgeInputFileSystem = function() {
if(this.inputFileSystem && this.inputFileSystem.purge)
this.inputFileSystem.purge();
};
Compiler.prototype.emitAssets = function(compilation, callback) {
var outputPath;
this.applyPluginsAsync("emit", compilation, function(err) {
if(err) return callback(err);
outputPath = compilation.getPath(this.outputPath);
this.outputFileSystem.mkdirp(outputPath, emitFiles.bind(this));
}.bind(this));
function emitFiles(err) {
if(err) return callback(err);
require("async").forEach(Object.keys(compilation.assets), function(file, callback) {
var targetFile = file;
var queryStringIdx = targetFile.indexOf("?");
if(queryStringIdx >= 0) {
targetFile = targetFile.substr(0, queryStringIdx);
}
if(targetFile.match(/\/|\\/)) {
var dir = path.dirname(targetFile);
this.outputFileSystem.mkdirp(this.outputFileSystem.join(outputPath, dir), writeOut.bind(this));
} else writeOut.call(this);
function writeOut(err) {
if(err) return callback(err);
var targetPath = this.outputFileSystem.join(outputPath, targetFile);
var source = compilation.assets[file];
if(source.existsAt === targetPath) {
source.emitted = false;
return callback();
}
var content = source.source();
if(!Buffer.isBuffer(content)) {
content = new Buffer(content, "utf8"); //eslint-disable-line
}
source.existsAt = targetPath;
source.emitted = true;
this.outputFileSystem.writeFile(targetPath, content, callback);
}
}.bind(this), function(err) {
if(err) return callback(err);
afterEmit.call(this);
}.bind(this));
}
function afterEmit() {
this.applyPluginsAsyncSeries1("after-emit", compilation, function(err) {
if(err) return callback(err);
return callback();
});
}
};
Compiler.prototype.emitRecords = function emitRecords(callback) {
if(!this.recordsOutputPath) return callback();
var idx1 = this.recordsOutputPath.lastIndexOf("/");
var idx2 = this.recordsOutputPath.lastIndexOf("\\");
var recordsOutputPathDirectory = null;
if(idx1 > idx2) recordsOutputPathDirectory = this.recordsOutputPath.substr(0, idx1);
if(idx1 < idx2) recordsOutputPathDirectory = this.recordsOutputPath.substr(0, idx2);
if(!recordsOutputPathDirectory) return writeFile.call(this);
this.outputFileSystem.mkdirp(recordsOutputPathDirectory, function(err) {
if(err) return callback(err);
writeFile.call(this);
}.bind(this));
function writeFile() {
this.outputFileSystem.writeFile(this.recordsOutputPath, JSON.stringify(this.records, undefined, 2), callback);
}
};
Compiler.prototype.readRecords = function readRecords(callback) {
var self = this;
if(!self.recordsInputPath) {
self.records = {};
return callback();
}
self.inputFileSystem.stat(self.recordsInputPath, function(err) {
// It doesn't exist
// We can ignore self.
if(err) return callback();
self.inputFileSystem.readFile(self.recordsInputPath, function(err, content) {
if(err) return callback(err);
try {
self.records = JSON.parse(content.toString("utf-8"));
} catch(e) {
e.message = "Cannot parse records: " + e.message;
return callback(e);
}
return callback();
});
});
};
Compiler.prototype.createChildCompiler = function(compilation, compilerName, outputOptions, plugins) {
var childCompiler = new Compiler();
if(Array.isArray(plugins)) {
plugins.forEach(plugin => childCompiler.apply(plugin));
}
for(var name in this._plugins) {
if(["make", "compile", "emit", "after-emit", "invalid", "done", "this-compilation"].indexOf(name) < 0)
childCompiler._plugins[name] = this._plugins[name].slice();
}
childCompiler.name = compilerName;
childCompiler.outputPath = this.outputPath;
childCompiler.inputFileSystem = this.inputFileSystem;
childCompiler.outputFileSystem = null;
childCompiler.resolvers = this.resolvers;
childCompiler.fileTimestamps = this.fileTimestamps;
childCompiler.contextTimestamps = this.contextTimestamps;
if(!this.records[compilerName]) this.records[compilerName] = [];
this.records[compilerName].push(childCompiler.records = {});
childCompiler.options = Object.create(this.options);
childCompiler.options.output = Object.create(childCompiler.options.output);
for(name in outputOptions) {
childCompiler.options.output[name] = outputOptions[name];
}
childCompiler.parentCompilation = compilation;
return childCompiler;
};
Compiler.prototype.isChild = function() {
return !!this.parentCompilation;
};
Compiler.prototype.createCompilation = function() {
return new Compilation(this);
};
Compiler.prototype.newCompilation = function(params) {
var compilation = this.createCompilation();
compilation.fileTimestamps = this.fileTimestamps;
compilation.contextTimestamps = this.contextTimestamps;
compilation.name = this.name;
compilation.records = this.records;
compilation.compilationDependencies = params.compilationDependencies;
this.applyPlugins("this-compilation", compilation, params);
this.applyPlugins("compilation", compilation, params);
return compilation;
};
Compiler.prototype.createNormalModuleFactory = function() {
var normalModuleFactory = new NormalModuleFactory(this.options.context, this.resolvers, this.options.module || {});
this.applyPlugins("normal-module-factory", normalModuleFactory);
return normalModuleFactory;
};
Compiler.prototype.createContextModuleFactory = function() {
var contextModuleFactory = new ContextModuleFactory(this.resolvers, this.inputFileSystem);
this.applyPlugins("context-module-factory", contextModuleFactory);
return contextModuleFactory;
};
Compiler.prototype.newCompilationParams = function() {
var params = {
normalModuleFactory: this.createNormalModuleFactory(),
contextModuleFactory: this.createContextModuleFactory(),
compilationDependencies: []
};
return params;
};
Compiler.prototype.compile = function(callback) {
var self = this;
var params = self.newCompilationParams();
self.applyPluginsAsync("before-compile", params, function(err) {
if(err) return callback(err);
self.applyPlugins("compile", params);
var compilation = self.newCompilation(params);
self.applyPluginsParallel("make", compilation, function(err) {
if(err) return callback(err);
compilation.finish();
compilation.seal(function(err) {
if(err) return callback(err);
self.applyPluginsAsync("after-compile", compilation, function(err) {
if(err) return callback(err);
return callback(null, compilation);
});
});
});
});
};

60
web/node_modules/webpack/lib/ConstPlugin.js generated vendored Normal file
View File

@@ -0,0 +1,60 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ConstDependency = require("./dependencies/ConstDependency");
const NullFactory = require("./NullFactory");
const ParserHelpers = require("./ParserHelpers");
const getQuery = (request) => {
const i = request.indexOf("?");
return request.indexOf("?") < 0 ? "" : request.substr(i);
};
class ConstPlugin {
apply(compiler) {
compiler.plugin("compilation", (compilation, params) => {
compilation.dependencyFactories.set(ConstDependency, new NullFactory());
compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());
params.normalModuleFactory.plugin("parser", parser => {
parser.plugin("statement if", function(statement) {
const param = this.evaluateExpression(statement.test);
const bool = param.asBool();
if(typeof bool === "boolean") {
if(statement.test.type !== "Literal") {
const dep = new ConstDependency(`${bool}`, param.range);
dep.loc = statement.loc;
this.state.current.addDependency(dep);
}
return bool;
}
});
parser.plugin("expression ?:", function(expression) {
const param = this.evaluateExpression(expression.test);
const bool = param.asBool();
if(typeof bool === "boolean") {
if(expression.test.type !== "Literal") {
const dep = new ConstDependency(` ${bool}`, param.range);
dep.loc = expression.loc;
this.state.current.addDependency(dep);
}
return bool;
}
});
parser.plugin("evaluate Identifier __resourceQuery", function(expr) {
if(!this.state.module) return;
return ParserHelpers.evaluateToString(getQuery(this.state.module.resource))(expr);
});
parser.plugin("expression __resourceQuery", function() {
if(!this.state.module) return;
this.state.current.addVariable("__resourceQuery", JSON.stringify(getQuery(this.state.module.resource)));
return true;
});
});
});
}
}
module.exports = ConstPlugin;

357
web/node_modules/webpack/lib/ContextModule.js generated vendored Normal file
View File

@@ -0,0 +1,357 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const path = require("path");
const Module = require("./Module");
const OriginalSource = require("webpack-sources").OriginalSource;
const RawSource = require("webpack-sources").RawSource;
const AsyncDependenciesBlock = require("./AsyncDependenciesBlock");
const DepBlockHelpers = require("./dependencies/DepBlockHelpers");
const Template = require("./Template");
class ContextModule extends Module {
constructor(resolveDependencies, context, recursive, regExp, addon, asyncMode, chunkName) {
super();
this.resolveDependencies = resolveDependencies;
this.context = context;
this.recursive = recursive;
this.regExp = regExp;
this.addon = addon;
this.async = asyncMode;
this.cacheable = true;
this.contextDependencies = [context];
this.built = false;
this.chunkName = chunkName;
}
prettyRegExp(regexString) {
// remove the "/" at the front and the beginning
// "/foo/" -> "foo"
return regexString.substring(1, regexString.length - 1);
}
contextify(context, request) {
return request.split("!").map(subrequest => {
let rp = path.relative(context, subrequest);
if(path.sep === "\\")
rp = rp.replace(/\\/g, "/");
if(rp.indexOf("../") !== 0)
rp = "./" + rp;
return rp;
}).join("!");
}
identifier() {
let identifier = this.context;
if(this.async)
identifier += ` ${this.async}`;
if(!this.recursive)
identifier += " nonrecursive";
if(this.addon)
identifier += ` ${this.addon}`;
if(this.regExp)
identifier += ` ${this.regExp}`;
return identifier;
}
readableIdentifier(requestShortener) {
let identifier = requestShortener.shorten(this.context);
if(this.async)
identifier += ` ${this.async}`;
if(!this.recursive)
identifier += " nonrecursive";
if(this.addon)
identifier += ` ${requestShortener.shorten(this.addon)}`;
if(this.regExp)
identifier += ` ${this.prettyRegExp(this.regExp + "")}`;
return identifier;
}
libIdent(options) {
let identifier = this.contextify(options.context, this.context);
if(this.async)
identifier += ` ${this.async}`;
if(this.recursive)
identifier += " recursive";
if(this.addon)
identifier += ` ${this.contextify(options.context, this.addon)}`;
if(this.regExp)
identifier += ` ${this.prettyRegExp(this.regExp + "")}`;
return identifier;
}
needRebuild(fileTimestamps, contextTimestamps) {
const ts = contextTimestamps[this.context];
if(!ts) {
return true;
}
return ts >= this.builtTime;
}
unbuild() {
this.built = false;
super.unbuild();
}
build(options, compilation, resolver, fs, callback) {
this.built = true;
this.builtTime = Date.now();
this.resolveDependencies(fs, this.context, this.recursive, this.regExp, (err, dependencies) => {
if(err) return callback(err);
// Reset children
this.dependencies = [];
this.blocks = [];
// abort if something failed
// this will create an empty context
if(!dependencies) {
callback();
return;
}
// enhance dependencies with meta info
dependencies.forEach(dep => {
dep.loc = dep.userRequest;
dep.request = this.addon + dep.request;
});
if(!this.async || this.async === "eager") {
// if we have an sync or eager context
// just add all dependencies and continue
this.dependencies = dependencies;
} else if(this.async === "lazy-once") {
// for the lazy-once mode create a new async dependency block
// and add that block to this context
if(dependencies.length > 0) {
const block = new AsyncDependenciesBlock(this.chunkName, this);
dependencies.forEach(dep => {
block.addDependency(dep);
});
this.addBlock(block);
}
} else {
// if we are lazy create a new async dependency block per dependency
// and add all blocks to this context
dependencies.forEach((dep, idx) => {
let chunkName = this.chunkName;
if(chunkName) {
if(!/\[(index|request)\]/.test(chunkName))
chunkName += "[index]";
chunkName = chunkName.replace(/\[index\]/g, idx);
chunkName = chunkName.replace(/\[request\]/g, Template.toPath(dep.userRequest));
}
const block = new AsyncDependenciesBlock(chunkName, dep.module, dep.loc);
block.addDependency(dep);
this.addBlock(block);
});
}
callback();
});
}
getUserRequestMap(dependencies) {
// if we filter first we get a new array
// therefor we dont need to create a clone of dependencies explicitly
// therefore the order of this is !important!
return dependencies
.filter(dependency => dependency.module)
.sort((a, b) => {
if(a.userRequest === b.userRequest) {
return 0;
}
return a.userRequest < b.userRequest ? -1 : 1;
}).reduce(function(map, dep) {
map[dep.userRequest] = dep.module.id;
return map;
}, Object.create(null));
}
getSyncSource(dependencies, id) {
const map = this.getUserRequestMap(dependencies);
return `var map = ${JSON.stringify(map, null, "\t")};
function webpackContext(req) {
return __webpack_require__(webpackContextResolve(req));
};
function webpackContextResolve(req) {
var id = map[req];
if(!(id + 1)) // check for number or string
throw new Error("Cannot find module '" + req + "'.");
return id;
};
webpackContext.keys = function webpackContextKeys() {
return Object.keys(map);
};
webpackContext.resolve = webpackContextResolve;
module.exports = webpackContext;
webpackContext.id = ${JSON.stringify(id)};`;
}
getEagerSource(dependencies, id) {
const map = this.getUserRequestMap(dependencies);
return `var map = ${JSON.stringify(map, null, "\t")};
function webpackAsyncContext(req) {
return webpackAsyncContextResolve(req).then(__webpack_require__);
};
function webpackAsyncContextResolve(req) {
return new Promise(function(resolve, reject) {
var id = map[req];
if(!(id + 1)) // check for number or string
reject(new Error("Cannot find module '" + req + "'."));
else
resolve(id);
});
};
webpackAsyncContext.keys = function webpackAsyncContextKeys() {
return Object.keys(map);
};
webpackAsyncContext.resolve = webpackAsyncContextResolve;
module.exports = webpackAsyncContext;
webpackAsyncContext.id = ${JSON.stringify(id)};`;
}
getLazyOnceSource(block, dependencies, id, outputOptions, requestShortener) {
const promise = DepBlockHelpers.getDepBlockPromise(block, outputOptions, requestShortener, "lazy-once context");
const map = this.getUserRequestMap(dependencies);
return `var map = ${JSON.stringify(map, null, "\t")};
function webpackAsyncContext(req) {
return webpackAsyncContextResolve(req).then(__webpack_require__);
};
function webpackAsyncContextResolve(req) {
return ${promise}.then(function() {
var id = map[req];
if(!(id + 1)) // check for number or string
throw new Error("Cannot find module '" + req + "'.");
return id;
});
};
webpackAsyncContext.keys = function webpackAsyncContextKeys() {
return Object.keys(map);
};
webpackAsyncContext.resolve = webpackAsyncContextResolve;
module.exports = webpackAsyncContext;
webpackAsyncContext.id = ${JSON.stringify(id)};`;
}
getLazySource(blocks, id) {
let hasMultipleOrNoChunks = false;
const map = blocks
.filter(block => block.dependencies[0].module)
.map((block) => ({
dependency: block.dependencies[0],
block: block,
userRequest: block.dependencies[0].userRequest
})).sort((a, b) => {
if(a.userRequest === b.userRequest) return 0;
return a.userRequest < b.userRequest ? -1 : 1;
}).reduce((map, item) => {
const chunks = item.block.chunks || [];
if(chunks.length !== 1) {
hasMultipleOrNoChunks = true;
}
map[item.userRequest] = [item.dependency.module.id]
.concat(chunks.map(chunk => chunk.id));
return map;
}, Object.create(null));
const requestPrefix = hasMultipleOrNoChunks ?
"Promise.all(ids.slice(1).map(__webpack_require__.e))" :
"__webpack_require__.e(ids[1])";
return `var map = ${JSON.stringify(map, null, "\t")};
function webpackAsyncContext(req) {
var ids = map[req];
if(!ids)
return Promise.reject(new Error("Cannot find module '" + req + "'."));
return ${requestPrefix}.then(function() {
return __webpack_require__(ids[0]);
});
};
webpackAsyncContext.keys = function webpackAsyncContextKeys() {
return Object.keys(map);
};
module.exports = webpackAsyncContext;
webpackAsyncContext.id = ${JSON.stringify(id)};`;
}
getSourceForEmptyContext(id) {
return `function webpackEmptyContext(req) {
throw new Error("Cannot find module '" + req + "'.");
}
webpackEmptyContext.keys = function() { return []; };
webpackEmptyContext.resolve = webpackEmptyContext;
module.exports = webpackEmptyContext;
webpackEmptyContext.id = ${JSON.stringify(id)};`;
}
getSourceForEmptyAsyncContext(id) {
return `function webpackEmptyAsyncContext(req) {
return new Promise(function(resolve, reject) { reject(new Error("Cannot find module '" + req + "'.")); });
}
webpackEmptyAsyncContext.keys = function() { return []; };
webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
module.exports = webpackEmptyAsyncContext;
webpackEmptyAsyncContext.id = ${JSON.stringify(id)};`;
}
getSourceString(asyncMode, outputOptions, requestShortener) {
if(asyncMode === "lazy") {
if(this.blocks && this.blocks.length > 0) {
return this.getLazySource(this.blocks, this.id);
}
return this.getSourceForEmptyAsyncContext(this.id);
}
if(asyncMode === "eager") {
if(this.dependencies && this.dependencies.length > 0) {
return this.getEagerSource(this.dependencies, this.id);
}
return this.getSourceForEmptyAsyncContext(this.id);
} else if(asyncMode === "lazy-once") {
const block = this.blocks[0];
if(block) {
return this.getLazyOnceSource(block, block.dependencies, this.id, outputOptions, requestShortener);
}
return this.getSourceForEmptyAsyncContext(this.id);
}
if(this.dependencies && this.dependencies.length > 0) {
return this.getSyncSource(this.dependencies, this.id);
}
return this.getSourceForEmptyContext(this.id);
}
getSource(sourceString) {
if(this.useSourceMap) {
return new OriginalSource(sourceString, this.identifier());
}
return new RawSource(sourceString);
}
source(dependencyTemplates, outputOptions, requestShortener) {
return this.getSource(
this.getSourceString(this.async, outputOptions, requestShortener)
);
}
size() {
// base penalty
const initialSize = 160;
// if we dont have dependencies we stop here.
return this.dependencies
.reduce((size, dependency) => size + 5 + dependency.userRequest.length, initialSize);
}
}
module.exports = ContextModule;

159
web/node_modules/webpack/lib/ContextModuleFactory.js generated vendored Normal file
View File

@@ -0,0 +1,159 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
var asyncLib = require("async");
var path = require("path");
var Tapable = require("tapable");
var ContextModule = require("./ContextModule");
var ContextElementDependency = require("./dependencies/ContextElementDependency");
function ContextModuleFactory(resolvers) {
Tapable.call(this);
this.resolvers = resolvers;
}
module.exports = ContextModuleFactory;
ContextModuleFactory.prototype = Object.create(Tapable.prototype);
ContextModuleFactory.prototype.constructor = ContextModuleFactory;
ContextModuleFactory.prototype.create = function(data, callback) {
var module = this;
var context = data.context;
var dependencies = data.dependencies;
var dependency = dependencies[0];
this.applyPluginsAsyncWaterfall("before-resolve", {
context: context,
request: dependency.request,
recursive: dependency.recursive,
regExp: dependency.regExp,
async: dependency.async,
dependencies: dependencies
}, function(err, result) {
if(err) return callback(err);
// Ignored
if(!result) return callback();
var context = result.context;
var request = result.request;
var recursive = result.recursive;
var regExp = result.regExp;
var asyncContext = result.async;
var dependencies = result.dependencies;
var loaders, resource, loadersPrefix = "";
var idx = request.lastIndexOf("!");
if(idx >= 0) {
loaders = request.substr(0, idx + 1);
for(var i = 0; i < loaders.length && loaders[i] === "!"; i++) {
loadersPrefix += "!";
}
loaders = loaders.substr(i).replace(/!+$/, "").replace(/!!+/g, "!");
if(loaders === "") loaders = [];
else loaders = loaders.split("!");
resource = request.substr(idx + 1);
} else {
loaders = [];
resource = request;
}
var resolvers = module.resolvers;
asyncLib.parallel([
function(callback) {
resolvers.context.resolve({}, context, resource, function(err, result) {
if(err) return callback(err);
callback(null, result);
});
},
function(callback) {
asyncLib.map(loaders, function(loader, callback) {
resolvers.loader.resolve({}, context, loader, function(err, result) {
if(err) return callback(err);
callback(null, result);
});
}, callback);
}
], function(err, result) {
if(err) return callback(err);
module.applyPluginsAsyncWaterfall("after-resolve", {
loaders: loadersPrefix + result[1].join("!") + (result[1].length > 0 ? "!" : ""),
resource: result[0],
recursive: recursive,
regExp: regExp,
async: asyncContext,
dependencies: dependencies,
resolveDependencies: module.resolveDependencies.bind(module)
}, function(err, result) {
if(err) return callback(err);
// Ignored
if(!result) return callback();
return callback(null, new ContextModule(result.resolveDependencies, result.resource, result.recursive, result.regExp, result.loaders, result.async, dependency.chunkName));
});
});
});
};
ContextModuleFactory.prototype.resolveDependencies = function resolveDependencies(fs, resource, recursive, regExp, callback) {
if(!regExp || !resource)
return callback(null, []);
(function addDirectory(directory, callback) {
fs.readdir(directory, function(err, files) {
if(err) return callback(err);
if(!files || files.length === 0) return callback(null, []);
asyncLib.map(files.filter(function(p) {
return p.indexOf(".") !== 0;
}), function(seqment, callback) {
var subResource = path.join(directory, seqment);
fs.stat(subResource, function(err, stat) {
if(err) return callback(err);
if(stat.isDirectory()) {
if(!recursive) return callback();
addDirectory.call(this, subResource, callback);
} else if(stat.isFile()) {
var obj = {
context: resource,
request: "." + subResource.substr(resource.length).replace(/\\/g, "/")
};
this.applyPluginsAsyncWaterfall("alternatives", [obj], function(err, alternatives) {
if(err) return callback(err);
alternatives = alternatives.filter(function(obj) {
return regExp.test(obj.request);
}).map(function(obj) {
var dep = new ContextElementDependency(obj.request);
dep.optional = true;
return dep;
});
callback(null, alternatives);
});
} else callback();
}.bind(this));
}.bind(this), function(err, result) {
if(err) return callback(err);
if(!result) return callback(null, []);
callback(null, result.filter(function(i) {
return !!i;
}).reduce(function(a, i) {
return a.concat(i);
}, []));
});
}.bind(this));
}.call(this, resource, callback));
};

View File

@@ -0,0 +1,111 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const path = require("path");
const ContextElementDependency = require("./dependencies/ContextElementDependency");
class ContextReplacementPlugin {
constructor(resourceRegExp, newContentResource, newContentRecursive, newContentRegExp) {
this.resourceRegExp = resourceRegExp;
if(typeof newContentResource === "function") {
this.newContentCallback = newContentResource;
} else if(typeof newContentResource === "string" && typeof newContentRecursive === "object") {
this.newContentResource = newContentResource;
this.newContentCreateContextMap = (fs, callback) => {
callback(null, newContentRecursive);
};
} else if(typeof newContentResource === "string" && typeof newContentRecursive === "function") {
this.newContentResource = newContentResource;
this.newContentCreateContextMap = newContentRecursive;
} else {
if(typeof newContentResource !== "string") {
newContentRegExp = newContentRecursive;
newContentRecursive = newContentResource;
newContentResource = undefined;
}
if(typeof newContentRecursive !== "boolean") {
newContentRegExp = newContentRecursive;
newContentRecursive = undefined;
}
this.newContentResource = newContentResource;
this.newContentRecursive = newContentRecursive;
this.newContentRegExp = newContentRegExp;
}
}
apply(compiler) {
const resourceRegExp = this.resourceRegExp;
const newContentCallback = this.newContentCallback;
const newContentResource = this.newContentResource;
const newContentRecursive = this.newContentRecursive;
const newContentRegExp = this.newContentRegExp;
const newContentCreateContextMap = this.newContentCreateContextMap;
compiler.plugin("context-module-factory", (cmf) => {
cmf.plugin("before-resolve", (result, callback) => {
if(!result) return callback();
if(resourceRegExp.test(result.request)) {
if(typeof newContentResource !== "undefined")
result.request = newContentResource;
if(typeof newContentRecursive !== "undefined")
result.recursive = newContentRecursive;
if(typeof newContentRegExp !== "undefined")
result.regExp = newContentRegExp;
if(typeof newContentCallback === "function") {
newContentCallback(result);
} else {
result.dependencies.forEach((d) => {
if(d.critical)
d.critical = false;
});
}
}
return callback(null, result);
});
cmf.plugin("after-resolve", (result, callback) => {
if(!result) return callback();
if(resourceRegExp.test(result.resource)) {
if(typeof newContentResource !== "undefined")
result.resource = path.resolve(result.resource, newContentResource);
if(typeof newContentRecursive !== "undefined")
result.recursive = newContentRecursive;
if(typeof newContentRegExp !== "undefined")
result.regExp = newContentRegExp;
if(typeof newContentCreateContextMap === "function")
result.resolveDependencies = createResolveDependenciesFromContextMap(newContentCreateContextMap);
if(typeof newContentCallback === "function") {
const origResource = result.resource;
newContentCallback(result);
if(result.resource !== origResource) {
result.resource = path.resolve(origResource, result.resource);
}
} else {
result.dependencies.forEach((d) => {
if(d.critical)
d.critical = false;
});
}
}
return callback(null, result);
});
});
}
}
const createResolveDependenciesFromContextMap = (createContextMap) => {
return function resolveDependenciesFromContextMap(fs, resource, recursive, regExp, callback) {
createContextMap(fs, (err, map) => {
if(err) return callback(err);
const dependencies = Object.keys(map).map((key) => {
return new ContextElementDependency(map[key], key);
});
callback(null, dependencies);
});
};
};
module.exports = ContextReplacementPlugin;

123
web/node_modules/webpack/lib/DefinePlugin.js generated vendored Normal file
View File

@@ -0,0 +1,123 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ConstDependency = require("./dependencies/ConstDependency");
const BasicEvaluatedExpression = require("./BasicEvaluatedExpression");
const ParserHelpers = require("./ParserHelpers");
const NullFactory = require("./NullFactory");
class DefinePlugin {
constructor(definitions) {
this.definitions = definitions;
}
apply(compiler) {
const definitions = this.definitions;
compiler.plugin("compilation", (compilation, params) => {
compilation.dependencyFactories.set(ConstDependency, new NullFactory());
compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());
params.normalModuleFactory.plugin("parser", (parser) => {
(function walkDefinitions(definitions, prefix) {
Object.keys(definitions).forEach((key) => {
const code = definitions[key];
if(code && typeof code === "object" && !(code instanceof RegExp)) {
walkDefinitions(code, prefix + key + ".");
applyObjectDefine(prefix + key, code);
return;
}
applyDefineKey(prefix, key);
applyDefine(prefix + key, code);
});
}(definitions, ""));
function stringifyObj(obj) {
return "__webpack_require__.i({" + Object.keys(obj).map((key) => {
const code = obj[key];
return JSON.stringify(key) + ":" + toCode(code);
}).join(",") + "})";
}
function toCode(code) {
if(code === null) return "null";
else if(code === undefined) return "undefined";
else if(code instanceof RegExp && code.toString) return code.toString();
else if(typeof code === "function" && code.toString) return "(" + code.toString() + ")";
else if(typeof code === "object") return stringifyObj(code);
else return code + "";
}
function applyDefineKey(prefix, key) {
const splittedKey = key.split(".");
splittedKey.slice(1).forEach((_, i) => {
const fullKey = prefix + splittedKey.slice(0, i + 1).join(".");
parser.plugin("can-rename " + fullKey, ParserHelpers.approve);
});
}
function applyDefine(key, code) {
const isTypeof = /^typeof\s+/.test(key);
if(isTypeof) key = key.replace(/^typeof\s+/, "");
let recurse = false;
let recurseTypeof = false;
code = toCode(code);
if(!isTypeof) {
parser.plugin("can-rename " + key, ParserHelpers.approve);
parser.plugin("evaluate Identifier " + key, (expr) => {
/**
* this is needed in case there is a recursion in the DefinePlugin
* to prevent an endless recursion
* e.g.: new DefinePlugin({
* "a": "b",
* "b": "a"
* });
*/
if(recurse) return;
recurse = true;
const res = parser.evaluate(code);
recurse = false;
res.setRange(expr.range);
return res;
});
parser.plugin("expression " + key, ParserHelpers.toConstantDependency(code));
}
const typeofCode = isTypeof ? code : "typeof (" + code + ")";
parser.plugin("evaluate typeof " + key, (expr) => {
/**
* this is needed in case there is a recursion in the DefinePlugin
* to prevent an endless recursion
* e.g.: new DefinePlugin({
* "typeof a": "tyepof b",
* "typeof b": "typeof a"
* });
*/
if(recurseTypeof) return;
recurseTypeof = true;
const res = parser.evaluate(typeofCode);
recurseTypeof = false;
res.setRange(expr.range);
return res;
});
parser.plugin("typeof " + key, (expr) => {
const res = parser.evaluate(typeofCode);
if(!res.isString()) return;
return ParserHelpers.toConstantDependency(JSON.stringify(res.string)).bind(parser)(expr);
});
}
function applyObjectDefine(key, obj) {
const code = stringifyObj(obj);
parser.plugin("can-rename " + key, ParserHelpers.approve);
parser.plugin("evaluate Identifier " + key, (expr) => new BasicEvaluatedExpression().setRange(expr.range));
parser.plugin("evaluate typeof " + key, ParserHelpers.evaluateToString("object"));
parser.plugin("expression " + key, ParserHelpers.toConstantDependency(code));
parser.plugin("typeof " + key, ParserHelpers.toConstantDependency(JSON.stringify("object")));
}
});
});
}
}
module.exports = DefinePlugin;

86
web/node_modules/webpack/lib/DelegatedModule.js generated vendored Normal file
View File

@@ -0,0 +1,86 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Module = require("./Module");
const OriginalSource = require("webpack-sources").OriginalSource;
const RawSource = require("webpack-sources").RawSource;
const WebpackMissingModule = require("./dependencies/WebpackMissingModule");
const DelegatedSourceDependency = require("./dependencies/DelegatedSourceDependency");
class DelegatedModule extends Module {
constructor(sourceRequest, data, type, userRequest) {
super();
this.sourceRequest = sourceRequest;
this.request = data.id;
this.meta = data.meta;
this.type = type;
this.userRequest = userRequest;
this.built = false;
this.delegated = true;
this.delegateData = data;
}
identifier() {
return `delegated ${JSON.stringify(this.request)} from ${this.sourceRequest}`;
}
readableIdentifier() {
return `delegated ${this.userRequest} from ${this.sourceRequest}`;
}
needRebuild() {
return false;
}
build(options, compilation, resolver, fs, callback) {
this.built = true;
this.builtTime = Date.now();
this.usedExports = true;
this.providedExports = this.delegateData.exports || true;
this.dependencies.length = 0;
this.addDependency(new DelegatedSourceDependency(this.sourceRequest));
callback();
}
unbuild() {
this.built = false;
super.unbuild();
}
source() {
const sourceModule = this.dependencies[0].module;
let str;
if(!sourceModule) {
str = WebpackMissingModule.moduleCode(this.sourceRequest);
} else {
str = `module.exports = (__webpack_require__(${sourceModule.id}))`;
switch(this.type) {
case "require":
str += `(${JSON.stringify(this.request)})`;
break;
case "object":
str += `[${JSON.stringify(this.request)}]`;
break;
}
str += ";";
}
if(this.useSourceMap) {
return new OriginalSource(str, this.identifier());
} else {
return new RawSource(str);
}
}
size() {
return 42;
}
}
module.exports = DelegatedModule;

View File

@@ -0,0 +1,58 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const DelegatedModule = require("./DelegatedModule");
// options.source
// options.type
// options.context
// options.scope
// options.content
class DelegatedModuleFactoryPlugin {
constructor(options) {
this.options = options;
options.type = options.type || "require";
options.extensions = options.extensions || ["", ".js"];
}
apply(normalModuleFactory) {
const scope = this.options.scope;
if(scope) {
normalModuleFactory.plugin("factory", factory => (data, callback) => {
const dependency = data.dependencies[0];
const request = dependency.request;
if(request && request.indexOf(scope + "/") === 0) {
const innerRequest = "." + request.substr(scope.length);
let resolved;
if(innerRequest in this.options.content) {
resolved = this.options.content[innerRequest];
return callback(null, new DelegatedModule(this.options.source, resolved, this.options.type, innerRequest));
}
for(let i = 0; i < this.options.extensions.length; i++) {
const requestPlusExt = innerRequest + this.options.extensions[i];
if(requestPlusExt in this.options.content) {
resolved = this.options.content[requestPlusExt];
return callback(null, new DelegatedModule(this.options.source, resolved, this.options.type, requestPlusExt));
}
}
}
return factory(data, callback);
});
} else {
normalModuleFactory.plugin("module", module => {
if(module.libIdent) {
const request = module.libIdent(this.options);
if(request && request in this.options.content) {
const resolved = this.options.content[request];
return new DelegatedModule(this.options.source, resolved, this.options.type, request);
}
}
return module;
});
}
}
}
module.exports = DelegatedModuleFactoryPlugin;

27
web/node_modules/webpack/lib/DelegatedPlugin.js generated vendored Normal file
View File

@@ -0,0 +1,27 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const DelegatedModuleFactoryPlugin = require("./DelegatedModuleFactoryPlugin");
const DelegatedSourceDependency = require("./dependencies/DelegatedSourceDependency");
class DelegatedPlugin {
constructor(options) {
this.options = options;
}
apply(compiler) {
compiler.plugin("compilation", (compilation, params) => {
compilation.dependencyFactories.set(DelegatedSourceDependency, params.normalModuleFactory);
});
compiler.plugin("compile", (params) => {
params.normalModuleFactory.apply(new DelegatedModuleFactoryPlugin(this.options));
});
}
}
module.exports = DelegatedPlugin;

81
web/node_modules/webpack/lib/DependenciesBlock.js generated vendored Normal file
View File

@@ -0,0 +1,81 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const DependenciesBlockVariable = require("./DependenciesBlockVariable");
function disconnect(i) {
i.disconnect();
}
function unseal(i) {
i.unseal();
}
class DependenciesBlock {
constructor() {
this.dependencies = [];
this.blocks = [];
this.variables = [];
}
addBlock(block) {
this.blocks.push(block);
block.parent = this;
}
addVariable(name, expression, dependencies) {
for(let v of this.variables) {
if(v.name === name && v.expression === expression) {
return;
}
}
this.variables.push(new DependenciesBlockVariable(name, expression, dependencies));
}
addDependency(dependency) {
this.dependencies.push(dependency);
}
updateHash(hash) {
function updateHash(i) {
i.updateHash(hash);
}
this.dependencies.forEach(updateHash);
this.blocks.forEach(updateHash);
this.variables.forEach(updateHash);
}
disconnect() {
this.dependencies.forEach(disconnect);
this.blocks.forEach(disconnect);
this.variables.forEach(disconnect);
}
unseal() {
this.blocks.forEach(unseal);
}
hasDependencies(filter) {
if(filter) {
if(this.dependencies.some(filter)) {
return true;
}
} else {
if(this.dependencies.length > 0) {
return true;
}
}
return this.blocks.concat(this.variables).some(item => item.hasDependencies(filter));
}
sortItems() {
this.blocks.forEach(block => block.sortItems());
}
}
module.exports = DependenciesBlock;

View File

@@ -0,0 +1,51 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ReplaceSource = require("webpack-sources").ReplaceSource;
const RawSource = require("webpack-sources").RawSource;
class DependenciesBlockVariable {
constructor(name, expression, dependencies) {
this.name = name;
this.expression = expression;
this.dependencies = dependencies || [];
}
updateHash(hash) {
hash.update(this.name);
hash.update(this.expression);
this.dependencies.forEach(d => {
d.updateHash(hash);
});
}
expressionSource(dependencyTemplates, outputOptions, requestShortener) {
const source = new ReplaceSource(new RawSource(this.expression));
this.dependencies.forEach(dep => {
const template = dependencyTemplates.get(dep.constructor);
if(!template) throw new Error(`No template for dependency: ${dep.constructor.name}`);
template.apply(dep, source, outputOptions, requestShortener, dependencyTemplates);
});
return source;
}
disconnect() {
this.dependencies.forEach(d => {
d.disconnect();
});
}
hasDependencies(filter) {
if(filter) {
if(this.dependencies.some(filter)) return true;
} else {
if(this.dependencies.length > 0) return true;
}
return false;
}
}
module.exports = DependenciesBlockVariable;

54
web/node_modules/webpack/lib/Dependency.js generated vendored Normal file
View File

@@ -0,0 +1,54 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const compareLocations = require("./compareLocations");
class Dependency {
constructor() {
this.module = null;
}
isEqualResource() {
return false;
}
// Returns the referenced module and export
getReference() {
if(!this.module) return null;
return {
module: this.module,
importedNames: true, // true: full object, false: only sideeffects/no export, array of strings: the exports with this names
};
}
// Returns the exported names
getExports() {
return null;
}
getWarnings() {
return null;
}
getErrors() {
return null;
}
updateHash(hash) {
hash.update((this.module && this.module.id) + "");
}
disconnect() {
this.module = null;
}
// TODO: remove in webpack 3
compare(a, b) {
return compareLocations(a.loc, b.loc);
}
}
Dependency.compare = (a, b) => compareLocations(a.loc, b.loc);
module.exports = Dependency;

37
web/node_modules/webpack/lib/DllEntryPlugin.js generated vendored Normal file
View File

@@ -0,0 +1,37 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const DllEntryDependency = require("./dependencies/DllEntryDependency");
const SingleEntryDependency = require("./dependencies/SingleEntryDependency");
const DllModuleFactory = require("./DllModuleFactory");
class DllEntryPlugin {
constructor(context, entries, name) {
this.context = context;
this.entries = entries;
this.name = name;
}
apply(compiler) {
compiler.plugin("compilation", (compilation, params) => {
const dllModuleFactory = new DllModuleFactory();
const normalModuleFactory = params.normalModuleFactory;
compilation.dependencyFactories.set(DllEntryDependency, dllModuleFactory);
compilation.dependencyFactories.set(SingleEntryDependency, normalModuleFactory);
});
compiler.plugin("make", (compilation, callback) => {
compilation.addEntry(this.context, new DllEntryDependency(this.entries.map((e, idx) => {
const dep = new SingleEntryDependency(e);
dep.loc = `${this.name}:${idx}`;
return dep;
}), this.name), this.name, callback);
});
}
}
module.exports = DllEntryPlugin;

58
web/node_modules/webpack/lib/DllModule.js generated vendored Normal file
View File

@@ -0,0 +1,58 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Module = require("./Module");
const RawSource = require("webpack-sources").RawSource;
class DllModule extends Module {
constructor(context, dependencies, name, type) {
super();
this.context = context;
this.dependencies = dependencies;
this.name = name;
this.built = false;
this.cacheable = true;
this.type = type;
}
identifier() {
return `dll ${this.name}`;
}
readableIdentifier() {
return `dll ${this.name}`;
}
disconnect() {
this.built = false;
super.disconnect();
}
build(options, compilation, resolver, fs, callback) {
this.built = true;
return callback();
}
source() {
return new RawSource("module.exports = __webpack_require__;");
}
needRebuild() {
return false;
}
size() {
return 12;
}
updateHash(hash) {
hash.update("dll module");
hash.update(this.name || "");
super.updateHash(hash);
}
}
module.exports = DllModule;

20
web/node_modules/webpack/lib/DllModuleFactory.js generated vendored Normal file
View File

@@ -0,0 +1,20 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
var Tapable = require("tapable");
var DllModule = require("./DllModule");
class DllModuleFactory extends Tapable {
constructor() {
super();
}
create(data, callback) {
const dependency = data.dependencies[0];
callback(null, new DllModule(data.context, dependency.dependencies, dependency.name, dependency.type));
}
}
module.exports = DllModuleFactory;

38
web/node_modules/webpack/lib/DllPlugin.js generated vendored Normal file
View File

@@ -0,0 +1,38 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const DllEntryPlugin = require("./DllEntryPlugin");
const LibManifestPlugin = require("./LibManifestPlugin");
const FlagInitialModulesAsUsedPlugin = require("./FlagInitialModulesAsUsedPlugin");
class DllPlugin {
constructor(options) {
this.options = options;
}
apply(compiler) {
compiler.plugin("entry-option", (context, entry) => {
function itemToPlugin(item, name) {
if(Array.isArray(item))
return new DllEntryPlugin(context, item, name);
else
throw new Error("DllPlugin: supply an Array as entry");
}
if(typeof entry === "object" && !Array.isArray(entry)) {
Object.keys(entry).forEach(name => {
compiler.apply(itemToPlugin(entry[name], name));
});
} else {
compiler.apply(itemToPlugin(entry, "main"));
}
return true;
});
compiler.apply(new LibManifestPlugin(this.options));
compiler.apply(new FlagInitialModulesAsUsedPlugin());
}
}
module.exports = DllPlugin;

59
web/node_modules/webpack/lib/DllReferencePlugin.js generated vendored Normal file
View File

@@ -0,0 +1,59 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const DelegatedSourceDependency = require("./dependencies/DelegatedSourceDependency");
const DelegatedModuleFactoryPlugin = require("./DelegatedModuleFactoryPlugin");
const ExternalModuleFactoryPlugin = require("./ExternalModuleFactoryPlugin");
class DllReferencePlugin {
constructor(options) {
this.options = options;
}
apply(compiler) {
compiler.plugin("compilation", (compilation, params) => {
const normalModuleFactory = params.normalModuleFactory;
compilation.dependencyFactories.set(DelegatedSourceDependency, normalModuleFactory);
});
compiler.plugin("before-compile", (params, callback) => {
const manifest = this.options.manifest;
if(typeof manifest === "string") {
params.compilationDependencies.push(manifest);
compiler.inputFileSystem.readFile(manifest, function(err, result) {
if(err) return callback(err);
params["dll reference " + manifest] = JSON.parse(result.toString("utf-8"));
return callback();
});
} else {
return callback();
}
});
compiler.plugin("compile", (params) => {
let manifest = this.options.manifest;
if(typeof manifest === "string") {
manifest = params["dll reference " + manifest];
}
const name = this.options.name || manifest.name;
const sourceType = this.options.sourceType || "var";
const externals = {};
const source = "dll-reference " + name;
externals[source] = name;
params.normalModuleFactory.apply(new ExternalModuleFactoryPlugin(sourceType, externals));
params.normalModuleFactory.apply(new DelegatedModuleFactoryPlugin({
source: source,
type: this.options.type,
scope: this.options.scope,
context: this.options.context || compiler.options.context,
content: this.options.content || manifest.content,
extensions: this.options.extensions
}));
});
}
}
module.exports = DllReferencePlugin;

59
web/node_modules/webpack/lib/DynamicEntryPlugin.js generated vendored Normal file
View File

@@ -0,0 +1,59 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Naoyuki Kanezawa @nkzawa
*/
"use strict";
const MultiEntryDependency = require("./dependencies/MultiEntryDependency");
const SingleEntryDependency = require("./dependencies/SingleEntryDependency");
const MultiModuleFactory = require("./MultiModuleFactory");
const MultiEntryPlugin = require("./MultiEntryPlugin");
const SingleEntryPlugin = require("./SingleEntryPlugin");
class DynamicEntryPlugin {
constructor(context, entry) {
this.context = context;
this.entry = entry;
}
apply(compiler) {
compiler.plugin("compilation", (compilation, params) => {
const multiModuleFactory = new MultiModuleFactory();
const normalModuleFactory = params.normalModuleFactory;
compilation.dependencyFactories.set(MultiEntryDependency, multiModuleFactory);
compilation.dependencyFactories.set(SingleEntryDependency, normalModuleFactory);
});
compiler.plugin("make", (compilation, callback) => {
const addEntry = (entry, name) => {
const dep = DynamicEntryPlugin.createDependency(entry, name);
return new Promise((resolve, reject) => {
compilation.addEntry(this.context, dep, name, (err) => {
if(err) return reject(err);
resolve();
});
});
};
Promise.resolve(this.entry()).then((entry) => {
if(typeof entry === "string" || Array.isArray(entry)) {
addEntry(entry, "main").then(() => callback(), callback);
} else if(typeof entry === "object") {
Promise.all(Object.keys(entry).map((name) => {
return addEntry(entry[name], name);
})).then(() => callback(), callback);
}
});
});
}
}
module.exports = DynamicEntryPlugin;
DynamicEntryPlugin.createDependency = function(entry, name) {
if(Array.isArray(entry))
return MultiEntryPlugin.createDependency(entry, name);
else
return SingleEntryPlugin.createDependency(entry, name);
};

View File

@@ -0,0 +1,22 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const WebpackError = require("./WebpackError");
class EntryModuleNotFoundError extends WebpackError {
constructor(err) {
super();
this.name = "EntryModuleNotFoundError";
this.message = "Entry module not found: " + err;
this.details = err.details;
this.error = err;
Error.captureStackTrace(this, this.constructor);
}
}
module.exports = EntryModuleNotFoundError;

31
web/node_modules/webpack/lib/EntryOptionPlugin.js generated vendored Normal file
View File

@@ -0,0 +1,31 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const SingleEntryPlugin = require("./SingleEntryPlugin");
const MultiEntryPlugin = require("./MultiEntryPlugin");
const DynamicEntryPlugin = require("./DynamicEntryPlugin");
module.exports = class EntryOptionPlugin {
apply(compiler) {
compiler.plugin("entry-option", (context, entry) => {
function itemToPlugin(item, name) {
if(Array.isArray(item)) {
return new MultiEntryPlugin(context, item, name);
} else {
return new SingleEntryPlugin(context, item, name);
}
}
if(typeof entry === "string" || Array.isArray(entry)) {
compiler.apply(itemToPlugin(entry, "main"));
} else if(typeof entry === "object") {
Object.keys(entry).forEach(name => compiler.apply(itemToPlugin(entry[name], name)));
} else if(typeof entry === "function") {
compiler.apply(new DynamicEntryPlugin(context, entry));
}
return true;
});
}
};

43
web/node_modules/webpack/lib/Entrypoint.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
class Entrypoint {
constructor(name) {
this.name = name;
this.chunks = [];
}
unshiftChunk(chunk) {
this.chunks.unshift(chunk);
chunk.entrypoints.push(this);
}
insertChunk(chunk, before) {
const idx = this.chunks.indexOf(before);
if(idx >= 0) {
this.chunks.splice(idx, 0, chunk);
} else {
throw new Error("before chunk not found");
}
chunk.entrypoints.push(this);
}
getFiles() {
const files = [];
for(let chunkIdx = 0; chunkIdx < this.chunks.length; chunkIdx++) {
for(let fileIdx = 0; fileIdx < this.chunks[chunkIdx].files.length; fileIdx++) {
if(files.indexOf(this.chunks[chunkIdx].files[fileIdx]) === -1) {
files.push(this.chunks[chunkIdx].files[fileIdx]);
}
}
}
return files;
}
}
module.exports = Entrypoint;

50
web/node_modules/webpack/lib/EnvironmentPlugin.js generated vendored Normal file
View File

@@ -0,0 +1,50 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Authors Simen Brekken @simenbrekken, Einar Löve @einarlove
*/
"use strict";
const DefinePlugin = require("./DefinePlugin");
class EnvironmentPlugin {
constructor(keys) {
if(Array.isArray(keys)) {
this.keys = keys;
this.defaultValues = {};
} else if(keys && typeof keys === "object") {
this.keys = Object.keys(keys);
this.defaultValues = keys;
} else {
this.keys = Array.prototype.slice.call(arguments);
this.defaultValues = {};
}
}
apply(compiler) {
const definitions = this.keys.reduce((defs, key) => {
const value = process.env[key] !== undefined ? process.env[key] : this.defaultValues[key];
if(value === undefined) {
compiler.plugin("this-compilation", compilation => {
const error = new Error(
`EnvironmentPlugin - ${key} environment variable is undefined.\n\n` +
"You can pass an object with default values to suppress this warning.\n" +
"See https://webpack.js.org/plugins/environment-plugin for example."
);
error.name = "EnvVariableNotDefinedError";
compilation.warnings.push(error);
});
}
defs[`process.env.${key}`] = typeof value === "undefined" ? "undefined" : JSON.stringify(value);
return defs;
}, {});
compiler.apply(new DefinePlugin(definitions));
}
}
module.exports = EnvironmentPlugin;

31
web/node_modules/webpack/lib/ErrorHelpers.js generated vendored Normal file
View File

@@ -0,0 +1,31 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const loaderFlag = "LOADER_EXECUTION";
exports.cutOffLoaderExecution = (stack) => {
stack = stack.split("\n");
for(let i = 0; i < stack.length; i++)
if(stack[i].indexOf(loaderFlag) >= 0)
stack.length = i;
return stack.join("\n");
};
exports.cutOffMessage = (stack, message) => {
const nextLine = stack.indexOf("\n");
if(nextLine === -1) {
return stack === message ? "" : stack;
} else {
const firstLine = stack.substr(0, nextLine);
return firstLine === message ? stack.substr(nextLine + 1) : stack;
}
};
exports.cleanUp = (stack, message) => {
stack = exports.cutOffLoaderExecution(stack);
stack = exports.cutOffMessage(stack, message);
return stack;
};

View File

@@ -0,0 +1,22 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const EvalDevToolModuleTemplatePlugin = require("./EvalDevToolModuleTemplatePlugin");
class EvalDevToolModulePlugin {
constructor(sourceUrlComment, moduleFilenameTemplate) {
this.sourceUrlComment = sourceUrlComment;
this.moduleFilenameTemplate = moduleFilenameTemplate;
}
apply(compiler) {
compiler.plugin("compilation", (compilation) => {
compilation.moduleTemplate.apply(new EvalDevToolModuleTemplatePlugin(this.sourceUrlComment, this.moduleFilenameTemplate));
});
}
}
module.exports = EvalDevToolModulePlugin;

View File

@@ -0,0 +1,33 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const RawSource = require("webpack-sources").RawSource;
const ModuleFilenameHelpers = require("./ModuleFilenameHelpers");
class EvalDevToolModuleTemplatePlugin {
constructor(sourceUrlComment, moduleFilenameTemplate) {
this.sourceUrlComment = sourceUrlComment || "\n//# sourceURL=[url]";
this.moduleFilenameTemplate = moduleFilenameTemplate || "webpack:///[resourcePath]?[loaders]";
}
apply(moduleTemplate) {
moduleTemplate.plugin("module", (source, module) => {
const content = source.source();
const str = ModuleFilenameHelpers.createFilename(module, this.moduleFilenameTemplate, moduleTemplate.requestShortener);
const footer = ["\n",
ModuleFilenameHelpers.createFooter(module, moduleTemplate.requestShortener),
this.sourceUrlComment.replace(/\[url\]/g, encodeURI(str).replace(/%2F/g, "/").replace(/%20/g, "_").replace(/%5E/g, "^").replace(/%5C/g, "\\").replace(/^\//, ""))
].join("\n");
return new RawSource(`eval(${JSON.stringify(content + footer)});`);
});
moduleTemplate.plugin("hash", hash => {
hash.update("EvalDevToolModuleTemplatePlugin");
hash.update("2");
});
}
}
module.exports = EvalDevToolModuleTemplatePlugin;

View File

@@ -0,0 +1,74 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const RawSource = require("webpack-sources").RawSource;
const ModuleFilenameHelpers = require("./ModuleFilenameHelpers");
class EvalSourceMapDevToolModuleTemplatePlugin {
constructor(compilation, options) {
this.compilation = compilation;
this.sourceMapComment = options.append || "//# sourceMappingURL=[url]";
this.moduleFilenameTemplate = options.moduleFilenameTemplate || "webpack:///[resource-path]?[hash]";
this.options = options;
}
apply(moduleTemplate) {
const self = this;
const options = this.options;
moduleTemplate.plugin("module", function(source, module) {
if(source.__EvalSourceMapDevToolData)
return source.__EvalSourceMapDevToolData;
let sourceMap;
let content;
if(source.sourceAndMap) {
const sourceAndMap = source.sourceAndMap(options);
sourceMap = sourceAndMap.map;
content = sourceAndMap.source;
} else {
sourceMap = source.map(options);
content = source.source();
}
if(!sourceMap) {
return source;
}
// Clone (flat) the sourcemap to ensure that the mutations below do not persist.
sourceMap = Object.keys(sourceMap).reduce(function(obj, key) {
obj[key] = sourceMap[key];
return obj;
}, {});
const modules = sourceMap.sources.map(function(source) {
const module = self.compilation.findModule(source);
return module || source;
});
let moduleFilenames = modules.map(function(module) {
return ModuleFilenameHelpers.createFilename(module, self.moduleFilenameTemplate, this.requestShortener);
}, this);
moduleFilenames = ModuleFilenameHelpers.replaceDuplicates(moduleFilenames, function(filename, i, n) {
for(let j = 0; j < n; j++)
filename += "*";
return filename;
});
sourceMap.sources = moduleFilenames;
if(sourceMap.sourcesContent) {
sourceMap.sourcesContent = sourceMap.sourcesContent.map(function(content, i) {
return `${content}\n\n\n${ModuleFilenameHelpers.createFooter(modules[i], this.requestShortener)}`;
}, this);
}
sourceMap.sourceRoot = options.sourceRoot || "";
sourceMap.file = `${module.id}.js`;
const footer = self.sourceMapComment.replace(/\[url\]/g, `data:application/json;charset=utf-8;base64,${new Buffer(JSON.stringify(sourceMap), "utf8").toString("base64")}`); //eslint-disable-line
source.__EvalSourceMapDevToolData = new RawSource(`eval(${JSON.stringify(content + footer)});`);
return source.__EvalSourceMapDevToolData;
});
moduleTemplate.plugin("hash", function(hash) {
hash.update("eval-source-map");
hash.update("1");
});
}
}
module.exports = EvalSourceMapDevToolModuleTemplatePlugin;

View File

@@ -0,0 +1,32 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const EvalSourceMapDevToolModuleTemplatePlugin = require("./EvalSourceMapDevToolModuleTemplatePlugin");
const SourceMapDevToolModuleOptionsPlugin = require("./SourceMapDevToolModuleOptionsPlugin");
class EvalSourceMapDevToolPlugin {
constructor(options) {
if(arguments.length > 1)
throw new Error("EvalSourceMapDevToolPlugin only takes one argument (pass an options object)");
if(typeof options === "string") {
options = {
append: options
};
}
if(!options) options = {};
this.options = options;
}
apply(compiler) {
const options = this.options;
compiler.plugin("compilation", (compilation) => {
new SourceMapDevToolModuleOptionsPlugin(options).apply(compilation);
compilation.moduleTemplate.apply(new EvalSourceMapDevToolModuleTemplatePlugin(compilation, options));
});
}
}
module.exports = EvalSourceMapDevToolPlugin;

47
web/node_modules/webpack/lib/ExtendedAPIPlugin.js generated vendored Normal file
View File

@@ -0,0 +1,47 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ConstDependency = require("./dependencies/ConstDependency");
const ParserHelpers = require("./ParserHelpers");
const NullFactory = require("./NullFactory");
const REPLACEMENTS = {
__webpack_hash__: "__webpack_require__.h", // eslint-disable-line camelcase
__webpack_chunkname__: "__webpack_require__.cn" // eslint-disable-line camelcase
};
const REPLACEMENT_TYPES = {
__webpack_hash__: "string", // eslint-disable-line camelcase
__webpack_chunkname__: "string" // eslint-disable-line camelcase
};
class ExtendedAPIPlugin {
apply(compiler) {
compiler.plugin("compilation", (compilation, params) => {
compilation.dependencyFactories.set(ConstDependency, new NullFactory());
compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());
compilation.mainTemplate.plugin("require-extensions", function(source, chunk, hash) {
const buf = [source];
buf.push("");
buf.push("// __webpack_hash__");
buf.push(`${this.requireFn}.h = ${JSON.stringify(hash)};`);
buf.push("");
buf.push("// __webpack_chunkname__");
buf.push(`${this.requireFn}.cn = ${JSON.stringify(chunk.name)};`);
return this.asString(buf);
});
compilation.mainTemplate.plugin("global-hash", () => true);
params.normalModuleFactory.plugin("parser", (parser, parserOptions) => {
Object.keys(REPLACEMENTS).forEach(key => {
parser.plugin(`expression ${key}`, ParserHelpers.toConstantDependency(REPLACEMENTS[key]));
parser.plugin(`evaluate typeof ${key}`, ParserHelpers.evaluateToString(REPLACEMENT_TYPES[key]));
});
});
});
}
}
module.exports = ExtendedAPIPlugin;

116
web/node_modules/webpack/lib/ExternalModule.js generated vendored Normal file
View File

@@ -0,0 +1,116 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Module = require("./Module");
const OriginalSource = require("webpack-sources").OriginalSource;
const RawSource = require("webpack-sources").RawSource;
const WebpackMissingModule = require("./dependencies/WebpackMissingModule");
const Template = require("./Template");
class ExternalModule extends Module {
constructor(request, type) {
super();
this.request = request;
this.type = type;
this.built = false;
this.external = true;
}
chunkCondition(chunk) {
return chunk.hasEntryModule();
}
identifier() {
return "external " + JSON.stringify(this.request);
}
readableIdentifier() {
return "external " + JSON.stringify(this.request);
}
needRebuild() {
return false;
}
build(options, compilation, resolver, fs, callback) {
this.builtTime = Date.now();
callback();
}
getSourceForGlobalVariableExternal(variableName, type) {
if(!Array.isArray(variableName)) {
// make it an array as the look up works the same basically
variableName = [variableName];
}
// needed for e.g. window["some"]["thing"]
const objectLookup = variableName.map(r => `[${JSON.stringify(r)}]`).join("");
return `(function() { module.exports = ${type}${objectLookup}; }());`;
}
getSourceForCommonJsExternal(moduleAndSpecifiers) {
if(!Array.isArray(moduleAndSpecifiers)) {
return `module.exports = require(${JSON.stringify(moduleAndSpecifiers)});`;
}
const moduleName = moduleAndSpecifiers[0];
const objectLookup = moduleAndSpecifiers.slice(1).map(r => `[${JSON.stringify(r)}]`).join("");
return `module.exports = require(${moduleName})${objectLookup};`;
}
checkExternalVariable(variableToCheck, request) {
return `if(typeof ${variableToCheck} === 'undefined') {${WebpackMissingModule.moduleCode(request)}}\n`;
}
getSourceForAmdOrUmdExternal(id, optional, request) {
const externalVariable = Template.toIdentifier(`__WEBPACK_EXTERNAL_MODULE_${id}__`);
const missingModuleError = optional ? this.checkExternalVariable(externalVariable, request) : "";
return `${missingModuleError}module.exports = ${externalVariable};`;
}
getSourceForDefaultCase(optional, request) {
const missingModuleError = optional ? this.checkExternalVariable(request, request) : "";
return `${missingModuleError}module.exports = ${request};`;
}
getSourceString() {
const request = typeof this.request === "object" ? this.request[this.type] : this.request;
switch(this.type) {
case "this":
case "window":
case "global":
return this.getSourceForGlobalVariableExternal(request, this.type);
case "commonjs":
case "commonjs2":
return this.getSourceForCommonJsExternal(request);
case "amd":
case "umd":
case "umd2":
return this.getSourceForAmdOrUmdExternal(this.id, this.optional, request);
default:
return this.getSourceForDefaultCase(this.optional, request);
}
}
getSource(sourceString) {
if(this.useSourceMap) {
return new OriginalSource(sourceString, this.identifier());
}
return new RawSource(sourceString);
}
source() {
return this.getSource(
this.getSourceString()
);
}
size() {
return 42;
}
}
module.exports = ExternalModule;

View File

@@ -0,0 +1,91 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ExternalModule = require("./ExternalModule");
class ExternalModuleFactoryPlugin {
constructor(type, externals) {
this.type = type;
this.externals = externals;
}
apply(normalModuleFactory) {
const globalType = this.type;
normalModuleFactory.plugin("factory", factory => (data, callback) => {
const context = data.context;
const dependency = data.dependencies[0];
function handleExternal(value, type, callback) {
if(typeof type === "function") {
callback = type;
type = undefined;
}
if(value === false) return factory(data, callback);
if(value === true) value = dependency.request;
if(typeof type === "undefined" && /^[a-z0-9]+ /.test(value)) {
const idx = value.indexOf(" ");
type = value.substr(0, idx);
value = value.substr(idx + 1);
}
callback(null, new ExternalModule(value, type || globalType));
return true;
}
(function handleExternals(externals, callback) {
if(typeof externals === "string") {
if(externals === dependency.request) {
return handleExternal(dependency.request, callback);
}
} else if(Array.isArray(externals)) {
let i = 0;
(function next() {
let asyncFlag;
const handleExternalsAndCallback = function handleExternalsAndCallback(err, module) {
if(err) return callback(err);
if(!module) {
if(asyncFlag) {
asyncFlag = false;
return;
}
return next();
}
callback(null, module);
};
do {
asyncFlag = true;
if(i >= externals.length) return callback();
handleExternals(externals[i++], handleExternalsAndCallback);
} while (!asyncFlag); // eslint-disable-line keyword-spacing
asyncFlag = false;
}());
return;
} else if(externals instanceof RegExp) {
if(externals.test(dependency.request)) {
return handleExternal(dependency.request, callback);
}
} else if(typeof externals === "function") {
externals.call(null, context, dependency.request, function(err, value, type) {
if(err) return callback(err);
if(typeof value !== "undefined") {
handleExternal(value, type, callback);
} else {
callback();
}
});
return;
} else if(typeof externals === "object" && Object.prototype.hasOwnProperty.call(externals, dependency.request)) {
return handleExternal(externals[dependency.request], callback);
}
callback();
}(this.externals, function(err, module) {
if(err) return callback(err);
if(!module) return handleExternal(false, callback);
return callback(null, module);
}));
});
}
}
module.exports = ExternalModuleFactoryPlugin;

21
web/node_modules/webpack/lib/ExternalsPlugin.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
var ExternalModuleFactoryPlugin = require("./ExternalModuleFactoryPlugin");
class ExternalsPlugin {
constructor(type, externals) {
this.type = type;
this.externals = externals;
}
apply(compiler) {
compiler.plugin("compile", (params) => {
params.normalModuleFactory.apply(new ExternalModuleFactoryPlugin(this.type, this.externals));
});
}
}
module.exports = ExternalsPlugin;

View File

@@ -0,0 +1,101 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
class FlagDependencyExportsPlugin {
apply(compiler) {
compiler.plugin("compilation", (compilation) => {
compilation.plugin("finish-modules", (modules) => {
const dependencies = Object.create(null);
let module;
let moduleWithExports;
let moduleProvidedExports;
const queue = modules.filter((m) => !m.providedExports);
for(let i = 0; i < queue.length; i++) {
module = queue[i];
if(module.providedExports !== true) {
moduleWithExports = false;
moduleProvidedExports = Array.isArray(module.providedExports) ? new Set(module.providedExports) : new Set();
processDependenciesBlock(module);
if(!moduleWithExports) {
module.providedExports = true;
notifyDependencies();
} else if(module.providedExports !== true) {
module.providedExports = Array.from(moduleProvidedExports);
}
}
}
function processDependenciesBlock(depBlock) {
depBlock.dependencies.forEach((dep) => processDependency(dep));
depBlock.variables.forEach((variable) => {
variable.dependencies.forEach((dep) => processDependency(dep));
});
depBlock.blocks.forEach(processDependenciesBlock);
}
function processDependency(dep) {
const exportDesc = dep.getExports && dep.getExports();
if(!exportDesc) return;
moduleWithExports = true;
const exports = exportDesc.exports;
const exportDeps = exportDesc.dependencies;
if(exportDeps) {
exportDeps.forEach((dep) => {
const depIdent = dep.identifier();
// if this was not yet initialized
// initialize it as an array containing the module and stop
const array = dependencies[depIdent];
if(!array) {
dependencies[depIdent] = [module];
return;
}
// check if this module is known
// if not, add it to the dependencies for this identifier
if(array.indexOf(module) < 0)
array.push(module);
});
}
let changed = false;
if(module.providedExports !== true) {
if(exports === true) {
module.providedExports = true;
changed = true;
} else if(Array.isArray(exports)) {
changed = addToSet(moduleProvidedExports, exports);
}
}
if(changed) {
notifyDependencies();
}
}
function notifyDependencies() {
const deps = dependencies[module.identifier()];
if(deps) {
deps.forEach((dep) => queue.push(dep));
}
}
});
function addToSet(a, b) {
let changed = false;
b.forEach((item) => {
if(!a.has(item)) {
a.add(item);
changed = true;
}
});
return changed;
}
});
}
}
module.exports = FlagDependencyExportsPlugin;

View File

@@ -0,0 +1,81 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
class FlagDependencyUsagePlugin {
apply(compiler) {
compiler.plugin("compilation", compilation => {
compilation.plugin("optimize-modules-advanced", modules => {
modules.forEach(module => module.used = false);
const queue = [];
compilation.chunks.forEach(chunk => {
if(chunk.entryModule) {
processModule(chunk.entryModule, true);
}
});
while(queue.length) {
const queueItem = queue.pop();
processDependenciesBlock(queueItem[0], queueItem[1]);
}
function processModule(module, usedExports) {
module.used = true;
if(module.usedExports === true)
return;
else if(usedExports === true)
module.usedExports = true;
else if(Array.isArray(usedExports)) {
var old = module.usedExports ? module.usedExports.length : -1;
module.usedExports = addToSet(module.usedExports || [], usedExports);
if(module.usedExports.length === old)
return;
} else if(Array.isArray(module.usedExports))
return;
else
module.usedExports = false;
queue.push([module, module.usedExports]);
}
function processDependenciesBlock(depBlock, usedExports) {
depBlock.dependencies.forEach(dep => processDependency(dep));
depBlock.variables.forEach(variable => variable.dependencies.forEach(dep => processDependency(dep)));
depBlock.blocks.forEach(block => queue.push([block, usedExports]));
}
function processDependency(dep) {
const reference = dep.getReference && dep.getReference();
if(!reference) return;
const module = reference.module;
const importedNames = reference.importedNames;
const oldUsed = module.used;
const oldUsedExports = module.usedExports;
if(!oldUsed || (importedNames && (!oldUsedExports || !isSubset(oldUsedExports, importedNames)))) {
processModule(module, importedNames);
}
}
});
function addToSet(a, b) {
b.forEach(item => {
if(a.indexOf(item) < 0)
a.push(item);
});
return a;
}
function isSubset(biggerSet, subset) {
if(biggerSet === true) return true;
if(subset === true) return false;
return subset.every(item => biggerSet.indexOf(item) >= 0);
}
});
}
}
module.exports = FlagDependencyUsagePlugin;

View File

@@ -0,0 +1,24 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
class FlagInitialModulesAsUsedPlugin {
apply(compiler) {
compiler.plugin("compilation", (compilation) => {
compilation.plugin("after-optimize-chunks", (chunks) => {
chunks.forEach((chunk) => {
if(!chunk.isInitial()) {
return;
}
chunk.modules.forEach((module) => {
module.usedExports = true;
});
});
});
});
}
}
module.exports = FlagInitialModulesAsUsedPlugin;

24
web/node_modules/webpack/lib/FunctionModulePlugin.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const FunctionModuleTemplatePlugin = require("./FunctionModuleTemplatePlugin");
const RequestShortener = require("./RequestShortener");
class FunctionModulePlugin {
constructor(options, requestShortener) {
this.options = options;
this.requestShortener = requestShortener;
}
apply(compiler) {
compiler.plugin("compilation", (compilation) => {
compilation.moduleTemplate.requestShortener = this.requestShortener || new RequestShortener(compiler.context);
compilation.moduleTemplate.apply(new FunctionModuleTemplatePlugin());
});
}
}
module.exports = FunctionModulePlugin;

View File

@@ -0,0 +1,51 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ConcatSource = require("webpack-sources").ConcatSource;
class FunctionModuleTemplatePlugin {
apply(moduleTemplate) {
moduleTemplate.plugin("render", function(moduleSource, module) {
const source = new ConcatSource();
const defaultArguments = [module.moduleArgument || "module", module.exportsArgument || "exports"];
if((module.arguments && module.arguments.length !== 0) || module.hasDependencies(d => d.requireWebpackRequire !== false)) {
defaultArguments.push("__webpack_require__");
}
source.add("/***/ (function(" + defaultArguments.concat(module.arguments || []).join(", ") + ") {\n\n");
if(module.strict) source.add("\"use strict\";\n");
source.add(moduleSource);
source.add("\n\n/***/ })");
return source;
});
moduleTemplate.plugin("package", function(moduleSource, module) {
if(this.outputOptions.pathinfo) {
const source = new ConcatSource();
const req = module.readableIdentifier(this.requestShortener);
if(Array.isArray(module.providedExports))
source.add("/* exports provided: " + module.providedExports.join(", ") + " */\n");
else if(module.providedExports)
source.add("/* no static exports found */\n");
if(Array.isArray(module.usedExports))
source.add("/* exports used: " + module.usedExports.join(", ") + " */\n");
else if(module.usedExports)
source.add("/* all exports used */\n");
source.add("/*!****" + req.replace(/./g, "*") + "****!*\\\n");
source.add(" !*** " + req.replace(/\*\//g, "*_/") + " ***!\n");
source.add(" \\****" + req.replace(/./g, "*") + "****/\n");
source.add(moduleSource);
return source;
}
return moduleSource;
});
moduleTemplate.plugin("hash", function(hash) {
hash.update("FunctionModuleTemplatePlugin");
hash.update("2");
});
}
}
module.exports = FunctionModuleTemplatePlugin;

42
web/node_modules/webpack/lib/HashedModuleIdsPlugin.js generated vendored Normal file
View File

@@ -0,0 +1,42 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const createHash = require("crypto").createHash;
class HashedModuleIdsPlugin {
constructor(options) {
this.options = Object.assign({
hashFunction: "md5",
hashDigest: "base64",
hashDigestLength: 4
}, options);
}
apply(compiler) {
const options = this.options;
compiler.plugin("compilation", (compilation) => {
const usedIds = new Set();
compilation.plugin("before-module-ids", (modules) => {
modules.forEach((module) => {
if(module.id === null && module.libIdent) {
const id = module.libIdent({
context: this.options.context || compiler.options.context
});
const hash = createHash(options.hashFunction);
hash.update(id);
const hashId = hash.digest(options.hashDigest);
let len = options.hashDigestLength;
while(usedIds.has(hashId.substr(0, len)))
len++;
module.id = hashId.substr(0, len);
usedIds.add(module.id);
}
});
});
});
}
}
module.exports = HashedModuleIdsPlugin;

View File

@@ -0,0 +1,585 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
/*global $hash$ installedModules $require$ hotDownloadManifest hotDownloadUpdateChunk hotDisposeChunk modules */
module.exports = function() {
var hotApplyOnUpdate = true;
var hotCurrentHash = $hash$; // eslint-disable-line no-unused-vars
var hotCurrentModuleData = {};
var hotCurrentChildModule; // eslint-disable-line no-unused-vars
var hotCurrentParents = []; // eslint-disable-line no-unused-vars
var hotCurrentParentsTemp = []; // eslint-disable-line no-unused-vars
function hotCreateRequire(moduleId) { // eslint-disable-line no-unused-vars
var me = installedModules[moduleId];
if(!me) return $require$;
var fn = function(request) {
if(me.hot.active) {
if(installedModules[request]) {
if(installedModules[request].parents.indexOf(moduleId) < 0)
installedModules[request].parents.push(moduleId);
} else {
hotCurrentParents = [moduleId];
hotCurrentChildModule = request;
}
if(me.children.indexOf(request) < 0)
me.children.push(request);
} else {
console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId);
hotCurrentParents = [];
}
return $require$(request);
};
var ObjectFactory = function ObjectFactory(name) {
return {
configurable: true,
enumerable: true,
get: function() {
return $require$[name];
},
set: function(value) {
$require$[name] = value;
}
};
};
for(var name in $require$) {
if(Object.prototype.hasOwnProperty.call($require$, name) && name !== "e") {
Object.defineProperty(fn, name, ObjectFactory(name));
}
}
fn.e = function(chunkId) {
if(hotStatus === "ready")
hotSetStatus("prepare");
hotChunksLoading++;
return $require$.e(chunkId).then(finishChunkLoading, function(err) {
finishChunkLoading();
throw err;
});
function finishChunkLoading() {
hotChunksLoading--;
if(hotStatus === "prepare") {
if(!hotWaitingFilesMap[chunkId]) {
hotEnsureUpdateChunk(chunkId);
}
if(hotChunksLoading === 0 && hotWaitingFiles === 0) {
hotUpdateDownloaded();
}
}
}
};
return fn;
}
function hotCreateModule(moduleId) { // eslint-disable-line no-unused-vars
var hot = {
// private stuff
_acceptedDependencies: {},
_declinedDependencies: {},
_selfAccepted: false,
_selfDeclined: false,
_disposeHandlers: [],
_main: hotCurrentChildModule !== moduleId,
// Module API
active: true,
accept: function(dep, callback) {
if(typeof dep === "undefined")
hot._selfAccepted = true;
else if(typeof dep === "function")
hot._selfAccepted = dep;
else if(typeof dep === "object")
for(var i = 0; i < dep.length; i++)
hot._acceptedDependencies[dep[i]] = callback || function() {};
else
hot._acceptedDependencies[dep] = callback || function() {};
},
decline: function(dep) {
if(typeof dep === "undefined")
hot._selfDeclined = true;
else if(typeof dep === "object")
for(var i = 0; i < dep.length; i++)
hot._declinedDependencies[dep[i]] = true;
else
hot._declinedDependencies[dep] = true;
},
dispose: function(callback) {
hot._disposeHandlers.push(callback);
},
addDisposeHandler: function(callback) {
hot._disposeHandlers.push(callback);
},
removeDisposeHandler: function(callback) {
var idx = hot._disposeHandlers.indexOf(callback);
if(idx >= 0) hot._disposeHandlers.splice(idx, 1);
},
// Management API
check: hotCheck,
apply: hotApply,
status: function(l) {
if(!l) return hotStatus;
hotStatusHandlers.push(l);
},
addStatusHandler: function(l) {
hotStatusHandlers.push(l);
},
removeStatusHandler: function(l) {
var idx = hotStatusHandlers.indexOf(l);
if(idx >= 0) hotStatusHandlers.splice(idx, 1);
},
//inherit from previous dispose call
data: hotCurrentModuleData[moduleId]
};
hotCurrentChildModule = undefined;
return hot;
}
var hotStatusHandlers = [];
var hotStatus = "idle";
function hotSetStatus(newStatus) {
hotStatus = newStatus;
for(var i = 0; i < hotStatusHandlers.length; i++)
hotStatusHandlers[i].call(null, newStatus);
}
// while downloading
var hotWaitingFiles = 0;
var hotChunksLoading = 0;
var hotWaitingFilesMap = {};
var hotRequestedFilesMap = {};
var hotAvailableFilesMap = {};
var hotDeferred;
// The update info
var hotUpdate, hotUpdateNewHash;
function toModuleId(id) {
var isNumber = (+id) + "" === id;
return isNumber ? +id : id;
}
function hotCheck(apply) {
if(hotStatus !== "idle") throw new Error("check() is only allowed in idle status");
hotApplyOnUpdate = apply;
hotSetStatus("check");
return hotDownloadManifest().then(function(update) {
if(!update) {
hotSetStatus("idle");
return null;
}
hotRequestedFilesMap = {};
hotWaitingFilesMap = {};
hotAvailableFilesMap = update.c;
hotUpdateNewHash = update.h;
hotSetStatus("prepare");
var promise = new Promise(function(resolve, reject) {
hotDeferred = {
resolve: resolve,
reject: reject
};
});
hotUpdate = {};
/*foreachInstalledChunks*/
{ // eslint-disable-line no-lone-blocks
/*globals chunkId */
hotEnsureUpdateChunk(chunkId);
}
if(hotStatus === "prepare" && hotChunksLoading === 0 && hotWaitingFiles === 0) {
hotUpdateDownloaded();
}
return promise;
});
}
function hotAddUpdateChunk(chunkId, moreModules) { // eslint-disable-line no-unused-vars
if(!hotAvailableFilesMap[chunkId] || !hotRequestedFilesMap[chunkId])
return;
hotRequestedFilesMap[chunkId] = false;
for(var moduleId in moreModules) {
if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
hotUpdate[moduleId] = moreModules[moduleId];
}
}
if(--hotWaitingFiles === 0 && hotChunksLoading === 0) {
hotUpdateDownloaded();
}
}
function hotEnsureUpdateChunk(chunkId) {
if(!hotAvailableFilesMap[chunkId]) {
hotWaitingFilesMap[chunkId] = true;
} else {
hotRequestedFilesMap[chunkId] = true;
hotWaitingFiles++;
hotDownloadUpdateChunk(chunkId);
}
}
function hotUpdateDownloaded() {
hotSetStatus("ready");
var deferred = hotDeferred;
hotDeferred = null;
if(!deferred) return;
if(hotApplyOnUpdate) {
hotApply(hotApplyOnUpdate).then(function(result) {
deferred.resolve(result);
}, function(err) {
deferred.reject(err);
});
} else {
var outdatedModules = [];
for(var id in hotUpdate) {
if(Object.prototype.hasOwnProperty.call(hotUpdate, id)) {
outdatedModules.push(toModuleId(id));
}
}
deferred.resolve(outdatedModules);
}
}
function hotApply(options) {
if(hotStatus !== "ready") throw new Error("apply() is only allowed in ready status");
options = options || {};
var cb;
var i;
var j;
var module;
var moduleId;
function getAffectedStuff(updateModuleId) {
var outdatedModules = [updateModuleId];
var outdatedDependencies = {};
var queue = outdatedModules.slice().map(function(id) {
return {
chain: [id],
id: id
};
});
while(queue.length > 0) {
var queueItem = queue.pop();
var moduleId = queueItem.id;
var chain = queueItem.chain;
module = installedModules[moduleId];
if(!module || module.hot._selfAccepted)
continue;
if(module.hot._selfDeclined) {
return {
type: "self-declined",
chain: chain,
moduleId: moduleId
};
}
if(module.hot._main) {
return {
type: "unaccepted",
chain: chain,
moduleId: moduleId
};
}
for(var i = 0; i < module.parents.length; i++) {
var parentId = module.parents[i];
var parent = installedModules[parentId];
if(!parent) continue;
if(parent.hot._declinedDependencies[moduleId]) {
return {
type: "declined",
chain: chain.concat([parentId]),
moduleId: moduleId,
parentId: parentId
};
}
if(outdatedModules.indexOf(parentId) >= 0) continue;
if(parent.hot._acceptedDependencies[moduleId]) {
if(!outdatedDependencies[parentId])
outdatedDependencies[parentId] = [];
addAllToSet(outdatedDependencies[parentId], [moduleId]);
continue;
}
delete outdatedDependencies[parentId];
outdatedModules.push(parentId);
queue.push({
chain: chain.concat([parentId]),
id: parentId
});
}
}
return {
type: "accepted",
moduleId: updateModuleId,
outdatedModules: outdatedModules,
outdatedDependencies: outdatedDependencies
};
}
function addAllToSet(a, b) {
for(var i = 0; i < b.length; i++) {
var item = b[i];
if(a.indexOf(item) < 0)
a.push(item);
}
}
// at begin all updates modules are outdated
// the "outdated" status can propagate to parents if they don't accept the children
var outdatedDependencies = {};
var outdatedModules = [];
var appliedUpdate = {};
var warnUnexpectedRequire = function warnUnexpectedRequire() {
console.warn("[HMR] unexpected require(" + result.moduleId + ") to disposed module");
};
for(var id in hotUpdate) {
if(Object.prototype.hasOwnProperty.call(hotUpdate, id)) {
moduleId = toModuleId(id);
var result;
if(hotUpdate[id]) {
result = getAffectedStuff(moduleId);
} else {
result = {
type: "disposed",
moduleId: id
};
}
var abortError = false;
var doApply = false;
var doDispose = false;
var chainInfo = "";
if(result.chain) {
chainInfo = "\nUpdate propagation: " + result.chain.join(" -> ");
}
switch(result.type) {
case "self-declined":
if(options.onDeclined)
options.onDeclined(result);
if(!options.ignoreDeclined)
abortError = new Error("Aborted because of self decline: " + result.moduleId + chainInfo);
break;
case "declined":
if(options.onDeclined)
options.onDeclined(result);
if(!options.ignoreDeclined)
abortError = new Error("Aborted because of declined dependency: " + result.moduleId + " in " + result.parentId + chainInfo);
break;
case "unaccepted":
if(options.onUnaccepted)
options.onUnaccepted(result);
if(!options.ignoreUnaccepted)
abortError = new Error("Aborted because " + moduleId + " is not accepted" + chainInfo);
break;
case "accepted":
if(options.onAccepted)
options.onAccepted(result);
doApply = true;
break;
case "disposed":
if(options.onDisposed)
options.onDisposed(result);
doDispose = true;
break;
default:
throw new Error("Unexception type " + result.type);
}
if(abortError) {
hotSetStatus("abort");
return Promise.reject(abortError);
}
if(doApply) {
appliedUpdate[moduleId] = hotUpdate[moduleId];
addAllToSet(outdatedModules, result.outdatedModules);
for(moduleId in result.outdatedDependencies) {
if(Object.prototype.hasOwnProperty.call(result.outdatedDependencies, moduleId)) {
if(!outdatedDependencies[moduleId])
outdatedDependencies[moduleId] = [];
addAllToSet(outdatedDependencies[moduleId], result.outdatedDependencies[moduleId]);
}
}
}
if(doDispose) {
addAllToSet(outdatedModules, [result.moduleId]);
appliedUpdate[moduleId] = warnUnexpectedRequire;
}
}
}
// Store self accepted outdated modules to require them later by the module system
var outdatedSelfAcceptedModules = [];
for(i = 0; i < outdatedModules.length; i++) {
moduleId = outdatedModules[i];
if(installedModules[moduleId] && installedModules[moduleId].hot._selfAccepted)
outdatedSelfAcceptedModules.push({
module: moduleId,
errorHandler: installedModules[moduleId].hot._selfAccepted
});
}
// Now in "dispose" phase
hotSetStatus("dispose");
Object.keys(hotAvailableFilesMap).forEach(function(chunkId) {
if(hotAvailableFilesMap[chunkId] === false) {
hotDisposeChunk(chunkId);
}
});
var idx;
var queue = outdatedModules.slice();
while(queue.length > 0) {
moduleId = queue.pop();
module = installedModules[moduleId];
if(!module) continue;
var data = {};
// Call dispose handlers
var disposeHandlers = module.hot._disposeHandlers;
for(j = 0; j < disposeHandlers.length; j++) {
cb = disposeHandlers[j];
cb(data);
}
hotCurrentModuleData[moduleId] = data;
// disable module (this disables requires from this module)
module.hot.active = false;
// remove module from cache
delete installedModules[moduleId];
// remove "parents" references from all children
for(j = 0; j < module.children.length; j++) {
var child = installedModules[module.children[j]];
if(!child) continue;
idx = child.parents.indexOf(moduleId);
if(idx >= 0) {
child.parents.splice(idx, 1);
}
}
}
// remove outdated dependency from module children
var dependency;
var moduleOutdatedDependencies;
for(moduleId in outdatedDependencies) {
if(Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)) {
module = installedModules[moduleId];
if(module) {
moduleOutdatedDependencies = outdatedDependencies[moduleId];
for(j = 0; j < moduleOutdatedDependencies.length; j++) {
dependency = moduleOutdatedDependencies[j];
idx = module.children.indexOf(dependency);
if(idx >= 0) module.children.splice(idx, 1);
}
}
}
}
// Not in "apply" phase
hotSetStatus("apply");
hotCurrentHash = hotUpdateNewHash;
// insert new code
for(moduleId in appliedUpdate) {
if(Object.prototype.hasOwnProperty.call(appliedUpdate, moduleId)) {
modules[moduleId] = appliedUpdate[moduleId];
}
}
// call accept handlers
var error = null;
for(moduleId in outdatedDependencies) {
if(Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)) {
module = installedModules[moduleId];
moduleOutdatedDependencies = outdatedDependencies[moduleId];
var callbacks = [];
for(i = 0; i < moduleOutdatedDependencies.length; i++) {
dependency = moduleOutdatedDependencies[i];
cb = module.hot._acceptedDependencies[dependency];
if(callbacks.indexOf(cb) >= 0) continue;
callbacks.push(cb);
}
for(i = 0; i < callbacks.length; i++) {
cb = callbacks[i];
try {
cb(moduleOutdatedDependencies);
} catch(err) {
if(options.onErrored) {
options.onErrored({
type: "accept-errored",
moduleId: moduleId,
dependencyId: moduleOutdatedDependencies[i],
error: err
});
}
if(!options.ignoreErrored) {
if(!error)
error = err;
}
}
}
}
}
// Load self accepted modules
for(i = 0; i < outdatedSelfAcceptedModules.length; i++) {
var item = outdatedSelfAcceptedModules[i];
moduleId = item.module;
hotCurrentParents = [moduleId];
try {
$require$(moduleId);
} catch(err) {
if(typeof item.errorHandler === "function") {
try {
item.errorHandler(err);
} catch(err2) {
if(options.onErrored) {
options.onErrored({
type: "self-accept-error-handler-errored",
moduleId: moduleId,
error: err2,
orginalError: err
});
}
if(!options.ignoreErrored) {
if(!error)
error = err2;
}
if(!error)
error = err;
}
} else {
if(options.onErrored) {
options.onErrored({
type: "self-accept-errored",
moduleId: moduleId,
error: err
});
}
if(!options.ignoreErrored) {
if(!error)
error = err;
}
}
}
}
// handle errors in accept handlers and self accepted module load
if(error) {
hotSetStatus("fail");
return Promise.reject(error);
}
hotSetStatus("idle");
return new Promise(function(resolve) {
resolve(outdatedModules);
});
}
};

View File

@@ -0,0 +1,259 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
var Template = require("./Template");
var ModuleHotAcceptDependency = require("./dependencies/ModuleHotAcceptDependency");
var ModuleHotDeclineDependency = require("./dependencies/ModuleHotDeclineDependency");
var RawSource = require("webpack-sources").RawSource;
var ConstDependency = require("./dependencies/ConstDependency");
var NullFactory = require("./NullFactory");
const ParserHelpers = require("./ParserHelpers");
function HotModuleReplacementPlugin(options) {
options = options || {};
this.multiStep = options.multiStep;
this.fullBuildTimeout = options.fullBuildTimeout || 200;
}
module.exports = HotModuleReplacementPlugin;
HotModuleReplacementPlugin.prototype.apply = function(compiler) {
var multiStep = this.multiStep;
var fullBuildTimeout = this.fullBuildTimeout;
var hotUpdateChunkFilename = compiler.options.output.hotUpdateChunkFilename;
var hotUpdateMainFilename = compiler.options.output.hotUpdateMainFilename;
compiler.plugin("compilation", function(compilation, params) {
var hotUpdateChunkTemplate = compilation.hotUpdateChunkTemplate;
if(!hotUpdateChunkTemplate) return;
var normalModuleFactory = params.normalModuleFactory;
compilation.dependencyFactories.set(ConstDependency, new NullFactory());
compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());
compilation.dependencyFactories.set(ModuleHotAcceptDependency, normalModuleFactory);
compilation.dependencyTemplates.set(ModuleHotAcceptDependency, new ModuleHotAcceptDependency.Template());
compilation.dependencyFactories.set(ModuleHotDeclineDependency, normalModuleFactory);
compilation.dependencyTemplates.set(ModuleHotDeclineDependency, new ModuleHotDeclineDependency.Template());
compilation.plugin("record", function(compilation, records) {
if(records.hash === this.hash) return;
records.hash = compilation.hash;
records.moduleHashs = {};
this.modules.forEach(function(module) {
var identifier = module.identifier();
var hash = require("crypto").createHash("md5");
module.updateHash(hash);
records.moduleHashs[identifier] = hash.digest("hex");
});
records.chunkHashs = {};
this.chunks.forEach(function(chunk) {
records.chunkHashs[chunk.id] = chunk.hash;
});
records.chunkModuleIds = {};
this.chunks.forEach(function(chunk) {
records.chunkModuleIds[chunk.id] = chunk.modules.map(function(m) {
return m.id;
});
});
});
var initialPass = false;
var recompilation = false;
compilation.plugin("after-hash", function() {
var records = this.records;
if(!records) {
initialPass = true;
return;
}
if(!records.hash)
initialPass = true;
var preHash = records.preHash || "x";
var prepreHash = records.prepreHash || "x";
if(preHash === this.hash) {
recompilation = true;
this.modifyHash(prepreHash);
return;
}
records.prepreHash = records.hash || "x";
records.preHash = this.hash;
this.modifyHash(records.prepreHash);
});
compilation.plugin("should-generate-chunk-assets", function() {
if(multiStep && !recompilation && !initialPass)
return false;
});
compilation.plugin("need-additional-pass", function() {
if(multiStep && !recompilation && !initialPass)
return true;
});
compiler.plugin("additional-pass", function(callback) {
if(multiStep)
return setTimeout(callback, fullBuildTimeout);
return callback();
});
compilation.plugin("additional-chunk-assets", function() {
var records = this.records;
if(records.hash === this.hash) return;
if(!records.moduleHashs || !records.chunkHashs || !records.chunkModuleIds) return;
this.modules.forEach(function(module) {
var identifier = module.identifier();
var hash = require("crypto").createHash("md5");
module.updateHash(hash);
hash = hash.digest("hex");
module.hotUpdate = records.moduleHashs[identifier] !== hash;
});
var hotUpdateMainContent = {
h: this.hash,
c: {}
};
Object.keys(records.chunkHashs).forEach(function(chunkId) {
chunkId = isNaN(+chunkId) ? chunkId : +chunkId;
var currentChunk = this.chunks.find(chunk => chunk.id === chunkId);
if(currentChunk) {
var newModules = currentChunk.modules.filter(function(module) {
return module.hotUpdate;
});
var allModules = {};
currentChunk.modules.forEach(function(module) {
allModules[module.id] = true;
});
var removedModules = records.chunkModuleIds[chunkId].filter(function(id) {
return !allModules[id];
});
if(newModules.length > 0 || removedModules.length > 0) {
var source = hotUpdateChunkTemplate.render(chunkId, newModules, removedModules, this.hash, this.moduleTemplate, this.dependencyTemplates);
var filename = this.getPath(hotUpdateChunkFilename, {
hash: records.hash,
chunk: currentChunk
});
this.additionalChunkAssets.push(filename);
this.assets[filename] = source;
hotUpdateMainContent.c[chunkId] = true;
currentChunk.files.push(filename);
this.applyPlugins("chunk-asset", currentChunk, filename);
}
} else {
hotUpdateMainContent.c[chunkId] = false;
}
}, this);
var source = new RawSource(JSON.stringify(hotUpdateMainContent));
var filename = this.getPath(hotUpdateMainFilename, {
hash: records.hash
});
this.assets[filename] = source;
});
compilation.mainTemplate.plugin("hash", function(hash) {
hash.update("HotMainTemplateDecorator");
});
compilation.mainTemplate.plugin("module-require", function(_, chunk, hash, varModuleId) {
return "hotCreateRequire(" + varModuleId + ")";
});
compilation.mainTemplate.plugin("require-extensions", function(source) {
var buf = [source];
buf.push("");
buf.push("// __webpack_hash__");
buf.push(this.requireFn + ".h = function() { return hotCurrentHash; };");
return this.asString(buf);
});
compilation.mainTemplate.plugin("bootstrap", function(source, chunk, hash) {
source = this.applyPluginsWaterfall("hot-bootstrap", source, chunk, hash);
return this.asString([
source,
"",
hotInitCode
.replace(/\$require\$/g, this.requireFn)
.replace(/\$hash\$/g, JSON.stringify(hash))
.replace(/\/\*foreachInstalledChunks\*\//g, chunk.chunks.length > 0 ? "for(var chunkId in installedChunks)" : "var chunkId = " + JSON.stringify(chunk.id) + ";")
]);
});
compilation.mainTemplate.plugin("global-hash", function() {
return true;
});
compilation.mainTemplate.plugin("current-hash", function(_, length) {
if(isFinite(length))
return "hotCurrentHash.substr(0, " + length + ")";
else
return "hotCurrentHash";
});
compilation.mainTemplate.plugin("module-obj", function(source, chunk, hash, varModuleId) {
return this.asString([
source + ",",
"hot: hotCreateModule(" + varModuleId + "),",
"parents: (hotCurrentParentsTemp = hotCurrentParents, hotCurrentParents = [], hotCurrentParentsTemp),",
"children: []"
]);
});
params.normalModuleFactory.plugin("parser", function(parser, parserOptions) {
parser.plugin("expression __webpack_hash__", ParserHelpers.toConstantDependency("__webpack_require__.h()"));
parser.plugin("evaluate typeof __webpack_hash__", ParserHelpers.evaluateToString("string"));
parser.plugin("evaluate Identifier module.hot", function(expr) {
return ParserHelpers.evaluateToBoolean(!!this.state.compilation.hotUpdateChunkTemplate)(expr);
});
parser.plugin("call module.hot.accept", function(expr) {
if(!this.state.compilation.hotUpdateChunkTemplate) return false;
if(expr.arguments.length >= 1) {
var arg = this.evaluateExpression(expr.arguments[0]);
var params = [],
requests = [];
if(arg.isString()) {
params = [arg];
} else if(arg.isArray()) {
params = arg.items.filter(function(param) {
return param.isString();
});
}
if(params.length > 0) {
params.forEach(function(param, idx) {
var request = param.string;
var dep = new ModuleHotAcceptDependency(request, param.range);
dep.optional = true;
dep.loc = Object.create(expr.loc);
dep.loc.index = idx;
this.state.module.addDependency(dep);
requests.push(request);
}.bind(this));
if(expr.arguments.length > 1)
this.applyPluginsBailResult("hot accept callback", expr.arguments[1], requests);
else
this.applyPluginsBailResult("hot accept without callback", expr, requests);
}
}
});
parser.plugin("call module.hot.decline", function(expr) {
if(!this.state.compilation.hotUpdateChunkTemplate) return false;
if(expr.arguments.length === 1) {
var arg = this.evaluateExpression(expr.arguments[0]);
var params = [];
if(arg.isString()) {
params = [arg];
} else if(arg.isArray()) {
params = arg.items.filter(function(param) {
return param.isString();
});
}
params.forEach(function(param, idx) {
var dep = new ModuleHotDeclineDependency(param.string, param.range);
dep.optional = true;
dep.loc = Object.create(expr.loc);
dep.loc.index = idx;
this.state.module.addDependency(dep);
}.bind(this));
}
});
parser.plugin("expression module.hot", ParserHelpers.skipTraversal);
});
});
};
var hotInitCode = Template.getFunctionContent(require("./HotModuleReplacement.runtime.js"));

30
web/node_modules/webpack/lib/HotUpdateChunkTemplate.js generated vendored Normal file
View File

@@ -0,0 +1,30 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Template = require("./Template");
module.exports = class HotUpdateChunkTemplate extends Template {
constructor(outputOptions) {
super(outputOptions);
}
render(id, modules, removedModules, hash, moduleTemplate, dependencyTemplates) {
const modulesSource = this.renderChunkModules({
id: id,
modules: modules,
removedModules: removedModules
}, moduleTemplate, dependencyTemplates);
const core = this.applyPluginsWaterfall("modules", modulesSource, modules, removedModules, moduleTemplate, dependencyTemplates);
const source = this.applyPluginsWaterfall("render", core, modules, removedModules, hash, id, moduleTemplate, dependencyTemplates);
return source;
}
updateHash(hash) {
hash.update("HotUpdateChunkTemplate");
hash.update("1");
this.applyPlugins("hash", hash);
}
};

69
web/node_modules/webpack/lib/IgnorePlugin.js generated vendored Normal file
View File

@@ -0,0 +1,69 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
class IgnorePlugin {
constructor(resourceRegExp, contextRegExp) {
this.resourceRegExp = resourceRegExp;
this.contextRegExp = contextRegExp;
this.checkIgnore = this.checkIgnore.bind(this);
}
/*
* Only returns true if a "resourceRegExp" exists
* and the resource given matches the regexp.
*/
checkResource(resource) {
if(!this.resourceRegExp) {
return false;
}
return this.resourceRegExp.test(resource);
}
/*
* Returns true if contextRegExp does not exist
* or if context matches the given regexp.
*/
checkContext(context) {
if(!this.contextRegExp) {
return true;
}
return this.contextRegExp.test(context);
}
/*
* Returns true if result should be ignored.
* false if it shouldn't.
*
* Not that if "contextRegExp" is given, both the "resourceRegExp"
* and "contextRegExp" have to match.
*/
checkResult(result) {
if(!result) {
return true;
}
return this.checkResource(result.request) && this.checkContext(result.context);
}
checkIgnore(result, callback) {
// check if result is ignored
if(this.checkResult(result)) {
return callback();
}
return callback(null, result);
}
apply(compiler) {
compiler.plugin("normal-module-factory", (nmf) => {
nmf.plugin("before-resolve", this.checkIgnore);
});
compiler.plugin("context-module-factory", (cmf) => {
cmf.plugin("before-resolve", this.checkIgnore);
});
}
}
module.exports = IgnorePlugin;

View File

@@ -0,0 +1,31 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ConcatSource = require("webpack-sources").ConcatSource;
class JsonpChunkTemplatePlugin {
apply(chunkTemplate) {
chunkTemplate.plugin("render", function(modules, chunk) {
const jsonpFunction = this.outputOptions.jsonpFunction;
const source = new ConcatSource();
source.add(`${jsonpFunction}(${JSON.stringify(chunk.ids)},`);
source.add(modules);
const entries = [chunk.entryModule].filter(Boolean).map(m => m.id);
if(entries.length > 0) {
source.add(`,${JSON.stringify(entries)}`);
}
source.add(")");
return source;
});
chunkTemplate.plugin("hash", function(hash) {
hash.update("JsonpChunkTemplatePlugin");
hash.update("3");
hash.update(`${this.outputOptions.jsonpFunction}`);
hash.update(`${this.outputOptions.library}`);
});
}
}
module.exports = JsonpChunkTemplatePlugin;

View File

@@ -0,0 +1,37 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ConcatSource = require("webpack-sources").ConcatSource;
class JsonpExportMainTemplatePlugin {
constructor(name) {
this.name = name;
}
apply(compilation) {
const mainTemplate = compilation.mainTemplate;
compilation.templatesPlugin("render-with-entry", (source, chunk, hash) => {
const name = mainTemplate.applyPluginsWaterfall("asset-path", this.name || "", {
hash: hash,
chunk: chunk
});
return new ConcatSource(`${name}(`, source, ");");
});
mainTemplate.plugin("global-hash-paths", paths => {
if(this.name) paths.push(this.name);
return paths;
});
mainTemplate.plugin("hash", hash => {
hash.update("jsonp export");
hash.update(`${this.name}`);
});
}
}
module.exports = JsonpExportMainTemplatePlugin;

View File

@@ -0,0 +1,27 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ConcatSource = require("webpack-sources").ConcatSource;
class JsonpHotUpdateChunkTemplatePlugin {
apply(hotUpdateChunkTemplate) {
hotUpdateChunkTemplate.plugin("render", function(modulesSource, modules, removedModules, hash, id) {
const source = new ConcatSource();
source.add(`${this.outputOptions.hotUpdateFunction}(${JSON.stringify(id)},`);
source.add(modulesSource);
source.add(")");
return source;
});
hotUpdateChunkTemplate.plugin("hash", function(hash) {
hash.update("JsonpHotUpdateChunkTemplatePlugin");
hash.update("3");
hash.update(`${this.outputOptions.hotUpdateFunction}`);
hash.update(`${this.outputOptions.library}`);
});
}
}
module.exports = JsonpHotUpdateChunkTemplatePlugin;

View File

@@ -0,0 +1,58 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
/*globals hotAddUpdateChunk parentHotUpdateCallback document XMLHttpRequest $require$ $hotChunkFilename$ $hotMainFilename$ */
module.exports = function() {
function webpackHotUpdateCallback(chunkId, moreModules) { // eslint-disable-line no-unused-vars
hotAddUpdateChunk(chunkId, moreModules);
if(parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules);
} //$semicolon
function hotDownloadUpdateChunk(chunkId) { // eslint-disable-line no-unused-vars
var head = document.getElementsByTagName("head")[0];
var script = document.createElement("script");
script.type = "text/javascript";
script.charset = "utf-8";
script.src = $require$.p + $hotChunkFilename$;
head.appendChild(script);
}
function hotDownloadManifest() { // eslint-disable-line no-unused-vars
return new Promise(function(resolve, reject) {
if(typeof XMLHttpRequest === "undefined")
return reject(new Error("No browser support"));
try {
var request = new XMLHttpRequest();
var requestPath = $require$.p + $hotMainFilename$;
request.open("GET", requestPath, true);
request.timeout = 10000;
request.send(null);
} catch(err) {
return reject(err);
}
request.onreadystatechange = function() {
if(request.readyState !== 4) return;
if(request.status === 0) {
// timeout
reject(new Error("Manifest request to " + requestPath + " timed out."));
} else if(request.status === 404) {
// no update available
resolve();
} else if(request.status !== 200 && request.status !== 304) {
// other failure
reject(new Error("Manifest request to " + requestPath + " failed."));
} else {
// success
try {
var update = JSON.parse(request.responseText);
} catch(e) {
reject(e);
return;
}
resolve(update);
}
};
});
}
};

209
web/node_modules/webpack/lib/JsonpMainTemplatePlugin.js generated vendored Normal file
View File

@@ -0,0 +1,209 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Template = require("./Template");
class JsonpMainTemplatePlugin {
apply(mainTemplate) {
mainTemplate.plugin("local-vars", function(source, chunk) {
if(chunk.chunks.length > 0) {
return this.asString([
source,
"",
"// objects to store loaded and loading chunks",
"var installedChunks = {",
this.indent(
chunk.ids.map(id => `${JSON.stringify(id)}: 0`).join(",\n")
),
"};"
]);
}
return source;
});
mainTemplate.plugin("jsonp-script", function(_, chunk, hash) {
const chunkFilename = this.outputOptions.chunkFilename;
const chunkMaps = chunk.getChunkMaps();
const crossOriginLoading = this.outputOptions.crossOriginLoading;
const chunkLoadTimeout = this.outputOptions.chunkLoadTimeout;
const scriptSrcPath = this.applyPluginsWaterfall("asset-path", JSON.stringify(chunkFilename), {
hash: `" + ${this.renderCurrentHashCode(hash)} + "`,
hashWithLength: length => `" + ${this.renderCurrentHashCode(hash, length)} + "`,
chunk: {
id: "\" + chunkId + \"",
hash: `" + ${JSON.stringify(chunkMaps.hash)}[chunkId] + "`,
hashWithLength(length) {
const shortChunkHashMap = Object.create(null);
Object.keys(chunkMaps.hash).forEach(chunkId => {
if(typeof chunkMaps.hash[chunkId] === "string")
shortChunkHashMap[chunkId] = chunkMaps.hash[chunkId].substr(0, length);
});
return `" + ${JSON.stringify(shortChunkHashMap)}[chunkId] + "`;
},
name: `" + (${JSON.stringify(chunkMaps.name)}[chunkId]||chunkId) + "`
}
});
return this.asString([
"var script = document.createElement('script');",
"script.type = 'text/javascript';",
"script.charset = 'utf-8';",
"script.async = true;",
`script.timeout = ${chunkLoadTimeout};`,
crossOriginLoading ? `script.crossOrigin = ${JSON.stringify(crossOriginLoading)};` : "",
`if (${this.requireFn}.nc) {`,
this.indent(`script.setAttribute("nonce", ${this.requireFn}.nc);`),
"}",
`script.src = ${this.requireFn}.p + ${scriptSrcPath};`,
`var timeout = setTimeout(onScriptComplete, ${chunkLoadTimeout});`,
"script.onerror = script.onload = onScriptComplete;",
"function onScriptComplete() {",
this.indent([
"// avoid mem leaks in IE.",
"script.onerror = script.onload = null;",
"clearTimeout(timeout);",
"var chunk = installedChunks[chunkId];",
"if(chunk !== 0) {",
this.indent([
"if(chunk) {",
this.indent("chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));"),
"}",
"installedChunks[chunkId] = undefined;"
]),
"}"
]),
"};",
]);
});
mainTemplate.plugin("require-ensure", function(_, chunk, hash) {
return this.asString([
"var installedChunkData = installedChunks[chunkId];",
"if(installedChunkData === 0) {",
this.indent([
"return new Promise(function(resolve) { resolve(); });"
]),
"}",
"",
"// a Promise means \"currently loading\".",
"if(installedChunkData) {",
this.indent([
"return installedChunkData[2];"
]),
"}",
"",
"// setup Promise in chunk cache",
"var promise = new Promise(function(resolve, reject) {",
this.indent([
"installedChunkData = installedChunks[chunkId] = [resolve, reject];"
]),
"});",
"installedChunkData[2] = promise;",
"",
"// start chunk loading",
"var head = document.getElementsByTagName('head')[0];",
this.applyPluginsWaterfall("jsonp-script", "", chunk, hash),
"head.appendChild(script);",
"",
"return promise;"
]);
});
mainTemplate.plugin("require-extensions", function(source, chunk) {
if(chunk.chunks.length === 0) return source;
return this.asString([
source,
"",
"// on error function for async loading",
`${this.requireFn}.oe = function(err) { console.error(err); throw err; };`
]);
});
mainTemplate.plugin("bootstrap", function(source, chunk, hash) {
if(chunk.chunks.length > 0) {
var jsonpFunction = this.outputOptions.jsonpFunction;
return this.asString([
source,
"",
"// install a JSONP callback for chunk loading",
`var parentJsonpFunction = window[${JSON.stringify(jsonpFunction)}];`,
`window[${JSON.stringify(jsonpFunction)}] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {`,
this.indent([
"// add \"moreModules\" to the modules object,",
"// then flag all \"chunkIds\" as loaded and fire callback",
"var moduleId, chunkId, i = 0, resolves = [], result;",
"for(;i < chunkIds.length; i++) {",
this.indent([
"chunkId = chunkIds[i];",
"if(installedChunks[chunkId]) {",
this.indent("resolves.push(installedChunks[chunkId][0]);"),
"}",
"installedChunks[chunkId] = 0;"
]),
"}",
"for(moduleId in moreModules) {",
this.indent([
"if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {",
this.indent(this.renderAddModule(hash, chunk, "moduleId", "moreModules[moduleId]")),
"}"
]),
"}",
"if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);",
"while(resolves.length) {",
this.indent("resolves.shift()();"),
"}",
this.entryPointInChildren(chunk) ? [
"if(executeModules) {",
this.indent([
"for(i=0; i < executeModules.length; i++) {",
this.indent(`result = ${this.requireFn}(${this.requireFn}.s = executeModules[i]);`),
"}"
]),
"}",
"return result;",
] : ""
]),
"};"
]);
}
return source;
});
mainTemplate.plugin("hot-bootstrap", function(source, chunk, hash) {
const hotUpdateChunkFilename = this.outputOptions.hotUpdateChunkFilename;
const hotUpdateMainFilename = this.outputOptions.hotUpdateMainFilename;
const hotUpdateFunction = this.outputOptions.hotUpdateFunction;
const currentHotUpdateChunkFilename = this.applyPluginsWaterfall("asset-path", JSON.stringify(hotUpdateChunkFilename), {
hash: `" + ${this.renderCurrentHashCode(hash)} + "`,
hashWithLength: length => `" + ${this.renderCurrentHashCode(hash, length)} + "`,
chunk: {
id: "\" + chunkId + \""
}
});
const currentHotUpdateMainFilename = this.applyPluginsWaterfall("asset-path", JSON.stringify(hotUpdateMainFilename), {
hash: `" + ${this.renderCurrentHashCode(hash)} + "`,
hashWithLength: length => `" + ${this.renderCurrentHashCode(hash, length)} + "`
});
const runtimeSource = Template.getFunctionContent(require("./JsonpMainTemplate.runtime.js"))
.replace(/\/\/\$semicolon/g, ";")
.replace(/\$require\$/g, this.requireFn)
.replace(/\$hotMainFilename\$/g, currentHotUpdateMainFilename)
.replace(/\$hotChunkFilename\$/g, currentHotUpdateChunkFilename)
.replace(/\$hash\$/g, JSON.stringify(hash));
return `${source}
function hotDisposeChunk(chunkId) {
delete installedChunks[chunkId];
}
var parentHotUpdateCallback = this[${JSON.stringify(hotUpdateFunction)}];
this[${JSON.stringify(hotUpdateFunction)}] = ${runtimeSource}`;
});
mainTemplate.plugin("hash", function(hash) {
hash.update("jsonp");
hash.update("4");
hash.update(`${this.outputOptions.filename}`);
hash.update(`${this.outputOptions.chunkFilename}`);
hash.update(`${this.outputOptions.jsonpFunction}`);
hash.update(`${this.outputOptions.hotUpdateFunction}`);
});
}
}
module.exports = JsonpMainTemplatePlugin;

21
web/node_modules/webpack/lib/JsonpTemplatePlugin.js generated vendored Normal file
View File

@@ -0,0 +1,21 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const JsonpMainTemplatePlugin = require("./JsonpMainTemplatePlugin");
const JsonpChunkTemplatePlugin = require("./JsonpChunkTemplatePlugin");
const JsonpHotUpdateChunkTemplatePlugin = require("./JsonpHotUpdateChunkTemplatePlugin");
class JsonpTemplatePlugin {
apply(compiler) {
compiler.plugin("this-compilation", (compilation) => {
compilation.mainTemplate.apply(new JsonpMainTemplatePlugin());
compilation.chunkTemplate.apply(new JsonpChunkTemplatePlugin());
compilation.hotUpdateChunkTemplate.apply(new JsonpHotUpdateChunkTemplatePlugin());
});
}
}
module.exports = JsonpTemplatePlugin;

58
web/node_modules/webpack/lib/LibManifestPlugin.js generated vendored Normal file
View File

@@ -0,0 +1,58 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const path = require("path");
const asyncLib = require("async");
class LibManifestPlugin {
constructor(options) {
this.options = options;
}
apply(compiler) {
compiler.plugin("emit", (compilation, callback) => {
asyncLib.forEach(compilation.chunks, (chunk, callback) => {
if(!chunk.isInitial()) {
callback();
return;
}
const targetPath = compilation.getPath(this.options.path, {
hash: compilation.hash,
chunk
});
const name = this.options.name && compilation.getPath(this.options.name, {
hash: compilation.hash,
chunk
});
const manifest = {
name,
type: this.options.type,
content: chunk.modules.reduce((obj, module) => {
if(module.libIdent) {
const ident = module.libIdent({
context: this.options.context || compiler.options.context
});
if(ident) {
obj[ident] = {
id: module.id,
meta: module.meta,
exports: Array.isArray(module.providedExports) ? module.providedExports : undefined
};
}
}
return obj;
}, {})
};
const content = new Buffer(JSON.stringify(manifest), "utf8"); //eslint-disable-line
compiler.outputFileSystem.mkdirp(path.dirname(targetPath), err => {
if(err) return callback(err);
compiler.outputFileSystem.writeFile(targetPath, content, callback);
});
}, callback);
});
}
}
module.exports = LibManifestPlugin;

87
web/node_modules/webpack/lib/LibraryTemplatePlugin.js generated vendored Normal file
View File

@@ -0,0 +1,87 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const SetVarMainTemplatePlugin = require("./SetVarMainTemplatePlugin");
function accessorToObjectAccess(accessor) {
return accessor.map((a) => {
return `[${JSON.stringify(a)}]`;
}).join("");
}
function accessorAccess(base, accessor, joinWith) {
accessor = [].concat(accessor);
return accessor.map((a, idx) => {
a = base ?
base + accessorToObjectAccess(accessor.slice(0, idx + 1)) :
accessor[0] + accessorToObjectAccess(accessor.slice(1, idx + 1));
if(idx === accessor.length - 1) return a;
if(idx === 0 && typeof base === "undefined") return `${a} = typeof ${a} === "object" ? ${a} : {}`;
return `${a} = ${a} || {}`;
}).join(joinWith || "; ");
}
class LibraryTemplatePlugin {
constructor(name, target, umdNamedDefine, auxiliaryComment) {
this.name = name;
this.target = target;
this.umdNamedDefine = umdNamedDefine;
this.auxiliaryComment = auxiliaryComment;
}
apply(compiler) {
compiler.plugin("this-compilation", (compilation) => {
switch(this.target) {
case "var":
compilation.apply(new SetVarMainTemplatePlugin(`var ${accessorAccess(false, this.name)}`));
break;
case "assign":
compilation.apply(new SetVarMainTemplatePlugin(accessorAccess(undefined, this.name)));
break;
case "this":
case "window":
case "global":
if(this.name)
compilation.apply(new SetVarMainTemplatePlugin(accessorAccess(this.target, this.name)));
else
compilation.apply(new SetVarMainTemplatePlugin(this.target, true));
break;
case "commonjs":
if(this.name)
compilation.apply(new SetVarMainTemplatePlugin(accessorAccess("exports", this.name)));
else
compilation.apply(new SetVarMainTemplatePlugin("exports", true));
break;
case "commonjs2":
case "commonjs-module":
compilation.apply(new SetVarMainTemplatePlugin("module.exports"));
break;
case "amd":
var AmdMainTemplatePlugin = require("./AmdMainTemplatePlugin");
compilation.apply(new AmdMainTemplatePlugin(this.name));
break;
case "umd":
case "umd2":
var UmdMainTemplatePlugin = require("./UmdMainTemplatePlugin");
compilation.apply(new UmdMainTemplatePlugin(this.name, {
optionalAmdExternalAsGlobal: this.target === "umd2",
namedDefine: this.umdNamedDefine,
auxiliaryComment: this.auxiliaryComment
}));
break;
case "jsonp":
var JsonpExportMainTemplatePlugin = require("./JsonpExportMainTemplatePlugin");
compilation.apply(new JsonpExportMainTemplatePlugin(this.name));
break;
default:
throw new Error(`${this.target} is not a valid Library target`);
}
});
}
}
module.exports = LibraryTemplatePlugin;

36
web/node_modules/webpack/lib/LoaderOptionsPlugin.js generated vendored Normal file
View File

@@ -0,0 +1,36 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ModuleFilenameHelpers = require("./ModuleFilenameHelpers");
class LoaderOptionsPlugin {
constructor(options) {
if(typeof options !== "object") options = {};
if(!options.test) options.test = {
test: () => true
};
this.options = options;
}
apply(compiler) {
const options = this.options;
compiler.plugin("compilation", (compilation) => {
compilation.plugin("normal-module-loader", (context, module) => {
const resource = module.resource;
if(!resource) return;
const i = resource.indexOf("?");
if(ModuleFilenameHelpers.matchObject(options, i < 0 ? resource : resource.substr(0, i))) {
const filterSet = new Set(["include", "exclude", "test"]);
Object.keys(options)
.filter((key) => !filterSet.has(key))
.forEach((key) => context[key] = options[key]);
}
});
});
}
}
module.exports = LoaderOptionsPlugin;

19
web/node_modules/webpack/lib/LoaderTargetPlugin.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
class LoaderTargetPlugin {
constructor(target) {
this.target = target;
}
apply(compiler) {
compiler.plugin("compilation", (compilation) => {
compilation.plugin("normal-module-loader", (loaderContext) => loaderContext.target = this.target);
});
}
}
module.exports = LoaderTargetPlugin;

235
web/node_modules/webpack/lib/MainTemplate.js generated vendored Normal file
View File

@@ -0,0 +1,235 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ConcatSource = require("webpack-sources").ConcatSource;
const OriginalSource = require("webpack-sources").OriginalSource;
const PrefixSource = require("webpack-sources").PrefixSource;
const Template = require("./Template");
// require function shortcuts:
// __webpack_require__.s = the module id of the entry point
// __webpack_require__.c = the module cache
// __webpack_require__.m = the module functions
// __webpack_require__.p = the bundle public path
// __webpack_require__.i = the identity function used for harmony imports
// __webpack_require__.e = the chunk ensure function
// __webpack_require__.d = the exported propery define getter function
// __webpack_require__.o = Object.prototype.hasOwnProperty.call
// __webpack_require__.n = compatibility get default export
// __webpack_require__.h = the webpack hash
// __webpack_require__.oe = the uncatched error handler for the webpack runtime
// __webpack_require__.nc = the script nonce
module.exports = class MainTemplate extends Template {
constructor(outputOptions) {
super(outputOptions);
this.plugin("startup", (source, chunk, hash) => {
const buf = [];
if(chunk.entryModule) {
buf.push("// Load entry module and return exports");
buf.push(`return ${this.renderRequireFunctionForModule(hash, chunk, JSON.stringify(chunk.entryModule.id))}(${this.requireFn}.s = ${JSON.stringify(chunk.entryModule.id)});`);
}
return this.asString(buf);
});
this.plugin("render", (bootstrapSource, chunk, hash, moduleTemplate, dependencyTemplates) => {
const source = new ConcatSource();
source.add("/******/ (function(modules) { // webpackBootstrap\n");
source.add(new PrefixSource("/******/", bootstrapSource));
source.add("/******/ })\n");
source.add("/************************************************************************/\n");
source.add("/******/ (");
const modules = this.renderChunkModules(chunk, moduleTemplate, dependencyTemplates, "/******/ ");
source.add(this.applyPluginsWaterfall("modules", modules, chunk, hash, moduleTemplate, dependencyTemplates));
source.add(")");
return source;
});
this.plugin("local-vars", (source, chunk, hash) => {
return this.asString([
source,
"// The module cache",
"var installedModules = {};"
]);
});
this.plugin("require", (source, chunk, hash) => {
return this.asString([
source,
"// Check if module is in cache",
"if(installedModules[moduleId]) {",
this.indent("return installedModules[moduleId].exports;"),
"}",
"// Create a new module (and put it into the cache)",
"var module = installedModules[moduleId] = {",
this.indent(this.applyPluginsWaterfall("module-obj", "", chunk, hash, "moduleId")),
"};",
"",
this.asString(outputOptions.strictModuleExceptionHandling ? [
"// Execute the module function",
"var threw = true;",
"try {",
this.indent([
`modules[moduleId].call(module.exports, module, module.exports, ${this.renderRequireFunctionForModule(hash, chunk, "moduleId")});`,
"threw = false;"
]),
"} finally {",
this.indent([
"if(threw) delete installedModules[moduleId];"
]),
"}"
] : [
"// Execute the module function",
`modules[moduleId].call(module.exports, module, module.exports, ${this.renderRequireFunctionForModule(hash, chunk, "moduleId")});`,
]),
"",
"// Flag the module as loaded",
"module.l = true;",
"",
"// Return the exports of the module",
"return module.exports;"
]);
});
this.plugin("module-obj", (source, chunk, hash, varModuleId) => {
return this.asString([
"i: moduleId,",
"l: false,",
"exports: {}"
]);
});
this.plugin("require-extensions", (source, chunk, hash) => {
const buf = [];
if(chunk.chunks.length > 0) {
buf.push("// This file contains only the entry chunk.");
buf.push("// The chunk loading function for additional chunks");
buf.push(`${this.requireFn}.e = function requireEnsure(chunkId) {`);
buf.push(this.indent(this.applyPluginsWaterfall("require-ensure", "throw new Error('Not chunk loading available');", chunk, hash, "chunkId")));
buf.push("};");
}
buf.push("");
buf.push("// expose the modules object (__webpack_modules__)");
buf.push(`${this.requireFn}.m = modules;`);
buf.push("");
buf.push("// expose the module cache");
buf.push(`${this.requireFn}.c = installedModules;`);
buf.push("");
buf.push("// identity function for calling harmony imports with the correct context");
buf.push(`${this.requireFn}.i = function(value) { return value; };`);
buf.push("");
buf.push("// define getter function for harmony exports");
buf.push(`${this.requireFn}.d = function(exports, name, getter) {`);
buf.push(this.indent([
`if(!${this.requireFn}.o(exports, name)) {`,
this.indent([
"Object.defineProperty(exports, name, {",
this.indent([
"configurable: false,",
"enumerable: true,",
"get: getter"
]),
"});"
]),
"}"
]));
buf.push("};");
buf.push("");
buf.push("// getDefaultExport function for compatibility with non-harmony modules");
buf.push(this.requireFn + ".n = function(module) {");
buf.push(this.indent([
"var getter = module && module.__esModule ?",
this.indent([
"function getDefault() { return module['default']; } :",
"function getModuleExports() { return module; };"
]),
`${this.requireFn}.d(getter, 'a', getter);`,
"return getter;"
]));
buf.push("};");
buf.push("");
buf.push("// Object.prototype.hasOwnProperty.call");
buf.push(`${this.requireFn}.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };`);
const publicPath = this.getPublicPath({
hash: hash
});
buf.push("");
buf.push("// __webpack_public_path__");
buf.push(`${this.requireFn}.p = ${JSON.stringify(publicPath)};`);
return this.asString(buf);
});
this.requireFn = "__webpack_require__";
}
render(hash, chunk, moduleTemplate, dependencyTemplates) {
const buf = [];
buf.push(this.applyPluginsWaterfall("bootstrap", "", chunk, hash, moduleTemplate, dependencyTemplates));
buf.push(this.applyPluginsWaterfall("local-vars", "", chunk, hash));
buf.push("");
buf.push("// The require function");
buf.push(`function ${this.requireFn}(moduleId) {`);
buf.push(this.indent(this.applyPluginsWaterfall("require", "", chunk, hash)));
buf.push("}");
buf.push("");
buf.push(this.asString(this.applyPluginsWaterfall("require-extensions", "", chunk, hash)));
buf.push("");
buf.push(this.asString(this.applyPluginsWaterfall("startup", "", chunk, hash)));
let source = this.applyPluginsWaterfall("render", new OriginalSource(this.prefix(buf, " \t") + "\n", `webpack/bootstrap ${hash}`), chunk, hash, moduleTemplate, dependencyTemplates);
if(chunk.hasEntryModule()) {
source = this.applyPluginsWaterfall("render-with-entry", source, chunk, hash);
}
if(!source) throw new Error("Compiler error: MainTemplate plugin 'render' should return something");
chunk.rendered = true;
return new ConcatSource(source, ";");
}
renderRequireFunctionForModule(hash, chunk, varModuleId) {
return this.applyPluginsWaterfall("module-require", this.requireFn, chunk, hash, varModuleId);
}
renderAddModule(hash, chunk, varModuleId, varModule) {
return this.applyPluginsWaterfall("add-module", `modules[${varModuleId}] = ${varModule};`, chunk, hash, varModuleId, varModule);
}
renderCurrentHashCode(hash, length) {
length = length || Infinity;
return this.applyPluginsWaterfall("current-hash", JSON.stringify(hash.substr(0, length)), length);
}
entryPointInChildren(chunk) {
const checkChildren = (chunk, alreadyCheckedChunks) => {
return chunk.chunks.some((child) => {
if(alreadyCheckedChunks.indexOf(child) >= 0) return;
alreadyCheckedChunks.push(child);
return child.hasEntryModule() || checkChildren(child, alreadyCheckedChunks);
});
};
return checkChildren(chunk, []);
}
getPublicPath(options) {
return this.applyPluginsWaterfall("asset-path", this.outputOptions.publicPath || "", options);
}
updateHash(hash) {
hash.update("maintemplate");
hash.update("3");
hash.update(this.outputOptions.publicPath + "");
this.applyPlugins("hash", hash);
}
updateHashForChunk(hash, chunk) {
this.updateHash(hash);
this.applyPlugins("hash-for-chunk", hash, chunk);
}
useChunkHash(chunk) {
const paths = this.applyPluginsWaterfall("global-hash-paths", []);
return !this.applyPluginsBailResult("global-hash", chunk, paths);
}
};

View File

@@ -0,0 +1,5 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
module.exports = require("memory-fs");

188
web/node_modules/webpack/lib/Module.js generated vendored Normal file
View File

@@ -0,0 +1,188 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const DependenciesBlock = require("./DependenciesBlock");
const ModuleReason = require("./ModuleReason");
const Template = require("./Template");
function addToSet(set, items) {
for(let item of items) {
if(set.indexOf(item) < 0)
set.push(item);
}
}
function byId(a, b) {
return a.id - b.id;
}
let debugId = 1000;
class Module extends DependenciesBlock {
constructor() {
super();
this.context = null;
this.reasons = [];
this.debugId = debugId++;
this.lastId = -1;
this.id = null;
this.portableId = null;
this.index = null;
this.index2 = null;
this.depth = null;
this.used = null;
this.usedExports = null;
this.providedExports = null;
this.chunks = [];
this.warnings = [];
this.dependenciesWarnings = [];
this.errors = [];
this.dependenciesErrors = [];
this.strict = false;
this.meta = {};
}
disconnect() {
this.reasons.length = 0;
this.lastId = this.id;
this.id = null;
this.index = null;
this.index2 = null;
this.depth = null;
this.used = null;
this.usedExports = null;
this.providedExports = null;
this.chunks.length = 0;
super.disconnect();
}
unseal() {
this.lastId = this.id;
this.id = null;
this.index = null;
this.index2 = null;
this.depth = null;
this.chunks.length = 0;
super.unseal();
}
addChunk(chunk) {
let idx = this.chunks.indexOf(chunk);
if(idx < 0)
this.chunks.push(chunk);
}
removeChunk(chunk) {
let idx = this.chunks.indexOf(chunk);
if(idx >= 0) {
this.chunks.splice(idx, 1);
chunk.removeModule(this);
return true;
}
return false;
}
addReason(module, dependency) {
this.reasons.push(new ModuleReason(module, dependency));
}
removeReason(module, dependency) {
for(let i = 0; i < this.reasons.length; i++) {
let r = this.reasons[i];
if(r.module === module && r.dependency === dependency) {
this.reasons.splice(i, 1);
return true;
}
}
return false;
}
hasReasonForChunk(chunk) {
for(let r of this.reasons) {
if(r.chunks) {
if(r.chunks.indexOf(chunk) >= 0)
return true;
} else if(r.module.chunks.indexOf(chunk) >= 0)
return true;
}
return false;
}
rewriteChunkInReasons(oldChunk, newChunks) {
this.reasons.forEach(r => {
if(!r.chunks) {
if(r.module.chunks.indexOf(oldChunk) < 0)
return;
r.chunks = r.module.chunks;
}
r.chunks = r.chunks.reduce((arr, c) => {
addToSet(arr, c !== oldChunk ? [c] : newChunks);
return arr;
}, []);
});
}
isUsed(exportName) {
if(this.used === null) return exportName;
if(!exportName) return !!this.used;
if(!this.used) return false;
if(!this.usedExports) return false;
if(this.usedExports === true) return exportName;
let idx = this.usedExports.indexOf(exportName);
if(idx < 0) return false;
if(this.isProvided(exportName))
return Template.numberToIdentifer(idx);
return exportName;
}
isProvided(exportName) {
if(!Array.isArray(this.providedExports))
return null;
return this.providedExports.indexOf(exportName) >= 0;
}
toString() {
return `Module[${this.id || this.debugId}]`;
}
needRebuild(fileTimestamps, contextTimestamps) {
return true;
}
updateHash(hash) {
hash.update(this.id + "" + this.used);
hash.update(JSON.stringify(this.usedExports));
super.updateHash(hash);
}
sortItems() {
super.sortItems();
this.chunks.sort(byId);
this.reasons.sort((a, b) => byId(a.module, b.module));
}
unbuild() {
this.disconnect();
}
}
Object.defineProperty(Module.prototype, "entry", {
configurable: false,
get() {
throw new Error("Module.entry was removed. Use Chunk.entryModule");
},
set() {
throw new Error("Module.entry was removed. Use Chunk.entryModule");
}
});
Module.prototype.identifier = null;
Module.prototype.readableIdentifier = null;
Module.prototype.build = null;
Module.prototype.source = null;
Module.prototype.size = null;
Module.prototype.nameForCondition = null;
module.exports = Module;

42
web/node_modules/webpack/lib/ModuleBuildError.js generated vendored Normal file
View File

@@ -0,0 +1,42 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const WebpackError = require("./WebpackError");
const cutOffLoaderExecution = require("./ErrorHelpers").cutOffLoaderExecution;
class ModuleBuildError extends WebpackError {
constructor(module, err) {
super();
this.name = "ModuleBuildError";
this.message = "Module build failed: ";
if(err !== null && typeof err === "object") {
if(typeof err.stack === "string" && err.stack) {
var stack = cutOffLoaderExecution(err.stack);
if(!err.hideStack) {
this.message += stack;
} else {
this.details = stack;
if(typeof err.message === "string" && err.message) {
this.message += err.message;
} else {
this.message += err;
}
}
} else if(typeof err.message === "string" && err.message) {
this.message += err.message;
} else {
this.message += err;
}
}
this.module = module;
this.error = err;
Error.captureStackTrace(this, this.constructor);
}
}
module.exports = ModuleBuildError;

22
web/node_modules/webpack/lib/ModuleDependencyError.js generated vendored Normal file
View File

@@ -0,0 +1,22 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const WebpackError = require("./WebpackError");
const formatLocation = require("./formatLocation");
module.exports = class ModuleDependencyError extends WebpackError {
constructor(module, err, loc) {
super();
this.name = "ModuleDependencyError";
this.message = `${formatLocation(loc)} ${err.message}`;
this.details = err.stack.split("\n").slice(1).join("\n");
this.origin = this.module = module;
this.error = err;
Error.captureStackTrace(this, this.constructor);
}
};

View File

@@ -0,0 +1,22 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const WebpackError = require("./WebpackError");
const formatLocation = require("./formatLocation");
module.exports = class ModuleDependencyWarning extends WebpackError {
constructor(module, err, loc) {
super();
this.name = "ModuleDependencyWarning";
this.message = `${formatLocation(loc)} ${err.message}`;
this.details = err.stack.split("\n").slice(1).join("\n");
this.origin = this.module = module;
this.error = err;
Error.captureStackTrace(this, this.constructor);
}
};

24
web/node_modules/webpack/lib/ModuleError.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const WebpackError = require("./WebpackError");
const cleanUp = require("./ErrorHelpers").cleanUp;
class ModuleError extends WebpackError {
constructor(module, err) {
super();
this.name = "ModuleError";
this.module = module;
this.message = err && typeof err === "object" && err.message ? err.message : err;
this.error = err;
this.details = err && typeof err === "object" && err.stack ? cleanUp(err.stack, this.message) : undefined;
Error.captureStackTrace(this, this.constructor);
}
}
module.exports = ModuleError;

162
web/node_modules/webpack/lib/ModuleFilenameHelpers.js generated vendored Normal file
View File

@@ -0,0 +1,162 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ModuleFilenameHelpers = exports;
ModuleFilenameHelpers.ALL_LOADERS_RESOURCE = "[all-loaders][resource]";
ModuleFilenameHelpers.REGEXP_ALL_LOADERS_RESOURCE = /\[all-?loaders\]\[resource\]/gi;
ModuleFilenameHelpers.LOADERS_RESOURCE = "[loaders][resource]";
ModuleFilenameHelpers.REGEXP_LOADERS_RESOURCE = /\[loaders\]\[resource\]/gi;
ModuleFilenameHelpers.RESOURCE = "[resource]";
ModuleFilenameHelpers.REGEXP_RESOURCE = /\[resource\]/gi;
ModuleFilenameHelpers.ABSOLUTE_RESOURCE_PATH = "[absolute-resource-path]";
ModuleFilenameHelpers.REGEXP_ABSOLUTE_RESOURCE_PATH = /\[abs(olute)?-?resource-?path\]/gi;
ModuleFilenameHelpers.RESOURCE_PATH = "[resource-path]";
ModuleFilenameHelpers.REGEXP_RESOURCE_PATH = /\[resource-?path\]/gi;
ModuleFilenameHelpers.ALL_LOADERS = "[all-loaders]";
ModuleFilenameHelpers.REGEXP_ALL_LOADERS = /\[all-?loaders\]/gi;
ModuleFilenameHelpers.LOADERS = "[loaders]";
ModuleFilenameHelpers.REGEXP_LOADERS = /\[loaders\]/gi;
ModuleFilenameHelpers.QUERY = "[query]";
ModuleFilenameHelpers.REGEXP_QUERY = /\[query\]/gi;
ModuleFilenameHelpers.ID = "[id]";
ModuleFilenameHelpers.REGEXP_ID = /\[id\]/gi;
ModuleFilenameHelpers.HASH = "[hash]";
ModuleFilenameHelpers.REGEXP_HASH = /\[hash\]/gi;
function getAfter(str, token) {
const idx = str.indexOf(token);
return idx < 0 ? "" : str.substr(idx);
}
function getBefore(str, token) {
const idx = str.lastIndexOf(token);
return idx < 0 ? "" : str.substr(0, idx);
}
function getHash(str) {
const hash = require("crypto").createHash("md5");
hash.update(str);
return hash.digest("hex").substr(0, 4);
}
function asRegExp(test) {
if(typeof test === "string") test = new RegExp("^" + test.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"));
return test;
}
ModuleFilenameHelpers.createFilename = function createFilename(module, moduleFilenameTemplate, requestShortener) {
let absoluteResourcePath;
let hash;
let identifier;
let moduleId;
let shortIdentifier;
if(module === undefined) module = "";
if(typeof module === "string") {
shortIdentifier = requestShortener.shorten(module);
identifier = shortIdentifier;
moduleId = "";
absoluteResourcePath = module.split("!").pop();
hash = getHash(identifier);
} else {
shortIdentifier = module.readableIdentifier(requestShortener);
identifier = requestShortener.shorten(module.identifier());
moduleId = module.id;
absoluteResourcePath = module.identifier().split("!").pop();
hash = getHash(identifier);
}
const resource = shortIdentifier.split("!").pop();
const loaders = getBefore(shortIdentifier, "!");
const allLoaders = getBefore(identifier, "!");
const query = getAfter(resource, "?");
const resourcePath = resource.substr(0, resource.length - query.length);
if(typeof moduleFilenameTemplate === "function") {
return moduleFilenameTemplate({
identifier: identifier,
shortIdentifier: shortIdentifier,
resource: resource,
resourcePath: resourcePath,
absoluteResourcePath: absoluteResourcePath,
allLoaders: allLoaders,
query: query,
moduleId: moduleId,
hash: hash
});
}
return moduleFilenameTemplate
.replace(ModuleFilenameHelpers.REGEXP_ALL_LOADERS_RESOURCE, identifier)
.replace(ModuleFilenameHelpers.REGEXP_LOADERS_RESOURCE, shortIdentifier)
.replace(ModuleFilenameHelpers.REGEXP_RESOURCE, resource)
.replace(ModuleFilenameHelpers.REGEXP_RESOURCE_PATH, resourcePath)
.replace(ModuleFilenameHelpers.REGEXP_ABSOLUTE_RESOURCE_PATH, absoluteResourcePath)
.replace(ModuleFilenameHelpers.REGEXP_ALL_LOADERS, allLoaders)
.replace(ModuleFilenameHelpers.REGEXP_LOADERS, loaders)
.replace(ModuleFilenameHelpers.REGEXP_QUERY, query)
.replace(ModuleFilenameHelpers.REGEXP_ID, moduleId)
.replace(ModuleFilenameHelpers.REGEXP_HASH, hash);
};
ModuleFilenameHelpers.createFooter = function createFooter(module, requestShortener) {
if(!module) module = "";
if(typeof module === "string") {
return [
"// WEBPACK FOOTER //",
`// ${requestShortener.shorten(module)}`
].join("\n");
} else {
return [
"//////////////////",
"// WEBPACK FOOTER",
`// ${module.readableIdentifier(requestShortener)}`,
`// module id = ${module.id}`,
`// module chunks = ${module.chunks.map(c => c.id).join(" ")}`
].join("\n");
}
};
ModuleFilenameHelpers.replaceDuplicates = function replaceDuplicates(array, fn, comparator) {
const countMap = Object.create(null);
const posMap = Object.create(null);
array.forEach((item, idx) => {
countMap[item] = (countMap[item] || []);
countMap[item].push(idx);
posMap[item] = 0;
});
if(comparator) {
Object.keys(countMap).forEach(item => {
countMap[item].sort(comparator);
});
}
return array.map((item, i) => {
if(countMap[item].length > 1) {
if(comparator && countMap[item][0] === i)
return item;
return fn(item, i, posMap[item]++);
} else return item;
});
};
ModuleFilenameHelpers.matchPart = function matchPart(str, test) {
if(!test) return true;
test = asRegExp(test);
if(Array.isArray(test)) {
return test.map(asRegExp).filter(function(regExp) {
return regExp.test(str);
}).length > 0;
} else {
return test.test(str);
}
};
ModuleFilenameHelpers.matchObject = function matchObject(obj, str) {
if(obj.test)
if(!ModuleFilenameHelpers.matchPart(str, obj.test)) return false;
if(obj.include)
if(!ModuleFilenameHelpers.matchPart(str, obj.include)) return false;
if(obj.exclude)
if(ModuleFilenameHelpers.matchPart(str, obj.exclude)) return false;
return true;
};

26
web/node_modules/webpack/lib/ModuleNotFoundError.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const WebpackError = require("./WebpackError");
class ModuleNotFoundError extends WebpackError {
constructor(module, err, dependencies) {
super();
this.name = "ModuleNotFoundError";
this.message = "Module not found: " + err;
this.details = err.details;
this.missing = err.missing;
this.module = module;
this.origin = module;
this.dependencies = dependencies;
this.error = err;
Error.captureStackTrace(this, this.constructor);
}
}
module.exports = ModuleNotFoundError;

34
web/node_modules/webpack/lib/ModuleParseError.js generated vendored Normal file
View File

@@ -0,0 +1,34 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const WebpackError = require("./WebpackError");
class ModuleParseError extends WebpackError {
constructor(module, source, err) {
super();
this.name = "ModuleParseError";
this.message = "Module parse failed: " + module.request + " " + err.message;
this.message += "\nYou may need an appropriate loader to handle this file type.";
if(err.loc && typeof err.loc === "object" && typeof err.loc.line === "number") {
var lineNumber = err.loc.line;
if(/[\0\u0001\u0002\u0003\u0004\u0005\u0006\u0007]/.test(source)) { // binary file
this.message += "\n(Source code omitted for this binary file)";
} else {
source = source.split("\n");
this.message += "\n| " + source.slice(Math.max(0, lineNumber - 3), lineNumber + 2).join("\n| ");
}
} else {
this.message += "\n" + err.stack;
}
this.module = module;
this.error = err;
Error.captureStackTrace(this, this.constructor);
}
}
module.exports = ModuleParseError;

12
web/node_modules/webpack/lib/ModuleReason.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
module.exports = class ModuleReason {
constructor(module, dependency) {
this.module = module;
this.dependency = dependency;
}
};

23
web/node_modules/webpack/lib/ModuleTemplate.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Template = require("./Template");
module.exports = class ModuleTemplate extends Template {
constructor(outputOptions) {
super(outputOptions);
}
render(module, dependencyTemplates, chunk) {
const moduleSource = module.source(dependencyTemplates, this.outputOptions, this.requestShortener);
const moduleSourcePostModule = this.applyPluginsWaterfall("module", moduleSource, module, chunk, dependencyTemplates);
const moduleSourcePostRender = this.applyPluginsWaterfall("render", moduleSourcePostModule, module, chunk, dependencyTemplates);
return this.applyPluginsWaterfall("package", moduleSourcePostRender, module, chunk, dependencyTemplates);
}
updateHash(hash) {
hash.update("1");
this.applyPlugins("hash", hash);
}
};

24
web/node_modules/webpack/lib/ModuleWarning.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const WebpackError = require("./WebpackError");
const cleanUp = require("./ErrorHelpers").cleanUp;
class ModuleWarning extends WebpackError {
constructor(module, warning) {
super();
this.name = "ModuleWarning";
this.module = module;
this.message = warning && typeof warning === "object" && warning.message ? warning.message : warning;
this.warning = warning;
this.details = warning && typeof warning === "object" && warning.stack ? cleanUp(warning.stack, this.message) : undefined;
Error.captureStackTrace(this, this.constructor);
}
}
module.exports = ModuleWarning;

View File

@@ -0,0 +1,21 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
module.exports = class MovedToPluginWarningPlugin {
constructor(optionName, pluginName) {
this.optionName = optionName;
this.pluginName = pluginName;
}
apply(compiler) {
const optionName = this.optionName;
const pluginName = this.pluginName;
compiler.plugin("compilation", (compilation) => {
compilation.warnings.push(new Error `webpack options:
DEPRECATED option ${optionName} will be moved to the ${pluginName}.
Use this instead.
For more info about the usage of the ${pluginName} see https://webpack.js.org/plugins/`);
});
}
};

176
web/node_modules/webpack/lib/MultiCompiler.js generated vendored Normal file
View File

@@ -0,0 +1,176 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
var Tapable = require("tapable");
var asyncLib = require("async");
var MultiWatching = require("./MultiWatching");
var MultiStats = require("./MultiStats");
function MultiCompiler(compilers) {
Tapable.call(this);
if(!Array.isArray(compilers)) {
compilers = Object.keys(compilers).map(function(name) {
compilers[name].name = name;
return compilers[name];
});
}
this.compilers = compilers;
function delegateProperty(name) {
Object.defineProperty(this, name, {
configurable: false,
get: function() {
throw new Error("Cannot read " + name + " of a MultiCompiler");
},
set: function(value) {
this.compilers.forEach(function(compiler) {
compiler[name] = value;
});
}.bind(this)
});
}
delegateProperty.call(this, "outputFileSystem");
delegateProperty.call(this, "inputFileSystem");
Object.defineProperty(this, "outputPath", {
configurable: false,
get: function() {
var commonPath = compilers[0].outputPath;
for(var i = 1; i < compilers.length; i++) {
while(compilers[i].outputPath.indexOf(commonPath) !== 0 && /[\/\\]/.test(commonPath)) {
commonPath = commonPath.replace(/[\/\\][^\/\\]*$/, "");
}
}
if(!commonPath && compilers[0].outputPath[0] === "/") return "/";
return commonPath;
}
});
var doneCompilers = 0;
var compilerStats = [];
this.compilers.forEach(function(compiler, idx) {
var compilerDone = false;
compiler.plugin("done", function(stats) {
if(!compilerDone) {
compilerDone = true;
doneCompilers++;
}
compilerStats[idx] = stats;
if(doneCompilers === this.compilers.length) {
this.applyPlugins("done", new MultiStats(compilerStats));
}
}.bind(this));
compiler.plugin("invalid", function() {
if(compilerDone) {
compilerDone = false;
doneCompilers--;
}
this.applyPlugins("invalid");
}.bind(this));
}, this);
}
module.exports = MultiCompiler;
MultiCompiler.prototype = Object.create(Tapable.prototype);
MultiCompiler.prototype.constructor = MultiCompiler;
function runWithDependencies(compilers, fn, callback) {
var fulfilledNames = {};
var remainingCompilers = compilers;
function isDependencyFulfilled(d) {
return fulfilledNames[d];
}
function getReadyCompilers() {
var readyCompilers = [];
var list = remainingCompilers;
remainingCompilers = [];
for(var i = 0; i < list.length; i++) {
var c = list[i];
var ready = !c.dependencies || c.dependencies.every(isDependencyFulfilled);
if(ready)
readyCompilers.push(c);
else
remainingCompilers.push(c);
}
return readyCompilers;
}
function runCompilers(callback) {
if(remainingCompilers.length === 0) return callback();
asyncLib.map(getReadyCompilers(), function(compiler, callback) {
fn(compiler, function(err) {
if(err) return callback(err);
fulfilledNames[compiler.name] = true;
runCompilers(callback);
});
}, callback);
}
runCompilers(callback);
}
MultiCompiler.prototype.watch = function(watchOptions, handler) {
var watchings = [];
var allStats = this.compilers.map(function() {
return null;
});
var compilerStatus = this.compilers.map(function() {
return false;
});
runWithDependencies(this.compilers, function(compiler, callback) {
var compilerIdx = this.compilers.indexOf(compiler);
var firstRun = true;
var watching = compiler.watch(Array.isArray(watchOptions) ? watchOptions[compilerIdx] : watchOptions, function(err, stats) {
if(err)
handler(err);
if(stats) {
allStats[compilerIdx] = stats;
compilerStatus[compilerIdx] = "new";
if(compilerStatus.every(Boolean)) {
var freshStats = allStats.filter(function(s, idx) {
return compilerStatus[idx] === "new";
});
compilerStatus.fill(true);
var multiStats = new MultiStats(freshStats);
handler(null, multiStats);
}
}
if(firstRun && !err) {
firstRun = false;
callback();
}
});
watchings.push(watching);
}.bind(this), function() {
// ignore
});
return new MultiWatching(watchings, this);
};
MultiCompiler.prototype.run = function(callback) {
var allStats = this.compilers.map(function() {
return null;
});
runWithDependencies(this.compilers, function(compiler, callback) {
var compilerIdx = this.compilers.indexOf(compiler);
compiler.run(function(err, stats) {
if(err) return callback(err);
allStats[compilerIdx] = stats;
callback();
});
}.bind(this), function(err) {
if(err) return callback(err);
callback(null, new MultiStats(allStats));
});
};
MultiCompiler.prototype.purgeInputFileSystem = function() {
this.compilers.forEach(function(compiler) {
if(compiler.inputFileSystem && compiler.inputFileSystem.purge)
compiler.inputFileSystem.purge();
});
};

39
web/node_modules/webpack/lib/MultiEntryPlugin.js generated vendored Normal file
View File

@@ -0,0 +1,39 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const MultiEntryDependency = require("./dependencies/MultiEntryDependency");
const SingleEntryDependency = require("./dependencies/SingleEntryDependency");
const MultiModuleFactory = require("./MultiModuleFactory");
module.exports = class MultiEntryPlugin {
constructor(context, entries, name) {
this.context = context;
this.entries = entries;
this.name = name;
}
apply(compiler) {
compiler.plugin("compilation", (compilation, params) => {
const multiModuleFactory = new MultiModuleFactory();
const normalModuleFactory = params.normalModuleFactory;
compilation.dependencyFactories.set(MultiEntryDependency, multiModuleFactory);
compilation.dependencyFactories.set(SingleEntryDependency, normalModuleFactory);
});
compiler.plugin("make", (compilation, callback) => {
const dep = MultiEntryPlugin.createDependency(this.entries, this.name);
compilation.addEntry(this.context, dep, this.name, callback);
});
}
static createDependency(entries, name) {
return new MultiEntryDependency(entries.map((e, idx) => {
const dep = new SingleEntryDependency(e);
dep.loc = name + ":" + (100000 + idx);
return dep;
}), name);
}
};

Some files were not shown because too many files have changed in this diff Show More