Dependency injection for webpack bundles.
This is a plugin that enables rewire for client-side bundles generated by webpack 0.9.x and above.
npm install rewire-webpack
and then add the RewirePlugin to the webpack config:
var RewirePlugin = require("rewire-webpack");
var webpackConfig = {
plugins: [
new RewirePlugin()
]
};
After that you can use rewire()
in your client-side bundles as usual. Checkout test/README.md
and test/webpack.config.js
for a real-world example with the webpack-dev-server.
Thanks to sokra who wrote most of the code. :)
MIT