Skip to content

Commit

Permalink
Documentation and remove unused imported stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
romainberger committed Apr 26, 2016
1 parent 8e8026e commit af4d75e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ This will produce a `bundle.js` and a bundle for each value given to the plugin
var translations = require(`./i18n/en.i18n`)
```

With the configuration above, this will produce three bundles: `bundle-en.js` with `translations` being the content of `./i18n/en.i18n`, `bundle-fr.js` with the content of `./i18n/fr.i18n` and `bundle-es.js` with the content of `./i18n/es.i18n`.
With the configuration above, this will produce three bundles: `en.bundle.js` with `translations` being the content of `./i18n/en.i18n`, `fr.bundle.js` with the content of `./i18n/fr.i18n` and `es.bundle.js` with the content of `./i18n/es.i18n`.

### Code splitting

Using `require.ensure()`? No problem. If the module you require needs also require some `.i18n` files (following the example above), the plugin will also create multiple versions for all given values. And all bundles will load the appropriate chunks: for example, the bundle `fr.bundle.js` will load the chunk `fr.1.bundle.js`.

## Options

Expand Down Expand Up @@ -139,11 +143,3 @@ plugins: [
* `OccurenceOrderPlugin`
* `UglifyJsPlugin`
* `extract-text-webpack-plugin`

## Todo

* make it work with multiple entries / code splitting

Bonus:

* make it work with sourcemap
2 changes: 1 addition & 1 deletion src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import mkdirp from 'mkdirp'
import clone from 'lodash.clone'
import merge from 'lodash.merge'
import {ConcatSource} from 'webpack-sources'
import {forEachOfLimit, mapLimit, setImmediate as asyncSetImmediate} from 'async'
import {forEachOfLimit, setImmediate as asyncSetImmediate} from 'async'

const baseAssets = {
filename: 'assets.json',
Expand Down

0 comments on commit af4d75e

Please sign in to comment.