-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
executable file
·83 lines (79 loc) · 2.28 KB
/
webpack.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
const path = require('path');
const {IgnorePlugin} = require('webpack');
const TSConfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const context = path.resolve(__dirname, 'src');
module.exports = {
context,
mode: "development",
entry: getEntryPoints(),
output: {
filename: '[name].js',
path: path.resolve(__dirname , 'dist')
},
resolve: {
extensions: ['.ts', '.js', '.node', '.json'],
modules: ['node_modules', path.resolve(__dirname, 'src')],
plugins: [
new TSConfigPathsPlugin({
configFile: "./tsconfig.json",
logLevel: "debug",
extensions: [".ts", ".tsx"]
}),
]
},
externals: ['node_modules'],
module: {
rules: [
{
test: /\.ts$/,
enforce: 'pre',
exclude: /(node_modules|bower_components|\.spec\.js)/,
use: [
{
loader: 'webpack-strip-block'
}
]
},
{
test: /\.ts$/,
loader: 'ts-loader',
options: {
configFile: path.resolve(__dirname, 'tsconfig.json')
},
exclude: [/node_modules/, path.resolve('dist')]
},
{
test: /\.node$/,
loader: 'node-loader'
},
{
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto'
},
],
},
target: 'node',
devtool: "source-map",
plugins: [
//new CleanWebpackPlugin(path.resolve(__dirname, 'dist')),
/**
* [project dependent]
* Fixes for this one:
* ERROR in ../node_modules/redis-parser/lib/hiredis.js
* Module not found: Error: Can't resolve 'hiredis' in '/path/to/project/node_modules/redis-parser/lib'
* @see https://github.com/NodeRedis/node_redis/issues/790#issuecomment-501869990
*/
new IgnorePlugin(/^hiredis$/),
],
stats: {
colors: true,
warnings: false
}
};
function getEntryPoints() {
let result = {
app: './index.ts',
};
return result;
}