Skip to content
This repository has been archived by the owner on Jan 6, 2018. It is now read-only.

Commit

Permalink
Merge pull request #6 from gpbl/readme-webpack
Browse files Browse the repository at this point in the history
Suggest to use NormalModuleReplacementPlugin
  • Loading branch information
Vijar committed Feb 20, 2015
2 parents 3492700 + 77f9312 commit 5020e42
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,20 @@ var webpackConfig = {
};
```

### Remove stripped functions from bundle
### Replace unused module

So far we've removed the calls to the debug function, but webpack will still include the `debug` module in the final bundle. Use the [`IgnorePlugin`](http://webpack.github.io/docs/list-of-plugins.html#ignoreplugin)
So far we've removed the calls to the debug function, but your app still requires the `debug` module in the final bundle. Use the [`NormalModuleReplacementPlugin`](http://webpack.github.io/docs/list-of-plugins.html#normalmodulereplacementplugin) to replace it with an empty function:

```javascript
// webpack config
{
plugins: [
new webpack.IgnorePlugin(/debug/)
new webpack.NormalModuleReplacementPlugin(/debug/, process.cwd() + '/emptyDebug.js'),
]
}

// emptyDebug.js
module.exports = function() { return new Function(); };
```


Expand Down

0 comments on commit 5020e42

Please sign in to comment.