-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.renderer.config.js
94 lines (93 loc) · 2.94 KB
/
webpack.renderer.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const path = require('path');
module.exports = {
target: 'electron-renderer',
module: {
rules: [
{
test: /\.(ts|tsx)$/,
exclude: /node_modules/,
use: [
{
loader: require.resolve('ts-loader'),
options: {
// disable type checker - we will use it in fork plugin
transpileOnly: false,
configFile: path.resolve(__dirname, 'tsconfig.json')
},
},
],
},
{
test: /\.(css|less)$/,
exclude: /\.m\.(css|less)$/,
use: [
{
loader: require.resolve('style-loader'),
},
{
loader: require.resolve('css-loader'),
options: {
importLoaders: 1,
},
},
{
loader: require.resolve('less-loader'),
options: {
javascriptEnabled: true
}
}
],
},
{
test: /\.m\.(css|less)$/,
use: [
{
loader: require.resolve('style-loader'),
},
{
loader: require.resolve('css-loader'),
options: {
importLoaders: 1,
modules: true,
},
},
{
loader: require.resolve('less-loader'),
options: {
javascriptEnabled: true
}
}
],
},
{
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
loader: require.resolve('url-loader'),
options: {
limit: 100000000000000,
},
},
]
},
plugins: [
new TsconfigPathsPlugin({configFile: path.resolve(__dirname, 'tsconfig.json')}),
],
externals: {
'@nestjs/common': 'commonjs2 @nestjs/common',
'socksv5': 'commonjs2 socksv5',
'ssh2': 'commonjs2 ssh2',
'@nestcloud/common': 'commonjs2 @nestcloud/common',
'@nestcloud/logger': 'commonjs2 @nestcloud/logger',
'@nestcloud/boot': 'commonjs2 @nestcloud/boot',
},
resolve: {
modules: ['node_modules'],
extensions: [
'.tsx',
'.ts',
'.js',
'.json',
'.jsx',
],
}
};