-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
webpack-electron.config.ts
58 lines (54 loc) · 1.38 KB
/
webpack-electron.config.ts
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
import * as path from 'path';
import * as webpack from 'webpack';
const config: webpack.Configuration = {
resolve: {
extensions: ['.tsx', '.ts', '.js'],
mainFields: ['main', 'module'],
},
entry: './src/electron-main.ts',
target: 'electron-main',
devtool: 'source-map',
module: {
rules: [
{
test: /\.(js|ts|tsx)$/,
exclude: /node_modules/,
use: 'ts-loader',
},
],
},
output: {
path: path.resolve(__dirname, 'app'),
filename: 'electron-main.js',
publicPath: './',
libraryTarget: 'commonjs2',
},
plugins: [
new webpack.IgnorePlugin(
new RegExp('^(mssql*|mariasql|.oracle.|mssql/.*|tedious|node-pre-gyp)$')
// new RegExp('^(mssql*|mariasql|.oracle.|sqlite3|mssql/.*|tedious|node-pre-gyp)$')
),
],
externals: {
archiver: 'archiver',
unzip: 'unzip',
// Possible drivers for knex - we'll ignore them
sqlite3: 'sqlite3',
mariasql: 'mariasql',
mssql: 'mssql',
mysql: 'mysql',
oracle: 'oracle',
'strong-oracle': 'strong-oracle',
oracledb: 'oracledb',
pg: 'pg',
'pg-query-stream': 'pg-query-stream',
tedious: 'tedious',
mysql2: 'mysql2',
'mssql/package.json': 'mssql/package.json',
'mssql/lib/base': 'mssql/lib/base',
'aws-sdk': 'aws-sdk',
'node-pre-gyp': 'node-pre-gyp',
// '../package': '../package',
},
};
export default config;