-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwebpack.config.ts
40 lines (38 loc) · 978 Bytes
/
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
// eslint-disable-next-line max-len
/* eslint-disable unicorn/prefer-node-protocol, unicorn/import-style, unicorn/prefer-module, import/no-import-module-exports */
import { resolve } from 'path';
import nodeExternals from 'webpack-node-externals';
module.exports = {
entry: './src/index.ts',
mode: 'production',
externals: [nodeExternals()],
module: {
rules: [
{
test: /\.tsx?$/,
use: [
{
loader: 'ts-loader',
options: {
configFile: 'tsconfig.production.json',
},
},
],
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
alias: {
'@localTypes': resolve(__dirname, 'types'),
'@src': resolve(__dirname, 'src'),
'@utils': resolve(__dirname, 'src/utils'),
},
},
output: {
path: resolve(__dirname, './build/src'),
filename: 'index.js',
libraryTarget: 'commonjs',
},
};