-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.ts
More file actions
36 lines (33 loc) · 1.04 KB
/
webpack.config.ts
File metadata and controls
36 lines (33 loc) · 1.04 KB
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
import type { Configuration } from 'webpack';
import path from 'path';
import nodeExternals from 'webpack-node-externals';
import slsw from 'serverless-webpack';
const config: Configuration = {
mode: slsw.lib.webpack.isLocal ? 'development' : 'production',
entry: slsw.lib.entries,
devtool: 'source-map',
output: {
libraryTarget: 'commonjs',
path: path.join(__dirname, '.webpack'),
filename: '[name].js',
},
target: 'node',
externals: [nodeExternals()],
resolve: {
extensions: ['.js', '.jsx', '.json', '.d.ts', '.ts', '.tsx'],
alias: {
src: path.resolve(__dirname, 'src/'),
middleware: path.resolve(__dirname, 'src/middleware/'),
models: path.resolve(__dirname, 'src/models/'),
routes: path.resolve(__dirname, 'src/routes/'),
'input-schemas': path.resolve(__dirname, 'src/input-schemas/'),
},
},
module: {
rules: [
// all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
{ test: /\.tsx?$/, loader: 'ts-loader' },
],
},
};
module.exports = config;