-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.config.js
44 lines (43 loc) · 1.05 KB
/
webpack.dev.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
const path = require('path');
const nodeExternals = require('webpack-node-externals');
const CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = {
mode: 'development',
target: 'node',
externals:[ nodeExternals() ],
entry: {
app: './src/server.ts'
},
output: {
filename: 'server.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: [/\.ts$/],
loader: 'ts-loader',
include: path.resolve(__dirname, 'src'),
exclude: /node_modules/
},
{
test: /\.graphql$/,
exclude: /node_modules/,
loader: 'graphql-tag/loader',
}
]
},
resolve: {
alias: {
Classes: path.resolve(__dirname, 'src/classes/'),
GQLTypeDefs: path.resolve(__dirname, 'src/gqlTypeDefs/'),
Models: path.resolve(__dirname, 'src/models/'),
Schema: path.resolve(__dirname, 'src/schema/'),
Types: path.resolve(__dirname, 'src/types/')
},
extensions: [ '.ts' ]
},
plugins: [
new CleanWebpackPlugin(['dist']),
]
};