forked from ffxiv-teamcraft/ffxiv-teamcraft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.server.config.js
58 lines (56 loc) · 1.47 KB
/
webpack.server.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
56
57
58
const path = require('path');
const webpack = require('webpack');
const APP_NAME = 'client';
module.exports = {
entry: { server: './apps/client/server.ts' },
resolve: { extensions: ['.js', '.ts'] },
mode: 'development',
target: 'node',
externals: [
/* Firebase has some troubles being webpacked when in
in the Node environment, let's skip it.
Note: you may need to exclude other dependencies depending
on your project. */
/^firebase/,
"firebase",
"@firebase/app",
"@firebase/firestore",
"@firebase/analytics",
"@firebase/auth",
"@firebase/functions",
"@firebase/installations",
"@firebase/messaging",
"@firebase/messaging/sw",
"@firebase/storage",
"@firebase/performance",
"@firebase/remote-config",
"@firebase/util",
"bufferutil",
"utf-8-validate"
],
output: {
// Export a UMD of the webpacked server.ts & deps, for
// rendering in Cloud Functions
path: path.join(__dirname, `dist/${APP_NAME}-webpack`),
library: 'app',
libraryTarget: 'umd',
filename: '[name].js'
},
module: {
rules: [
{ test: /\.ts$/, loader: 'ts-loader' }
]
},
plugins: [
new webpack.ContextReplacementPlugin(
/(.+)?angular(\\|\/)core(.+)?/,
path.join(__dirname, 'src'), // location of your src
{} // a map of your routes
),
new webpack.ContextReplacementPlugin(
/(.+)?express(\\|\/)(.+)?/,
path.join(__dirname, 'src'),
{}
)
]
};