forked from MatchbookLab/gloomhavendb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
55 lines (52 loc) · 1.27 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
43
44
45
46
47
48
49
50
51
52
53
54
55
// this is the SERVER's webpack config
const webpack = require('webpack');
const path = require('path');
const nodeExternals = require('webpack-node-externals');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
module.exports = {
entry: ['webpack/hot/poll?174', './src/server/main.ts'],
watch: !process.env.NO_WATCH,
target: 'node',
node: {
__dirname: true,
},
externals: [
nodeExternals({
whitelist: ['webpack/hot/poll?174'],
}),
],
module: {
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
exclude: [
/node_modules/,
/e2e/,
/client/,
],
},
],
},
mode: 'development',
devtool: 'cheap-module-inline-source-map',
resolve: {
extensions: ['.ts', '.js'],
plugins: [
new TsconfigPathsPlugin({
configFile: path.join(__dirname, '/src/server/tsconfig.server.json'),
}),
],
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.WatchIgnorePlugin([/\.js$/, /\.d\.ts$/, /\.spec\.ts/, /\/e2e\//, /\/client\//]),
],
output: {
path: path.join(__dirname, 'dist/server-hot'),
filename: 'server.js',
},
};
setTimeout(() => {
console.log('Please wait while webpack builds for the first time…');
});