forked from loomnetwork/loom-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.unit.tests.config.js
51 lines (49 loc) · 1.02 KB
/
webpack.unit.tests.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
41
42
43
44
45
46
47
48
49
50
51
// This config is used to run tests in the browser.
const path = require('path');
const WebpackTapeRun = require('webpack-tape-run');
module.exports = {
mode: 'production',
target: "web",
entry: './dist/tests/unit_tests.js',
output: {
path: path.resolve(__dirname, './dist'),
filename: 'browser_unit_tests.js',
libraryTarget: 'umd',
globalObject: 'this',
// libraryExport: 'default',
// library: 'loom_unit_tests'
},
node: {
fs: 'empty',
crypto: true,
util: true,
stream: true,
path: 'empty',
},
externals: {
shelljs: 'commonjs shelljs',
},
module: {
rules: [
{
test: /\.(js)$/,
exclude: /(node_modules)/,
loader: 'babel-loader',
options:
{
presets: [
['@babel/preset-env', { loose: true, modules: false }],
],
sourceType: 'unambiguous'
}
}
]
},
plugins: [
],
// silence irrelevant messages
performance: {
hints: false
},
stats: 'errors-only'
};