forked from cweijan/vscode-database-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.lib.js
46 lines (44 loc) · 1.41 KB
/
webpack.config.lib.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
const path = require('path');
var webpack = require('webpack');
// 1. npm i tedious mysql2 node-xlsx tunnelSsh g2
// 2. npm run lib
module.exports = [
{
target: "node",
node: {
fs: 'empty', net: 'empty', tls: 'empty',
child_process: 'empty', dns: 'empty',
global: true, __dirname: true
},
entry: {
tedious: './node_modules/tedious/lib/tedious.js',
mysql2: './node_modules/mysql2/index.js',
'node-xlsx': './node_modules/node-xlsx/lib/index.js',
'tunnel-ssh': './node_modules/tunnel-ssh/index.js',
'g2': './node_modules/@antv/g2/lib/index.js',
} ,
output: {
path: path.resolve(__dirname, 'src/bin'),
filename: '[name].js',
libraryTarget: 'commonjs2'
},
externals: {
vscode: 'commonjs vscode'
},
resolve: {
extensions: ['.ts', '.js'],
alias: {
'@': path.resolve(__dirname, './src'),
'~': path.resolve(__dirname, './src')
}
},
plugins: [
new webpack.IgnorePlugin(/^(pg-native|supports-color)$/)
],
module: { rules: [{ test: /\.ts$/, exclude: /node_modules/, use: ['ts-loader'] }] },
optimization: { minimize: true },
watch: false,
mode: 'production',
devtool: false,
}
];