-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathwebpack.config.ts
68 lines (66 loc) · 2.13 KB
/
webpack.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
import { join } from 'path';
const nonRelative = (path: string): string => join(__dirname, `./src/lib/${path}`);
module.exports = {
target: 'node',
mode: 'development',
entry: join(__dirname, 'src/main.ts'),
node: {
__dirname: false
},
output: {
filename: 'main.js',
path: join(__dirname, 'dist')
},
resolve: {
alias: {
main: join(__dirname, './src/main.ts'),
inline: nonRelative('telegram/inline.ts'),
extra: nonRelative('telegram/extra/menu.ts'),
callback: nonRelative('telegram/callback.ts'),
keyboard: nonRelative('telegram/keyboard/menu.ts'),
// https://github.com/NodeRedis/node_redis/issues/790#issuecomment-318904983
hiredis: join(__dirname, './src/aliases/hiredis.ts'),
searches: nonRelative('anilist/searches/searches.ts'),
'telegraf-redis': nonRelative('telegram/utils/redis.ts'),
'telegraf-parse': nonRelative('telegram/utils/parse.ts'),
'telegraf-bot-typings': nonRelative('telegram/index.d.ts'),
'user-cache': nonRelative('telegram/middleware/userCache.ts')
},
extensions: [
'.js',
'.ts',
'.tsx'
]
},
module: {
rules: [
{
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto'
},
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: [
/node_modules/,
/ci/
]
},
{
test: /\.gql?$/,
use: [
{
loader: 'webpack-graphql-loader',
options: {
// validate: true,
// schema: "./path/to/schema.json",
// removeUnusedFragments: true
// etc. See "Loader Options" below
}
}
]
}
]
}
};