diff --git a/README.md b/README.md index 8320106..0f83c63 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,13 @@ webpack-dev-server 'mocha!./my-client-tests.js' --options webpackOptions.js ``` text enhanced-require 'mocha!./my-server-tests.js' ``` - -### webpack.config.js +### Config +#### webpack.config.js ```js module.exports = { - entry: 'mocha!./entry-file.js', + entry: './entry-file.js', output: { path: __dirname, filename: 'bundle.js' @@ -27,6 +27,13 @@ module.exports = { } ``` +#### entry-file.js +```js +/*additional setup with other loaders (polyfills, ...)*/ +const context = require.context(/*directory*/'mocha!./tests', /*recursive*/true, /*match files*//_test.js$/); +context.keys().forEach(context); +``` + ## License MIT (http://www.opensource.org/licenses/mit-license.php)