diff --git a/README.md b/README.md index c2bd204..f19831b 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,7 @@ npm install joi Add the following to your app's webpack.config.js to alias joi to joi-browser +for Webpack 1: ```javascript resolve: { alias: { @@ -90,6 +91,14 @@ Add the following to your app's webpack.config.js to alias joi to joi-browser } ``` +for webpack 2+: +```javascript + resolve: { + alias: { + joi: require.resolve('joi-browser') + } +``` + Note: if you are using webpack with a babel loader you may need to exclude `joi-browser` (or node_modules) from being run through babel again. In your webpack.config.js loaders, add an `exclude: [ /joi-browser/ ]`.