Skip to content

Commit fa8b9a8

Browse files
committed
Merge branch 'patch-1' of https://github.com/nimamehanian/webpack into nimamehanian-patch-1
Conflicts: README.md
2 parents 26512c5 + 2799c4f commit fa8b9a8

1 file changed

Lines changed: 33 additions & 38 deletions

File tree

‎README.md‎

Lines changed: 33 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ files for usage in a browser, yet it is also capable of transforming, bundling,
1111
or packaging just about any resource or asset.
1212

1313

14-
**TL;DR**
14+
**TL; DR**
1515

1616
* Bundles both [CommonJs](http://www.commonjs.org/specs/modules/1.0/) and [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) modules (even combined).
1717
* Can create a single bundle or multiple chunks that are asynchronously loaded at runtime (to reduce initial loading time).
@@ -135,63 +135,61 @@ friendly** by using hashes.
135135

136136
[Optimization documentation](http://webpack.github.io/docs/optimization.html)
137137

138+
webpack optimizes in several ways. It also makes your chunks **cache-friendly** by using hashes.
138139

139140
# A small example of what's possible
140141

141142
``` javascript
142-
// webpack is a module bundler
143+
// webpack is a module bundler.
143144
// This means webpack takes modules with dependencies
144-
// and emits static assets representing those modules.
145+
// and emits static assets representing those modules.
145146

146-
// dependencies can be written in CommonJs
147+
// Dependencies can be written in CommonJs
147148
var commonjs = require("./commonjs");
148149
// or in AMD
149-
define(["amd-module", "../file"], function(amdModule, file) {
150-
// while previous constructs are sync
150+
define(["amd-module", "../file"], function (amdModule, file) {
151+
// while previous constructs are sync,
151152
// this is async
152-
require(["big-module/big/file"], function(big) {
153-
// for async dependencies webpack splits
154-
// your application into multiple "chunks".
153+
require(["big-module/big/file"], function (big) {
154+
// For async dependencies, webpack splits
155+
// your application into multiple "chunks."
155156
// This part of your application is
156-
// loaded on demand (Code Splitting)
157+
// loaded on demand (code-splitting).
157158
var stuff = require("../my/stuff");
158-
// "../my/stuff" is also loaded on demand
159+
// "../my/stuff" is also loaded on-demand
159160
// because it's in the callback function
160-
// of the AMD require
161+
// of the AMD require.
161162
});
162163
});
163164

164165

165166
require("coffee!./cup.coffee");
166-
// "Loaders" can be used to preprocess files.
167+
// "Loaders" are used to preprocess files.
167168
// They can be prefixed in the require call
168-
// or configured in the configuration.
169+
// or configured in the configuration.
169170
require("./cup");
170171
// This does the same when you add ".coffee" to the extensions
171-
// and configure the "coffee" loader for /\.coffee$/
172-
173-
174-
function loadTemplate(name) {
172+
// and configure the "coffee" loader for /\.coffee$/
173+
174+
function loadTemplate (name) {
175175
return require("./templates/" + name + ".jade");
176-
// many expressions are supported in require calls
177-
// a clever parser extracts information and concludes
178-
// that everything in "./templates" that matches
179-
// /\.jade$/ should be included in the bundle, as it
180-
// can be required.
176+
// Many expressions are supported in require calls.
177+
// A clever parser extracts information and concludes
178+
// that everything in "./templates" that matches
179+
// /\.jade$/ should be included in the bundle, as it
180+
// can be required.
181181
}
182-
183-
184-
// ... and you can combine everything
185-
function loadTemplateAsync(name, callback) {
182+
183+
184+
// ...and you can combine everything.
185+
function loadTemplateAsync (name, callback) {
186186
require(["bundle?lazy!./templates/" + name + ".jade"],
187-
function(templateBundle) {
188-
templateBundle(callback);
187+
function (templateBundle) {
188+
templateBundle(callback);
189189
});
190190
}
191191
```
192192

193-
194-
195193
## Documentation
196194

197195
[documentation](http://webpack.github.io/docs/?utm_source=github&utm_medium=readme&utm_campaign=documentation)
@@ -204,7 +202,7 @@ function loadTemplateAsync(name, callback) {
204202

205203
## Tests
206204

207-
You can run the node tests with `npm test`. [![build status (linux)](https://secure.travis-ci.org/webpack/webpack.png)](http://travis-ci.org/webpack/webpack) [![Build status (windows)](https://ci.appveyor.com/api/projects/status/vatlasj366jiyuh6/branch/master)](https://ci.appveyor.com/project/sokra/webpack/branch/master)
205+
You can run the Node tests with `npm test`. [![build status (linux)](https://secure.travis-ci.org/webpack/webpack.png)](http://travis-ci.org/webpack/webpack) [![Build status (windows)](https://ci.appveyor.com/api/projects/status/vatlasj366jiyuh6/branch/master)](https://ci.appveyor.com/project/sokra/webpack/branch/master)
208206

209207
You can run the browser tests:
210208

@@ -213,8 +211,7 @@ cd test/browsertests
213211
node build
214212
```
215213

216-
and open `tests.html` in browser.
217-
214+
and open `tests.html` in the browser.
218215

219216
## Contribution
220217

@@ -233,19 +230,17 @@ You are also welcome to correct any spelling mistakes or any language issues.
233230

234231
If you want to discuss something or just need help, [here is our gitter.im room](https://gitter.im/webpack/webpack).
235232

236-
237233
## License
238234

239235
Copyright (c) 2012-2015 Tobias Koppers
240236

241237
MIT (http://www.opensource.org/licenses/mit-license.php)
242238

243-
244239
## Sponsor
245240

246-
This is a freetime project. My time investment fluctuates randomly. If you use webpack for a serious task you may want me to invest more time. Or if you make some good revenue you can give some money back. Keep in mind that this project may increase your income. It makes development and applications faster and reduces the required bandwidth.
241+
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.
247242

248-
I'm very thankful for every dollar. If you leave your username or email I may show my thanks by giving you extra support.
243+
I'm very thankful for every dollar. If you leave your username or email, I may show my thanks by giving you extra support.
249244

250245
[![Donate to sokra](http://img.shields.io/donate/sokra.png)](http://sokra.github.io/)
251246

0 commit comments

Comments
 (0)