forked from stream-labs/desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
strict-null-check.config.js
67 lines (61 loc) · 1.56 KB
/
strict-null-check.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
const merge = require('webpack-merge');
const baseConfig = require('./base.config.js');
const path = require('path');
const fs = require('fs');
// read all files eligible for the strictNulls checking
const filesPath = 'strict-null-check-files';
const files = fs.readdirSync(filesPath);
const tsFiles = [];
const tsxFiles = [];
files.forEach(file => {
const json = JSON.parse(fs.readFileSync(`${filesPath}/${file}`));
if (json.ts) tsFiles.push(...json.ts);
if (json.tsx) tsxFiles.push(...json.tsx);
});
module.exports = merge.smart(baseConfig, {
entry: {
renderer: './app/app.ts',
updater: './updater/ui.js',
'guest-api': './guest-api'
},
mode: 'development',
watchOptions: { ignored: /node_modules/ },
optimization: {
usedExports: true,
},
module: {
rules: [
{
test: /\.ts$/,
loader: 'awesome-typescript-loader',
options: {
useCache: true,
reportFiles: [
...tsFiles
],
strictNullChecks: true
},
exclude: /node_modules|vue\/src/
},
{
test: /\.tsx$/,
include: path.resolve(__dirname, 'app/components'),
loader: [
'babel-loader',
{
loader: 'awesome-typescript-loader',
options: {
forceIsolatedModules: true,
reportFiles: [
...tsxFiles
],
configFileName: 'tsxconfig.json',
instance: 'tsx-loader'
}
}
],
exclude: /node_modules/,
},
],
}
});