Skip to content

Commit fb90bf3

Browse files
committed
docs(recipe): Add comments for precompiling multiple test files
1 parent 0b47071 commit fb90bf3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

docs/recipes/precompiling-with-webpack.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,26 @@ The AVA [readme](https://github.com/avajs/ava#transpiling-imported-modules) ment
77
###### webpack.config.js
88

99
```js
10+
const path = require('path');
11+
// To pre-compile folder with multiple test files, we can use glob
12+
// see http://stackoverflow.com/questions/32874025/how-to-add-wildcard-mapping-in-entry-of-webpack/34545812#34545812
13+
// const glob = require('glob');
14+
1015
const nodeExternals = require('webpack-node-externals');
1116

1217
module.exports = {
1318
entry: ['src/tests.js'],
19+
// entry: glob.sync('./test/**/*.js'),
1420
target: 'node',
1521
output: {
16-
path: '_build',
22+
path: path.resolve(__dirname, '_build'),
1723
filename: 'tests.js'
1824
},
1925
externals: [nodeExternals()],
2026
module: {
2127
rules: [{
22-
test: /\.(js|jsx)$/,
23-
use: 'babel-loader'
28+
test: /\.(js|jsx)$/,
29+
use: 'babel-loader'
2430
}]
2531
}
2632
};

0 commit comments

Comments
 (0)