forked from ngageoint/opensphere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack-test.config.js
40 lines (37 loc) · 1.05 KB
/
webpack-test.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const ClosurePlugin = require('@ngageoint/closure-webpack-plugin');
const path = require('path');
const buildDir = path.resolve(__dirname, '.build');
module.exports = (env, argv) => {
const depsFile = path.join(buildDir, 'deps-test.js');
return {
entry: [
path.join(buildDir, 'index-test.js')
],
output: {
path: buildDir,
filename: 'test.bundle.js'
},
// inline-source-map is required so coverage instrumentation does not appear when debugging
devtool: 'inline-source-map',
mode: 'development',
module: {
rules: [
// instrument sources with coverage code
{
use: {loader: '@ngageoint/opensphere-coverage-loader'},
include: path.resolve('src'),
test: /\.js$/
}
]
},
plugins: [
new ClosurePlugin.LibraryPlugin({
closureLibraryBase: require.resolve('google-closure-library/closure/goog/base'),
deps: [
require.resolve('google-closure-library/closure/goog/deps'),
depsFile
]
})
]
};
};