-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.cjs
executable file
·48 lines (45 loc) · 1.22 KB
/
webpack.config.cjs
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
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const { EnvironmentPlugin } = require('webpack');
require('dotenv').config({ path: 'config/.env' });
const serverConfig = {
name: "server",
mode: "development",
target: "node",
context: path.resolve(__dirname, ''),
entry: {
server: "./build/Server/Api/index.js"
},
output: {
path: path.resolve(__dirname, 'dist/Server'),
filename: "[name].bundle.js"
}
};
const clientConfig = {
name: "client",
mode: "development",
target: "web",
devtool: "eval-source-map",
context: path.resolve(__dirname, ''),
entry: {
signin: "./build/Client/React/Pages/SignIn.js"
},
output: {
path: path.resolve(__dirname, 'dist/Client'),
filename: "[name].bundle.js"
},
plugins: [
new HtmlWebpackPlugin({
filename: "signIn.html",
title: "Sign In"
}),
new EnvironmentPlugin(['API_HOSTNAME', 'API_PORT'])
],
resolve: {
fallback: {
"https": require.resolve("https-browserify"),
"http": require.resolve("stream-http")
}
}
};
module.exports = [serverConfig, clientConfig];