webpack 2.1.0-beta.24 → 2.1.0-beta.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,27 +1,27 @@
1
- /*
2
- MIT License http://www.opensource.org/licenses/mit-license.php
3
- Author Tobias Koppers @sokra
4
- */
5
- var Compiler = require("./Compiler");
6
- var WebEnvironmentPlugin = require("./web/WebEnvironmentPlugin");
7
- var WebpackOptionsApply = require("./WebpackOptionsApply");
8
- var WebpackOptionsDefaulter = require("./WebpackOptionsDefaulter");
9
-
10
- function webpack(options, callback) {
11
- new WebpackOptionsDefaulter().process(options);
12
-
13
- var compiler = new Compiler();
14
- compiler.options = options;
15
- compiler.options = new WebpackOptionsApply().process(options, compiler);
16
- new WebEnvironmentPlugin(options.inputFileSystem, options.outputFileSystem).apply(compiler);
17
- if(callback) {
18
- compiler.run(callback);
19
- }
20
- return compiler;
21
- }
22
- module.exports = webpack;
23
-
24
- webpack.WebpackOptionsDefaulter = WebpackOptionsDefaulter;
25
- webpack.WebpackOptionsApply = WebpackOptionsApply;
26
- webpack.Compiler = Compiler;
27
- webpack.WebEnvironmentPlugin = WebEnvironmentPlugin;
1
+ /*
2
+ MIT License http://www.opensource.org/licenses/mit-license.php
3
+ Author Tobias Koppers @sokra
4
+ */
5
+ var Compiler = require("./Compiler");
6
+ var WebEnvironmentPlugin = require("./web/WebEnvironmentPlugin");
7
+ var WebpackOptionsApply = require("./WebpackOptionsApply");
8
+ var WebpackOptionsDefaulter = require("./WebpackOptionsDefaulter");
9
+
10
+ function webpack(options, callback) {
11
+ new WebpackOptionsDefaulter().process(options);
12
+
13
+ var compiler = new Compiler();
14
+ compiler.options = options;
15
+ compiler.options = new WebpackOptionsApply().process(options, compiler);
16
+ new WebEnvironmentPlugin(options.inputFileSystem, options.outputFileSystem).apply(compiler);
17
+ if(callback) {
18
+ compiler.run(callback);
19
+ }
20
+ return compiler;
21
+ }
22
+ module.exports = webpack;
23
+
24
+ webpack.WebpackOptionsDefaulter = WebpackOptionsDefaulter;
25
+ webpack.WebpackOptionsApply = WebpackOptionsApply;
26
+ webpack.Compiler = Compiler;
27
+ webpack.WebEnvironmentPlugin = WebEnvironmentPlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack",
3
- "version": "2.1.0-beta.24",
3
+ "version": "2.1.0-beta.25",
4
4
  "author": "Tobias Koppers @sokra",
5
5
  "description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
6
6
  "dependencies": {
@@ -665,7 +665,8 @@
665
665
  "enum": [
666
666
  false,
667
667
  true,
668
- "mock"
668
+ "mock",
669
+ "empty"
669
670
  ]
670
671
  },
