forked from mattermost/desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.test.js
57 lines (50 loc) · 1.41 KB
/
webpack.config.test.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
52
53
54
55
56
57
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
// This file uses CommonJS.
/* eslint-disable import/no-commonjs */
'use strict';
const path = require('path');
const merge = require('webpack-merge');
const base = require('./webpack.config.base');
const WEBSERVER_PORT = 9001;
module.exports = merge(base, {
entry: {
test: './test/unit/index.js',
e2e: './test/specs/index.js',
},
output: {
path: path.resolve(__dirname, 'dist/tests'),
filename: '[name]_bundle.js',
},
module: {
rules: [{
test: /\.(js|jsx|ts|tsx)?$/,
use: ['babel-loader', 'shebang-loader'],
}],
},
externals: {
puppeteer: 'require("puppeteer")',
fs: 'require("fs")',
ws: 'require("ws")',
child_process: 'require("child_process")',
dns: 'require("dns")',
http2: 'require("http2")',
net: 'require("net")',
repl: 'require("repl")',
tls: 'require("tls")',
spectron: 'require("spectron")',
},
node: {
__filename: false,
__dirname: false,
},
devServer: {
contentBase: 'src/assets',
contentBasePublicPath: '/assets',
inline: true,
publicPath: '/renderer/',
port: WEBSERVER_PORT,
},
target: 'electron-main',
});
/* eslint-enable import/no-commonjs */