-
-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathwebpack-renderer.config.ts
85 lines (81 loc) · 2.05 KB
/
webpack-renderer.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
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
import * as path from 'path';
import * as webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import MonacoWebpackPlugin from 'monaco-editor-webpack-plugin';
const config: webpack.Configuration = {
resolve: {
extensions: ['.tsx', '.ts', '.js'],
mainFields: ['main', 'module', 'browser'],
},
entry: './src/index.tsx',
target: 'electron-renderer',
devtool: 'source-map',
module: {
rules: [
{
test: /\.(js|ts|tsx)$/,
exclude: /node_modules/,
use: 'ts-loader',
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
{
test: /\.(png|svg|jpg|gif)$/,
use: ['file-loader'],
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
use: ['file-loader'],
},
],
},
devServer: {
contentBase: path.join(__dirname, 'app'),
historyApiFallback: true,
compress: true,
hot: true,
port: 4000,
publicPath: '/',
},
output: {
path: path.resolve(__dirname, 'app'),
filename: 'js/[name].js',
publicPath: './',
libraryTarget: 'commonjs2',
},
plugins: [
new HtmlWebpackPlugin({
filename: './index.html',
template: './index.html',
}),
new MonacoWebpackPlugin(),
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;