671
672
  "properties": {
package/README.md DELETED
@@ -1,315 +0,0 @@
1
- [![webpack](https://webpack.github.io/assets/logo.png)](https://webpack.github.io)
2
-
3
-
4
- [![NPM version][npm-image]][npm-url] [![Gitter chat][gitter-image]][gitter-url] [![Downloads][downloads-image]][downloads-url]
5
-
6
- [![NPM][nodei-image]][nodei-url]
7
-
8
- build
9
- [![Build Status][travis-image]][travis-url] [![Appveyor Status][appveyor-image]][appveyor-url] [![Coverage Status][coveralls-image]][coveralls-url]
10
-
11
- dependencies
12
- [![Dependency Status][david-image]][david-url] [![devDependency Status][david-dev-image]][david-dev-url] [![peerDependency Status][david-peer-image]][david-peer-url]
13
-
14
- donation
15
- [![gratipay donate button][gratipay-image]][gratipay-url] [![Donate to sokra][donate-image]][donate-url]
16
-
17
- [![BADGINATOR][badginator-image]][badginator-url]
18
-
19
- [documentation](https://webpack.github.io/docs/?utm_source=github&utm_medium=readme&utm_campaign=top)
20
-
21
- # Introduction
22
-
23
- webpack is a bundler for modules. The main purpose is to bundle JavaScript
24
- files for usage in a browser, yet it is also capable of transforming, bundling,
25
- or packaging just about any resource or asset.
26
-
27
-
28
- **TL; DR**
29
-
30
- * Bundles both [CommonJS](http://wiki.commonjs.org/) and [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules (even combined).
31
- * Can create a single bundle or multiple chunks that are asynchronously loaded at runtime (to reduce initial loading time).
32
- * Dependencies are resolved during compilation reducing the runtime size.
33
- * Loaders can preprocess files while compiling, e.g. coffeescript to JavaScript, handlebars strings to compiled functions, images to Base64, etc.
34
- * Highly modular plugin system to do whatever else your application requires.
35
-
36
- # Getting Started
37
-
38
- Check out webpack's [documentation](https://webpack.github.io/docs/?utm_source=github&utm_medium=readme&utm_campaign=trdr) for quick Getting Started guide, in-depth usage,
39
- tutorials and resources.
40
-
41
- # Installation
42
-
43
- project:
44
- `npm install webpack --save-dev`
45
-
46
- global:
47
- `npm install webpack -g`
48
-
49
- Usage:
50
- https://webpack.github.io/docs/tutorials/getting-started/
51
-
52
- # Examples
53
-
54
- Take a look at the [`examples`](https://github.com/webpack/webpack/tree/master/examples) folder.
55
-
56
- # Features
57
-
58
- ## Plugins
59
-
60
- webpack has a [rich plugin
61
- interface](https://webpack.github.io/docs/plugins.html). Most of the features
62
- within webpack itself use this plugin interface. This makes webpack very
63
- **flexible**.
64
-
65
-
66
- ## Performance
67
-
68
- webpack uses async I/O and has multiple caching levels. This makes webpack fast
69
- and incredibly **fast** on incremental compilations.
70
-
71
- ## Loaders
72
-
73
- webpack enables use of loaders to preprocess files. This allows you to bundle
74
- **any static resource** way beyond JavaScript. You can easily [write your own
75
- loaders](https://webpack.github.io/docs/loaders.html) using node.js.
76
-
77
- Loaders are activated by using `loadername!` prefixes in `require()` statements,
78
- or are automatically applied via regex from your webpack configuration.
79
-
80
- Please see [Using Loaders](https://webpack.github.io/docs/using-loaders.html) for more information.
81
-
82
- **basic**
83
- * [`json`](https://github.com/webpack/json-loader): Loads file as JSON
84
- * [`raw`](https://github.com/webpack/raw-loader): Loads raw content of a file (as utf-8)
85
- * [`val`](https://github.com/webpack/val-loader): Executes code as module and consider exports as JavaScript code
86
- * [`script`](https://github.com/webpack/script-loader): Executes a JavaScript file once in global context (like in script tag), requires are not parsed.
87
-
88
- **packaging**
89
- * [`file`](https://github.com/webpack/file-loader): Emits the file into the output folder and returns the (relative) url.
90
- * [`url`](https://github.com/webpack/url-loader): The url loader works like the file loader, but can return a Data Url if the file is smaller than a limit.
91
- * [`image`](https://github.com/tcoopman/image-webpack-loader): Compresses your images. Ideal to use together with `file` or `url`.
92
- * [`svgo-loader`](https://github.com/rpominov/svgo-loader): Compresses SVG images using [svgo](https://github.com/svg/svgo) library
93
- * [`baggage`](https://github.com/deepsweet/baggage-loader): Automatically require any resources related to the required one
94
- * [`polymer-loader`](https://github.com/JonDum/polymer-loader): Process HTML & CSS with preprocessor of choice and `require()` Web Components like first-class modules.
95
-
96
- **dialects**
97
- * [`coffee`](https://github.com/webpack/coffee-loader): Loads coffee-script like JavaScript
98
- * [`babel`](https://github.com/babel/babel-loader): Turn ES6 code into vanilla ES5 using [Babel](https://github.com/babel/babel).
99
- * [`livescript`](https://github.com/appedemic/livescript-loader): Loads LiveScript like JavaScript
100
- * [`sweetjs`](https://github.com/jlongster/sweetjs-loader): Use sweetjs macros.
101
- * [`traceur`](https://github.com/jupl/traceur-loader): Use future JavaScript features with [Traceur](https://github.com/google/traceur-compiler).
102
- * [`typescript`](https://github.com/andreypopp/typescript-loader): Loads TypeScript like JavaScript.
103
-
104
- **templating**
105
- * [`html`](https://github.com/webpack/html-loader): Exports HTML as string, require references to static resources.
106
- * [`jade`](https://github.com/webpack/jade-loader): Loads jade template and returns a function
107
- * [`handlebars`](https://github.com/altano/handlebars-loader): Loads handlebars template and returns a function
108
- * [`ractive`](https://github.com/rstacruz/ractive-loader): Pre-compiles Ractive templates for interactive DOM manipulation
109
- * [`markdown`](https://github.com/peerigon/markdown-loader): Compiles Markdown to HTML
110
- * [`ng-cache`](https://github.com/teux/ng-cache-loader): Puts HTML partials in the Angular's $templateCache
111
-
112
- **styling**
113
- * [`style`](https://github.com/webpack/style-loader): Add exports of a module as style to DOM
114
- * [`css`](https://github.com/webpack/css-loader): Loads css file with resolved imports and returns css code
115
- * [`postcss`](https://github.com/postcss/postcss-loader): Loads and compiles css using various [plugins](https://github.com/postcss/postcss#plugins)
116
- * [`less`](https://github.com/webpack/less-loader): Loads and compiles a less file
117
- * [`sass`](https://github.com/jtangelder/sass-loader): Loads and compiles a scss file
118
- * [`stylus`](https://github.com/shama/stylus-loader): Loads and compiles a stylus file
119
-
120
- **misc**
121
- * [`po`](https://github.com/perchlayer/po-loader): Loads a PO gettext file and returns JSON
122
- * [`mocha`](https://github.com/webpack/mocha-loader): Do tests with mocha in browser or node.js
123
- * [`eslint`](https://github.com/MoOx/eslint-loader): PreLoader for linting code using ESLint.
124
- * [`jshint`](https://github.com/webpack/jshint-loader): PreLoader for linting code.
125
- * [`jscs`](https://github.com/unindented/jscs-loader): PreLoader for style checking.
126
- * [`injectable`](https://github.com/jauco/webpack-injectable): Allow to inject dependencies into modules
127
- * [`transform`](https://github.com/webpack/transform-loader): Use browserify transforms as loader.
128
-
129
- For the full list of loaders, see [list of loaders](https://webpack.github.io/docs/list-of-loaders.html).
130
-
131
- ## Module Format (AMD/CommonJS)
132
-
133
- webpack supports **both** AMD and CommonJS module styles. It performs clever static
134
- analysis on the AST of your code. It even has an evaluation engine to evaluate
135
- simple expressions. This allows you to **support most existing libraries** out of the box.
136
-
137
- ## Code Splitting
138
-
139
- webpack allows you to split your codebase into multiple chunks. Chunks are
140
- loaded asynchronously at runtime. This reduces the initial loading time.
141
-
142
- [Code Splitting documentation](https://webpack.github.io/docs/code-splitting.html)
143
-
144
- ## Optimizations
145
-
146
- webpack can do many optimizations to **reduce the output size of your
147
- JavaScript** by deduplicating frequently used modules, minifying, and giving
148
- you full control of what is loaded initially and what is loaded at runtime
149
- through code splitting. It can also make your code chunks **cache
150
- friendly** by using hashes.
151
-
152
- [Optimization documentation](https://webpack.github.io/docs/optimization.html)
153
-
154
- # A small example of what's possible
155
-
156
- ``` javascript
157
- // webpack is a module bundler.
158
- // This means webpack takes modules with dependencies
159
- // and emits static assets representing those modules.
160
-
161
- // Dependencies can be written in CommonJS
162
- var commonjs = require("./commonjs");
163
- // or in AMD
164
- define(["amd-module", "../file"], function (amdModule, file) {
165
- // while previous constructs are sync,
166
- // this is async
167
- require(["big-module/big/file"], function (big) {
168
- // For async dependencies, webpack splits
169
- // your application into multiple "chunks".
170
- // This part of your application is
171
- // loaded on demand (code-splitting).
172
- var stuff = require("../my/stuff");
173
- // "../my/stuff" is also loaded on-demand
174
- // because it's in the callback function
175
- // of the AMD require.
176
- });
177
- });
178
-
179
-
180
- require("coffee!./cup.coffee");
181
- // "Loaders" are used to preprocess files.
182
- // They can be prefixed in the require call
183
- // or configured in the configuration.
184
- require("./cup");
185
- // This does the same when you add ".coffee" to the extensions
186
- // and configure the "coffee" loader for /\.coffee$/
187
-
188
- function loadTemplate (name) {
189
- return require("./templates/" + name + ".jade");
190
- // Many expressions are supported in require calls.
191
- // A clever parser extracts information and concludes
192
- // that everything in "./templates" that matches
193
- // /\.jade$/ should be included in the bundle, as it
194
- // can be required.
195
- }
196
-
197
-
198
- // ...and you can combine everything.
199
- function loadTemplateAsync (name, callback) {
200
- require(["bundle?lazy!./templates/" + name + ".jade"],
201
- function (templateBundle) {
202
- templateBundle(callback);
203
- });
204
- }
205
- ```
206
-
207
- ## Documentation
208
-
209
- [documentation](https://webpack.github.io/docs/?utm_source=github&utm_medium=readme&utm_campaign=documentation)
210
-
211
-
212
- ## Changelog
213
-
214
- [changelog](https://webpack.github.io/docs/changelog.html)
215
-
216
-
217
- ## Tests
218
-
219
- You can run the Node tests with `npm test`.
220
-
221
- You can run the browser tests:
222
-
223
- ```
224
- cd test/browsertests
225
- node build
226
- ```
227
-
228
- and open `tests.html` in the browser.
229
-
230
- ## Contribution
231
-
232
- Most of the time, if webpack is not working correctly for you it is a simple configuration issue.
233
-
234
- If you are still having difficulty after looking over your configuration carefully, please post
235
- a question to [StackOverflow with the webpack tag](http://stackoverflow.com/tags/webpack). Questions
236
- that include your webpack.config.js and relevant files are more likely to receive responses.
237
-
238
- If you have discovered a bug or have a feature suggestion, feel free to create an issue on Github.
239
-
240
- If you create a loader or plugin, please consider open sourcing it, putting it
241
- on NPM and following the `x-loader`, `x-plugin` convention.
242
-
243
- You are also welcome to correct any spelling mistakes or any language issues.
244
-
245
- If you want to discuss something or just need help, [here is our gitter.im room](https://gitter.im/webpack/webpack).
246
-
247
- ## License
248
-
249
- Copyright (c) 2012-2016 Tobias Koppers
250
-
251
- MIT (http://opensource.org/licenses/mit-license.php)
252
-
253
- ## Thanks to
254
-
255
- (In chronological order)
256
-
257
- * @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.
258
- * @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-webpack. Interestingly the [Code Splitting issue is still open](https://github.com/medikoo/modules-webmake/issues/7) (thanks also to @Phoscur for the discussion).
259
- * @substack for [browserify](http://browserify.org/), which is a similar project and source for many ideas.
260
- * @jrburke for [require.js](http://requirejs.org/), which is a similar project and source for many ideas.
261
- * @defunctzombie for the [browser-field spec](https://gist.github.com/defunctzombie/4339901), which makes modules available for node.js, browserify and webpack.
262
- * Every early webpack user, which contributed to webpack by writing issues or PRs. You influenced the direction...
263
- * @shama, @jhnns and @sokra for maintaining this project
264
- * Everyone who has written a loader for webpack. You are the ecosystem...
265
- * Everyone I forgot to mention here, but also influenced webpack.
266
-
267
-
268
- ## Sponsor
269
-
270
- This is a free-time project. The time I invest in it fluctuates. If you use webpack for a serious task, and you'd like me 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.
271
-
272
- Another way you can help fund Webpack is by buying the ebook ["SurviveJS - Webpack"](https://leanpub.com/survivejs-webpack), where around ~30% of the book's profit will go to me.
273
-
274
- I'm very thankful for every dollar. If you leave your username or email, I may show my thanks by giving you extra support.
275
-
276
-
277
- ## Dependencies
278
-
279
- * [esprima](http://esprima.org/)
280
- * [enhanced-resolve](https://github.com/webpack/enhanced-resolve)
281
- * [uglify-js](https://github.com/mishoo/UglifyJS)
282
- * [mocha](https://github.com/mochajs/mocha)
283
- * [should](https://github.com/tj/should.js)
284
- * [optimist](https://github.com/substack/node-optimist)
285
- * [async](https://github.com/caolan/async)
286
- * [mkdirp](https://github.com/substack/node-mkdirp)
287
- * [clone](https://github.com/pvorb/node-clone)
288
-
289
-
290
- [travis-url]: https://travis-ci.org/webpack/webpack
291
- [travis-image]: https://img.shields.io/travis/webpack/webpack/master.svg
292
- [appveyor-url]: https://ci.appveyor.com/project/sokra/webpack/branch/master
293
- [appveyor-image]: https://ci.appveyor.com/api/projects/status/github/webpack/webpack?svg=true
294
- [coveralls-url]: https://coveralls.io/r/webpack/webpack/
295
- [coveralls-image]: https://img.shields.io/coveralls/webpack/webpack.svg
296
- [npm-url]: https://www.npmjs.com/package/webpack
297
- [npm-image]: https://img.shields.io/npm/v/webpack.svg
298
- [downloads-image]: https://img.shields.io/npm/dm/webpack.svg
299
- [downloads-url]: http://badge.fury.io/js/webpack
300
- [david-url]: https://david-dm.org/webpack/webpack
301
- [david-image]: https://img.shields.io/david/webpack/webpack.svg
302
- [david-dev-url]: https://david-dm.org/webpack/webpack#info=devDependencies
303
- [david-dev-image]: https://david-dm.org/webpack/webpack/dev-status.svg
304
- [david-peer-url]: https://david-dm.org/webpack/webpack#info=peerDependencies
305
- [david-peer-image]: https://david-dm.org/webpack/webpack/peer-status.svg
306
- [nodei-image]: https://nodei.co/npm/webpack.png?downloads=true&downloadRank=true&stars=true
307
- [nodei-url]: https://www.npmjs.com/package/webpack
308
- [donate-url]: http://sokra.github.io/
309
- [donate-image]: https://img.shields.io/badge/donate-sokra-brightgreen.svg
310
- [gratipay-url]: https://gratipay.com/webpack/
311
- [gratipay-image]: https://img.shields.io/gratipay/webpack.svg
312
- [gitter-url]: https://gitter.im/webpack/webpack
313
- [gitter-image]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg
314
- [badginator-image]: https://badginator.herokuapp.com/webpack/webpack.svg
315
- [badginator-url]: https://github.com/defunctzombie/badginator