-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
42 lines (41 loc) · 1.06 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
const nodeExternals = require('webpack-node-externals')
module.exports = {
mode: "development",
target: "node",
externals: [nodeExternals()],
entry: "./src/server/server.ts",
output: {
path: __dirname + "/build/server",
},
devtool: 'source-map',
resolve: {
extensions: [".ts", ".tsx", ".js"]
},
module: {
rules: [
{
test: /\.css$/i,
use: ['css-loader'],
},
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: {
transpileOnly: true,
onlyCompileBundledFiles: true,
reportFiles: ['src/server/server.ts'],
},
},
{
enforce: 'pre',
test: /\.js$/,
exclude: /node_modules/,
loader: 'source-map-loader',
},
{
test: /\.(png|jpe?g|gif|tff)$/i,
use: ['file-loader'],
},
],
},
};