-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.server.js
More file actions
41 lines (38 loc) · 1.02 KB
/
webpack.server.js
File metadata and controls
41 lines (38 loc) · 1.02 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
37
38
39
40
41
/* eslint-disable */
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');
const nodeExternals = require('webpack-node-externals');
const dotenv = require('dotenv-webpack');
const path = require('path');
const { NODE_ENV = 'production' } = process.env;
const smp = new SpeedMeasurePlugin();
module.exports = smp.wrap({
entry: './src/server.ts',
mode: NODE_ENV,
target: 'node',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'server.js',
pathinfo: false,
},
resolve: {
extensions: ['.ts', '.js'],
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /client/,
use: [
{
loader: 'ts-loader',
options: {
transpileOnly: true,
},
},
],
},
],
},
externals: [nodeExternals()],
plugins: [new dotenv()],
});